diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-02-11 17:04:27 -0800 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-02-19 22:33:29 +0200 |
commit | 2ed008204d5467be03a0a3af1e293b2f7038d0a0 (patch) | |
tree | 7293700d56b1e8b10eab3b4cf147d23b6a7aa049 /libavcodec/dsputil.c | |
parent | e5ffffe48d20642acc079166f0fa7d93a6a9f594 (diff) | |
download | ffmpeg-2ed008204d5467be03a0a3af1e293b2f7038d0a0.tar.gz |
h264: 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: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 30c315eab8..62fa0acbde 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -403,6 +403,26 @@ static void put_signed_pixels_clamped_c(const int16_t *block, } } +static void add_pixels8_c(uint8_t *restrict pixels, + int16_t *block, + int line_size) +{ + int i; + + for(i=0;i<8;i++) { + pixels[0] += block[0]; + pixels[1] += block[1]; + pixels[2] += block[2]; + pixels[3] += block[3]; + pixels[4] += block[4]; + pixels[5] += block[5]; + pixels[6] += block[6]; + pixels[7] += block[7]; + pixels += line_size; + block += 8; + } +} + static void add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, int line_size) { @@ -2678,6 +2698,8 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) c->shrink[2]= ff_shrink44; c->shrink[3]= ff_shrink88; + c->add_pixels8 = add_pixels8_c; + #define hpel_funcs(prefix, idx, num) \ c->prefix ## _pixels_tab idx [0] = prefix ## _pixels ## num ## _8_c; \ c->prefix ## _pixels_tab idx [1] = prefix ## _pixels ## num ## _x2_8_c; \ @@ -2706,8 +2728,6 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) c->draw_edges = FUNCC(draw_edges , depth);\ c->clear_block = FUNCC(clear_block ## dct , depth);\ c->clear_blocks = FUNCC(clear_blocks ## dct , depth);\ - c->add_pixels8 = FUNCC(add_pixels8 ## dct , depth);\ - c->add_pixels4 = FUNCC(add_pixels4 ## dct , depth);\ switch (avctx->bits_per_raw_sample) { case 9: |