diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-02-12 05:04:27 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-12 05:14:16 +0400 |
commit | 7ff1a4b10f2d7f9a4ae1c72e1259b4ed7d13e316 (patch) | |
tree | dafa300b66ea1b51f466f2531b15c1a3c5ca5b1c /libavcodec/dsputil.c | |
parent | 5260edee7e5bd975837696c8c8c1a80eb2fbd7c1 (diff) |
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/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index a68133b76e..b93851c6ae 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -443,6 +443,27 @@ static void put_signed_pixels_clamped_c(const int16_t *block, } } +static void add_pixels8_c(uint8_t *av_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 *av_restrict pixels, int line_size) { @@ -2852,6 +2873,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; \ @@ -2879,9 +2902,7 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) c->get_pixels = FUNCC(get_pixels ## dct , depth);\ 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);\ + c->clear_blocks = FUNCC(clear_blocks ## dct , depth) switch (avctx->bits_per_raw_sample) { case 9: |