Commit ae57e824 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dsputil: add 12bit simple idct

Will be needed for jpeg
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d2e23733
......@@ -2720,6 +2720,11 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->idct_add = ff_simple_idct_add_10;
c->idct = ff_simple_idct_10;
c->idct_permutation_type = FF_NO_IDCT_PERM;
} else if (avctx->bits_per_raw_sample == 12) {
c->idct_put = ff_simple_idct_put_12;
c->idct_add = ff_simple_idct_add_12;
c->idct = ff_simple_idct_12;
c->idct_permutation_type = FF_NO_IDCT_PERM;
} else {
if(avctx->idct_algo==FF_IDCT_INT){
c->idct_put= jref_idct_put;
......
......@@ -38,6 +38,10 @@
#include "simple_idct_template.c"
#undef BIT_DEPTH
#define BIT_DEPTH 12
#include "simple_idct_template.c"
#undef BIT_DEPTH
/* 2x4x8 idct */
#define CN_SHIFT 12
......
......@@ -37,6 +37,11 @@ void ff_simple_idct_8(int16_t *block);
void ff_simple_idct_put_10(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_add_10(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_10(int16_t *block);
void ff_simple_idct_put_12(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_add_12(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_12(int16_t *block);
/**
* Special version of ff_simple_idct_10() which does dequantization
* and scales by a factor of 2 more between the two IDCTs to account
......
......@@ -62,7 +62,7 @@
#define MUL(a, b) MUL16(a, b)
#define MAC(a, b, c) MAC16(a, b, c)
#elif BIT_DEPTH == 10
#elif BIT_DEPTH == 10 || BIT_DEPTH == 12
#define W1 90901
#define W2 85627
......@@ -72,9 +72,15 @@
#define W6 35468
#define W7 18081
#if BIT_DEPTH == 10
#define ROW_SHIFT 15
#define COL_SHIFT 20
#define DC_SHIFT 1
#else
#define ROW_SHIFT 17
#define COL_SHIFT 18
#define DC_SHIFT -1
#endif
#define MUL(a, b) ((a) * (b))
#define MAC(a, b, c) ((a) += (b) * (c))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment