summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libavcodec/arm/hpeldsp_init_arm.c3
-rw-r--r--libavcodec/dsputil.h2
-rw-r--r--libavcodec/dsputil_template.c2
-rw-r--r--libavcodec/hpel_template.c2
-rw-r--r--libavcodec/hpeldsp_template.c2
-rw-r--r--libavcodec/pixels.h37
-rw-r--r--libavcodec/rnd_avg.h8
-rw-r--r--libavcodec/x86/dsputil_init.c5
-rw-r--r--libavcodec/x86/dsputil_mmx.c3
-rw-r--r--libavcodec/x86/dsputil_x86.h12
-rw-r--r--libavcodec/x86/h264_qpel.c5
-rw-r--r--libavcodec/x86/hpeldsp_init.c29
-rw-r--r--libavcodec/x86/rnd_mmx.c5
13 files changed, 70 insertions, 45 deletions
diff --git a/libavcodec/arm/hpeldsp_init_arm.c b/libavcodec/arm/hpeldsp_init_arm.c
index 0293ffe..1977b13 100644
--- a/libavcodec/arm/hpeldsp_init_arm.c
+++ b/libavcodec/arm/hpeldsp_init_arm.c
@@ -21,8 +21,7 @@
#include "libavutil/arm/cpu.h"
#include "libavutil/attributes.h"
-#include "libavcodec/bit_depth_template.c" // for CALL_2X_PIXELS
-#include "libavcodec/rnd_avg.h"
+#include "libavcodec/pixels.h"
#include "hpeldsp_arm.h"
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 8f83006..5255625 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -31,7 +31,6 @@
#define AVCODEC_DSPUTIL_H
#include "avcodec.h"
-#include "rnd_avg.h"
/* encoding scans */
extern const uint8_t ff_alternate_horizontal_scan[64];
@@ -40,7 +39,6 @@ extern const uint8_t ff_zigzag248_direct[64];
extern uint32_t ff_square_tab[512];
-/* pixel operations */
void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c
index 84591eb..b107037 100644
--- a/libavcodec/dsputil_template.c
+++ b/libavcodec/dsputil_template.c
@@ -27,6 +27,8 @@
* DSP utils
*/
+#include "pixels.h"
+
#include "bit_depth_template.c"
#if BIT_DEPTH == 8
diff --git a/libavcodec/hpel_template.c b/libavcodec/hpel_template.c
index 594b3f6..65bbd9b 100644
--- a/libavcodec/hpel_template.c
+++ b/libavcodec/hpel_template.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "pixels.h"
+
#define DEF_HPEL(OPNAME, OP) \
static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block, \
const uint8_t *pixels, \
diff --git a/libavcodec/hpeldsp_template.c b/libavcodec/hpeldsp_template.c
index 2b0ae8d..2dc5ddc 100644
--- a/libavcodec/hpeldsp_template.c
+++ b/libavcodec/hpeldsp_template.c
@@ -28,6 +28,8 @@
* Half-pel DSP functions
*/
+#include "pixels.h"
+
#include "bit_depth_template.c"
#include "hpel_template.c"
diff --git a/libavcodec/pixels.h b/libavcodec/pixels.h
new file mode 100644
index 0000000..98eacd4
--- /dev/null
+++ b/libavcodec/pixels.h
@@ -0,0 +1,37 @@
+/*
+ * 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
+ */
+
+#ifndef AVCODEC_PIXELS_H
+#define AVCODEC_PIXELS_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+/* pixel operations */
+#define CALL_2X_PIXELS_MACRO(STATIC, a, b, n) \
+STATIC void a(uint8_t *block, const uint8_t *pixels, \
+ ptrdiff_t line_size, int h) \
+{ \
+ b(block, pixels, line_size, h); \
+ b(block + n, pixels + n, line_size, h); \
+}
+
+#define CALL_2X_PIXELS(a, b, n) CALL_2X_PIXELS_MACRO(static, a, b, n)
+#define CALL_2X_PIXELS_EXPORT(a, b, n) CALL_2X_PIXELS_MACRO(, a, b, n)
+
+#endif /* AVCODEC_PIXELS_H */
diff --git a/libavcodec/rnd_avg.h b/libavcodec/rnd_avg.h
index 96abec7..344775e 100644
--- a/libavcodec/rnd_avg.h
+++ b/libavcodec/rnd_avg.h
@@ -25,14 +25,6 @@
#include <stddef.h>
#include <stdint.h>
-#define CALL_2X_PIXELS(a, b, n) \
-static void a(uint8_t *block, const uint8_t *pixels, \
- ptrdiff_t line_size, int h) \
-{ \
- b(block, pixels, line_size, h); \
- b(block + n, pixels + n, line_size, h); \
-}
-
#define BYTE_VEC32(c) ((c) * 0x01010101UL)
#define BYTE_VEC64(c) ((c) * 0x0001000100010001UL)
diff --git a/libavcodec/x86/dsputil_init.c b/libavcodec/x86/dsputil_init.c
index 8639383..d9426c8 100644
--- a/libavcodec/x86/dsputil_init.c
+++ b/libavcodec/x86/dsputil_init.c
@@ -27,6 +27,7 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
+#include "libavcodec/pixels.h"
#include "libavcodec/simple_idct.h"
#include "libavcodec/version.h"
#include "dsputil_x86.h"
@@ -110,8 +111,8 @@ void ff_vector_clip_int32_sse4(int32_t *dst, const int32_t *src,
#if HAVE_YASM
-PIXELS16(static, ff_avg, , , _mmxext)
-PIXELS16(static, ff_put, , , _mmxext)
+CALL_2X_PIXELS(ff_avg_pixels16_mmxext, ff_avg_pixels8_mmxext, 8)
+CALL_2X_PIXELS(ff_put_pixels16_mmxext, ff_put_pixels8_mmxext, 8)
#define QPEL_OP(OPNAME, RND, MMX) \
static void OPNAME ## qpel8_mc00_ ## MMX(uint8_t *dst, uint8_t *src, \
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index 95d7774..5153e18 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -26,6 +26,7 @@
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/asm.h"
+#include "libavcodec/pixels.h"
#include "libavcodec/videodsp.h"
#include "constants.h"
#include "diracdsp_mmx.h"
@@ -554,7 +555,7 @@ void ff_ ## OPNAME2 ## _dirac_pixels32_ ## EXT(uint8_t *dst, const uint8_t *src[
}
#if HAVE_MMX_INLINE
-PIXELS16(static, ff_avg, , , _mmxext)
+CALL_2X_PIXELS(ff_avg_pixels16_mmxext, ff_avg_pixels8_mmxext, 8)
DIRAC_PIXOP(put, ff_put, mmx)
DIRAC_PIXOP(avg, ff_avg, mmx)
#endif
diff --git a/libavcodec/x86/dsputil_x86.h b/libavcodec/x86/dsputil_x86.h
index f56d8f3..c848d58 100644
--- a/libavcodec/x86/dsputil_x86.h
+++ b/libavcodec/x86/dsputil_x86.h
@@ -100,16 +100,4 @@ void ff_put_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
void ff_mmx_idct(int16_t *block);
void ff_mmxext_idct(int16_t *block);
-#define PIXELS16(STATIC, PFX1, PFX2, TYPE, CPUEXT) \
-STATIC void PFX1 ## _pixels16 ## TYPE ## CPUEXT(uint8_t *block, \
- const uint8_t *pixels, \
- ptrdiff_t line_size, \
- int h) \
-{ \
- PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block, pixels, \
- line_size, h); \
- PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block + 8, pixels + 8, \
- line_size, h); \
-}
-
#endif /* AVCODEC_X86_DSPUTIL_X86_H */
diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c
index fd6068f..3422fd1 100644
--- a/libavcodec/x86/h264_qpel.c
+++ b/libavcodec/x86/h264_qpel.c
@@ -25,6 +25,7 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/h264qpel.h"
#include "libavcodec/mpegvideo.h"
+#include "libavcodec/pixels.h"
#include "dsputil_x86.h"
#if HAVE_YASM
@@ -49,8 +50,8 @@ void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
#define ff_put_pixels16_l2_sse2 ff_put_pixels16_l2_mmxext
#define ff_avg_pixels16_l2_sse2 ff_avg_pixels16_l2_mmxext
-PIXELS16(static, ff_avg, , , _mmxext)
-PIXELS16(static, ff_put, , , _mmxext)
+CALL_2X_PIXELS(ff_avg_pixels16_mmxext, ff_avg_pixels8_mmxext, 8)
+CALL_2X_PIXELS(ff_put_pixels16_mmxext, ff_avg_pixels8_mmxext, 8)
#define DEF_QPEL(OPNAME)\
void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index aee42cd..492cc47 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -28,6 +28,7 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/hpeldsp.h"
+#include "libavcodec/pixels.h"
#include "dsputil_x86.h"
void ff_put_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels,
@@ -109,11 +110,11 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
#undef PAVGB
#undef STATIC
-PIXELS16(static, avg_no_rnd, , _y2, _mmx)
-PIXELS16(static, put_no_rnd, , _y2, _mmx)
+CALL_2X_PIXELS(avg_no_rnd_pixels16_y2_mmx, avg_no_rnd_pixels8_y2_mmx, 8)
+CALL_2X_PIXELS(put_no_rnd_pixels16_y2_mmx, put_no_rnd_pixels8_y2_mmx, 8)
-PIXELS16(static, avg_no_rnd, , _xy2, _mmx)
-PIXELS16(static, put_no_rnd, , _xy2, _mmx)
+CALL_2X_PIXELS(avg_no_rnd_pixels16_xy2_mmx, avg_no_rnd_pixels8_xy2_mmx, 8)
+CALL_2X_PIXELS(put_no_rnd_pixels16_xy2_mmx, put_no_rnd_pixels8_xy2_mmx, 8)
/***********************************/
/* MMX rounding */
@@ -130,22 +131,22 @@ PIXELS16(static, put_no_rnd, , _xy2, _mmx)
#undef PAVGBP
#undef PAVGB
-PIXELS16(static, avg, , _y2, _mmx)
-PIXELS16(static, put, , _y2, _mmx)
+CALL_2X_PIXELS(avg_pixels16_y2_mmx, avg_pixels8_y2_mmx, 8)
+CALL_2X_PIXELS(put_pixels16_y2_mmx, put_pixels8_y2_mmx, 8)
#endif /* HAVE_INLINE_ASM */
#if HAVE_YASM
-#define HPELDSP_AVG_PIXELS16(CPUEXT) \
- PIXELS16(static, put_no_rnd, ff_, _x2, CPUEXT) \
- PIXELS16(static, put, ff_, _y2, CPUEXT) \
- PIXELS16(static, put_no_rnd, ff_, _y2, CPUEXT) \
- PIXELS16(static, avg, ff_, , CPUEXT) \
- PIXELS16(static, avg, ff_, _x2, CPUEXT) \
- PIXELS16(static, avg, ff_, _y2, CPUEXT) \
- PIXELS16(static, avg, ff_, _xy2, CPUEXT)
+#define HPELDSP_AVG_PIXELS16(CPUEXT) \
+ CALL_2X_PIXELS(put_no_rnd_pixels16_x2 ## CPUEXT, ff_put_no_rnd_pixels8_x2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(put_pixels16_y2 ## CPUEXT, ff_put_pixels8_y2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(put_no_rnd_pixels16_y2 ## CPUEXT, ff_put_no_rnd_pixels8_y2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16 ## CPUEXT, ff_avg_pixels8 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16_x2 ## CPUEXT, ff_avg_pixels8_x2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16_y2 ## CPUEXT, ff_avg_pixels8_y2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16_xy2 ## CPUEXT, ff_avg_pixels8_xy2 ## CPUEXT, 8)
HPELDSP_AVG_PIXELS16(_3dnow)
HPELDSP_AVG_PIXELS16(_mmxext)
diff --git a/libavcodec/x86/rnd_mmx.c b/libavcodec/x86/rnd_mmx.c
index c76609a..746d045 100644
--- a/libavcodec/x86/rnd_mmx.c
+++ b/libavcodec/x86/rnd_mmx.c
@@ -17,6 +17,7 @@
*/
#include "config.h"
+#include "libavcodec/pixels.h"
#include "dsputil_x86.h"
#include "inline_asm.h"
@@ -30,7 +31,7 @@
#include "rnd_template.c"
-PIXELS16(, ff_avg, , _xy2, _mmx)
-PIXELS16(, ff_put, , _xy2, _mmx)
+CALL_2X_PIXELS_EXPORT(ff_avg_pixels16_xy2_mmx, ff_avg_pixels8_xy2_mmx, 8)
+CALL_2X_PIXELS_EXPORT(ff_put_pixels16_xy2_mmx, ff_put_pixels8_xy2_mmx, 8)
#endif /* HAVE_INLINE_ASM */
OpenPOWER on IntegriCloud