diff options
Diffstat (limited to 'libavcodec/idctdsp.c')
-rw-r--r-- | libavcodec/idctdsp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c index 1de372d2b9..662033bd78 100644 --- a/libavcodec/idctdsp.c +++ b/libavcodec/idctdsp.c @@ -256,9 +256,15 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx) c->perm_type = FF_IDCT_PERM_NONE; } else { if (avctx->bits_per_raw_sample == 10 || avctx->bits_per_raw_sample == 9) { - c->idct_put = ff_simple_idct_put_int16_10bit; - c->idct_add = ff_simple_idct_add_int16_10bit; - c->idct = ff_simple_idct_int16_10bit; + /* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT + However, it only uses idct_put */ + if (avctx->codec_id == AV_CODEC_ID_MPEG4 && avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO) + c->idct_put = ff_simple_idct_put_int32_10bit; + else { + c->idct_put = ff_simple_idct_put_int16_10bit; + c->idct_add = ff_simple_idct_add_int16_10bit; + c->idct = ff_simple_idct_int16_10bit; + } c->perm_type = FF_IDCT_PERM_NONE; } else if (avctx->bits_per_raw_sample == 12) { c->idct_put = ff_simple_idct_put_int16_12bit; |