X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fidctdsp.c;h=846ed0b0f8322315d9f20b70bee18f6bb61b1af7;hb=2e8b0446c6798947dac77fee4a06f9c4e8131ab5;hp=0122d29efa325fad57aefa70e1ff837bce688607;hpb=40e32f83c6a2085093b61e959f34a106fa2dad6b;p=ffmpeg diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c index 0122d29efa3..846ed0b0f83 100644 --- a/libavcodec/idctdsp.c +++ b/libavcodec/idctdsp.c @@ -256,14 +256,22 @@ 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_10; - c->idct_add = ff_simple_idct_add_10; - c->idct = ff_simple_idct_10; + /* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT + However, it only uses idct_put */ + if (c->mpeg4_studio_profile) { + c->idct_put = ff_simple_idct_put_int32_10bit; + c->idct_add = NULL; + c->idct = NULL; + } 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_12; - c->idct_add = ff_simple_idct_add_12; - c->idct = ff_simple_idct_12; + c->idct_put = ff_simple_idct_put_int16_12bit; + c->idct_add = ff_simple_idct_add_int16_12bit; + c->idct = ff_simple_idct_int16_12bit; c->perm_type = FF_IDCT_PERM_NONE; } else { if (avctx->idct_algo == FF_IDCT_INT) { @@ -280,9 +288,9 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx) #endif /* CONFIG_FAANIDCT */ } else { // accurate/default /* Be sure FF_IDCT_NONE will select this one, since it uses FF_IDCT_PERM_NONE */ - c->idct_put = ff_simple_idct_put_8; - c->idct_add = ff_simple_idct_add_8; - c->idct = ff_simple_idct_8; + c->idct_put = ff_simple_idct_put_int16_8bit; + c->idct_add = ff_simple_idct_add_int16_8bit; + c->idct = ff_simple_idct_int16_8bit; c->perm_type = FF_IDCT_PERM_NONE; } }