summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264dsp.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-02-11 17:04:27 -0800
committerMichael Niedermayer <michaelni@gmx.at>2013-02-12 02:14:16 +0100
commit7ff1a4b10f2d7f9a4ae1c72e1259b4ed7d13e316 (patch)
treedafa300b66ea1b51f466f2531b15c1a3c5ca5b1c /libavcodec/h264dsp.c
parent5260edee7e5bd975837696c8c8c1a80eb2fbd7c1 (diff)
downloadffmpeg-streaming-7ff1a4b10f2d7f9a4ae1c72e1259b4ed7d13e316.zip
ffmpeg-streaming-7ff1a4b10f2d7f9a4ae1c72e1259b4ed7d13e316.tar.gz
Add add_pixels4/8() to h264dsp, and remove add_pixels4 from dsputil.
These functions are mostly H264-specific (the only other user I can spot is bink), and this allows us to special-case some functionality for H264. Also remove the 16-bit-coeff with >8bpp versions (unused) and merge the duplicate 32-bit-coeff for >8bpp (identical). Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264dsp.c')
-rw-r--r--libavcodec/h264dsp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/h264dsp.c b/libavcodec/h264dsp.c
index 83de168..bb70d4e 100644
--- a/libavcodec/h264dsp.c
+++ b/libavcodec/h264dsp.c
@@ -52,11 +52,29 @@
#include "h264dsp_template.c"
#undef BIT_DEPTH
+#define BIT_DEPTH 8
+#include "h264addpx_template.c"
+#undef BIT_DEPTH
+
+#define BIT_DEPTH 16
+#include "h264addpx_template.c"
+#undef BIT_DEPTH
+
void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
{
#undef FUNC
#define FUNC(a, depth) a ## _ ## depth ## _c
+#define ADDPX_DSP(depth) \
+ c->h264_add_pixels4 = FUNC(ff_h264_add_pixels4, depth);\
+ c->h264_add_pixels8 = FUNC(ff_h264_add_pixels8, depth)
+
+ if (bit_depth > 8 && bit_depth <= 16) {
+ ADDPX_DSP(16);
+ } else {
+ ADDPX_DSP(8);
+ }
+
#define H264_DSP(depth) \
c->h264_idct_add= FUNC(ff_h264_idct_add, depth);\
c->h264_idct8_add= FUNC(ff_h264_idct8_add, depth);\
OpenPOWER on IntegriCloud