From 619e0da19119bcd683f135fe9a164f37c0ca70d1 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 26 Mar 2013 17:07:22 +0200 Subject: [PATCH] dsputil: Remove unused 32-bit functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, if dct_bits was set to 32, we used separate 32-bit versions of these functions. Since dct_bits now is removed, remove the unused 32-bit versions of the functions. Signed-off-by: Martin Storsjö --- libavcodec/dsputil.c | 17 ++++----- libavcodec/dsputil_template.c | 68 ++++++++++++++++------------------- 2 files changed, 39 insertions(+), 46 deletions(-) diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 999b133bdf..696d16b59e 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -2728,21 +2728,22 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) #define FUNC(f, depth) f ## _ ## depth #define FUNCC(f, depth) f ## _ ## depth ## _c -#define BIT_DEPTH_FUNCS(depth, dct)\ - 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->clear_block = FUNCC(clear_block, 8); + c->clear_blocks = FUNCC(clear_blocks, 8); + +#define BIT_DEPTH_FUNCS(depth) \ + c->get_pixels = FUNCC(get_pixels, depth);\ + c->draw_edges = FUNCC(draw_edges, depth); switch (avctx->bits_per_raw_sample) { case 9: - BIT_DEPTH_FUNCS(9, _16); + BIT_DEPTH_FUNCS(9); break; case 10: - BIT_DEPTH_FUNCS(10, _16); + BIT_DEPTH_FUNCS(10); break; default: - BIT_DEPTH_FUNCS(8, _16); + BIT_DEPTH_FUNCS(8); break; } diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index c876b287eb..ff6a7d8ddc 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -65,46 +65,38 @@ static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, i 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 *restrict _block, \ - const uint8_t *_pixels, \ - int line_size) \ -{ \ - const pixel *pixels = (const pixel *) _pixels; \ - dctcoef *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 *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); +} + +static void FUNCC(clear_blocks)(int16_t *blocks) +{ + memset(blocks, 0, sizeof(int16_t)*6*64); +} #endif #if BIT_DEPTH == 8