diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-05 01:32:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-10 02:17:52 +0200 |
commit | e8b9e1e2942355660e246cf4b9a18ce1a095419f (patch) | |
tree | 85c2fee42d71c8ad749e1e61836aba3f29f4e4c3 /libavcodec/dsputil.c | |
parent | 1a8b0025f153c48d0a06ac57f211fb692ca7dd0b (diff) | |
download | ffmpeg-e8b9e1e2942355660e246cf4b9a18ce1a095419f.tar.gz |
dsputil: extend things to 12 and 14 bits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 9b32dff117..05140e32ea 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -43,6 +43,7 @@ uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0, }; uint32_t ff_squareTbl[512] = {0, }; +#define pixeltmp int16_t #define BIT_DEPTH 9 #include "dsputil_template.c" #undef BIT_DEPTH @@ -51,8 +52,21 @@ uint32_t ff_squareTbl[512] = {0, }; #include "dsputil_template.c" #undef BIT_DEPTH +#undef pixeltmp +#define pixeltmp int32_t +#define BIT_DEPTH 12 +#include "dsputil_template.c" +#undef BIT_DEPTH + +#define BIT_DEPTH 14 +#include "dsputil_template.c" +#undef BIT_DEPTH + +#undef pixeltmp +#define pixeltmp int16_t #define BIT_DEPTH 8 #include "dsputil_template.c" +#undef pixeltmp // 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size #define pb_7f (~0UL/255 * 0x7f) @@ -3147,6 +3161,20 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) 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); + } + break; default: av_assert0(avctx->bits_per_raw_sample<=8 || avctx->codec_type != AVMEDIA_TYPE_VIDEO); BIT_DEPTH_FUNCS(8, _16); |