summaryrefslogtreecommitdiff
path: root/libavfilter/scene_sad.h
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2018-04-05 01:37:25 +0200
committerMarton Balint <cus@passwd.hu>2018-11-11 20:30:50 +0100
commit6c2a7a8e9a3698f37913d3f24723fbb8fa895798 (patch)
treee078a0d996756411dd2087fbdce35474cce539cf /libavfilter/scene_sad.h
parent6df9020f45eaff66ba2c2bac98cda9ddaacb03f3 (diff)
avfilter/vf_framerate: factorize SAD functions which compute SAD for a whole frame
Also add SIMD which works on lines because it is faster then calculating it on 8x8 blocks using pixelutils. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter/scene_sad.h')
-rw-r--r--libavfilter/scene_sad.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/libavfilter/scene_sad.h b/libavfilter/scene_sad.h
new file mode 100644
index 0000000000..433c69473d
--- /dev/null
+++ b/libavfilter/scene_sad.h
@@ -0,0 +1,44 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Scene SAD funtions
+ */
+
+#ifndef AVFILTER_SCENE_SAD_H
+#define AVFILTER_SCENE_SAD_H
+
+#include "avfilter.h"
+
+#define SCENE_SAD_PARAMS const uint8_t *src1, ptrdiff_t stride1, \
+ const uint8_t *src2, ptrdiff_t stride2, \
+ ptrdiff_t width, ptrdiff_t height, \
+ uint64_t *sum
+
+typedef void (*ff_scene_sad_fn)(SCENE_SAD_PARAMS);
+
+void ff_scene_sad_c(SCENE_SAD_PARAMS);
+
+void ff_scene_sad16_c(SCENE_SAD_PARAMS);
+
+ff_scene_sad_fn ff_scene_sad_get_fn_x86(int depth);
+
+ff_scene_sad_fn ff_scene_sad_get_fn(int depth);
+
+#endif /* AVFILTER_SCENE_SAD_H */