Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-03-14 17:44:18 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-03-14 17:56:48 +0400
commit4a88d81c9e3758dfad6bf35681e27b9c10f0b346 (patch)
tree50f0002cde9885d60405d73ad0d91b222d3e704e /libavcodec/dsputil.c
parent49a514c13e148a4c0984e5c03262ced69575b620 (diff)
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.c')
-rw-r--r--libavcodec/dsputil.c51
1 files changed, 9 insertions, 42 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index f4f84b59e1..d4259333da 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -44,19 +44,7 @@
uint32_t ff_squareTbl[512] = {0, };
-#define BIT_DEPTH 9
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 12
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 14
+#define BIT_DEPTH 16
#include "dsputil_template.c"
#undef BIT_DEPTH
@@ -2931,44 +2919,23 @@ 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:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(9, _32);
- } else {
- BIT_DEPTH_FUNCS(9, _16);
- }
- break;
case 10:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(10, _32);
- } else {
- BIT_DEPTH_FUNCS(10, _16);
- }
- break;
case 12:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(12, _32);
- } else {
- BIT_DEPTH_FUNCS(12, _16);
- }
- break;
case 14:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(14, _32);
- } else {
- BIT_DEPTH_FUNCS(14, _16);
- }
+ BIT_DEPTH_FUNCS(16);
break;
default:
if(avctx->bits_per_raw_sample<=8 || avctx->codec_type != AVMEDIA_TYPE_VIDEO) {
- BIT_DEPTH_FUNCS(8, _16);
+ BIT_DEPTH_FUNCS(8);
}
break;
}