diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-03-14 06:44:18 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-14 14:56:48 +0100 |
commit | 4a88d81c9e3758dfad6bf35681e27b9c10f0b346 (patch) | |
tree | 50f0002cde9885d60405d73ad0d91b222d3e704e /libavcodec/dsputil_template.c | |
parent | 49a514c13e148a4c0984e5c03262ced69575b620 (diff) | |
download | ffmpeg-4a88d81c9e3758dfad6bf35681e27b9c10f0b346.tar.gz |
dsputil: remove duplicate or unused functions.
dct_bits is never set except in h264, where it is never used, thus
remove it. Then, remove all functions that were set based on non-zero
(32) values for dct_bits. Lastly, merge 9-14 bpp functions for get_pixels
and draw_edge, which only care about pixel storage unit size, not actual
bits used (i.e. they don't clip).
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dsputil_template.c')
-rw-r--r-- | libavcodec/dsputil_template.c | 71 |
1 files changed, 33 insertions, 38 deletions
diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index f7f4709c8f..6830ec35a7 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -65,46 +65,41 @@ static void FUNCC(draw_edges)(uint8_t *p_buf, int p_wrap, int width, int height, memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom } -#define DCTELEM_FUNCS(dctcoef, suffix) \ -static void FUNCC(get_pixels ## suffix)(int16_t *av_restrict _block, \ - const uint8_t *_pixels, \ - int line_size) \ -{ \ - const pixel *pixels = (const pixel *) _pixels; \ - dctcoef *av_restrict block = (dctcoef *) _block; \ - int i; \ - \ - /* read the pixels */ \ - for(i=0;i<8;i++) { \ - block[0] = pixels[0]; \ - block[1] = pixels[1]; \ - block[2] = pixels[2]; \ - block[3] = pixels[3]; \ - block[4] = pixels[4]; \ - block[5] = pixels[5]; \ - block[6] = pixels[6]; \ - block[7] = pixels[7]; \ - pixels += line_size / sizeof(pixel); \ - block += 8; \ - } \ -} \ - \ -static void FUNCC(clear_block ## suffix)(int16_t *block) \ -{ \ - memset(block, 0, sizeof(dctcoef)*64); \ -} \ - \ -/** \ - * memset(blocks, 0, sizeof(int16_t)*6*64) \ - */ \ -static void FUNCC(clear_blocks ## suffix)(int16_t *blocks) \ -{ \ - memset(blocks, 0, sizeof(dctcoef)*6*64); \ +static void FUNCC(get_pixels)(int16_t *av_restrict block, + const uint8_t *_pixels, + int line_size) +{ + const pixel *pixels = (const pixel *) _pixels; + int i; + + /* read the pixels */ + for(i=0;i<8;i++) { + block[0] = pixels[0]; + block[1] = pixels[1]; + block[2] = pixels[2]; + block[3] = pixels[3]; + block[4] = pixels[4]; + block[5] = pixels[5]; + block[6] = pixels[6]; + block[7] = pixels[7]; + pixels += line_size / sizeof(pixel); + block += 8; + } } -DCTELEM_FUNCS(int16_t, _16) -#if BIT_DEPTH > 8 -DCTELEM_FUNCS(dctcoef, _32) +#if BIT_DEPTH == 8 +static void FUNCC(clear_block)(int16_t *block) +{ + memset(block, 0, sizeof(int16_t)*64); +} + +/** + * memset(blocks, 0, sizeof(int16_t)*6*64) + */ +static void FUNCC(clear_blocks)(int16_t *blocks) +{ + memset(blocks, 0, sizeof(int16_t)*6*64); +} #endif #if BIT_DEPTH == 8 |