From: "Ronald S. Bultje" <[email protected]>
Remove the functions that were set based on nonzero (32) values
for dct_bits.
---
libavcodec/dsputil.c | 17 +++++-----
libavcodec/dsputil_template.c | 71 +++++++++++++++++++----------------------
2 files changed, 42 insertions(+), 46 deletions(-)
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 999b133..5ee3072 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);\
+#define BIT_DEPTH_FUNCS(depth) \
+ c->get_pixels = FUNCC(get_pixels, depth);\
+ c->draw_edges = FUNCC(draw_edges, depth);
+
+ c->clear_block = FUNCC(clear_block, 8);
+ c->clear_blocks = FUNCC(clear_blocks, 8);
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 c876b28..cee5d7e 100644
--- a/libavcodec/dsputil_template.c
+++ b/libavcodec/dsputil_template.c
@@ -65,46 +65,41 @@ 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);
+}
+
+/**
+ * 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
--
1.7.9.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel