diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-09 14:10:41 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-10 07:51:16 -0400 |
commit | fd8b90f5f63de12c1ee1ec1cbe99791c5629c582 (patch) | |
tree | bdf50fda06657232f3c54265cb7fe3681567dd97 /libavcodec/x86/vp9dsp_init.c | |
parent | 4bb9dbe4d7952d82bddb23c45889ab1550897397 (diff) | |
download | ffmpeg-fd8b90f5f63de12c1ee1ec1cbe99791c5629c582.tar.gz |
vp9: fix overflow in 8x8 topleft 32x32 idct ssse3 version.
Also disable the mmx/iwht optimization when the bitexact flag is set.
With synthetically coded coefficients (i.e. these that lead to a
residual well outside the [-255,255] range), our optimizations will
overflow. It doesn't make sense to fix the overflows, since they can
only occur on synthetic input, not on real fwht-generated input. Thus,
add a bitexact flag that disables this optimization.
Diffstat (limited to 'libavcodec/x86/vp9dsp_init.c')
-rw-r--r-- | libavcodec/x86/vp9dsp_init.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/x86/vp9dsp_init.c b/libavcodec/x86/vp9dsp_init.c index 00e7125a0c..f24cb674fa 100644 --- a/libavcodec/x86/vp9dsp_init.c +++ b/libavcodec/x86/vp9dsp_init.c @@ -307,7 +307,7 @@ ipred_func(32, tm, avx2); #endif /* HAVE_YASM */ -av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp) +av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp, int bitexact) { #if HAVE_YASM int cpu_flags; @@ -388,10 +388,12 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp) if (EXTERNAL_MMX(cpu_flags)) { init_fpel(4, 0, 4, put, mmx); init_fpel(3, 0, 8, put, mmx); - dsp->itxfm_add[4 /* lossless */][DCT_DCT] = - dsp->itxfm_add[4 /* lossless */][ADST_DCT] = - dsp->itxfm_add[4 /* lossless */][DCT_ADST] = - dsp->itxfm_add[4 /* lossless */][ADST_ADST] = ff_vp9_iwht_iwht_4x4_add_mmx; + if (!bitexact) { + dsp->itxfm_add[4 /* lossless */][DCT_DCT] = + dsp->itxfm_add[4 /* lossless */][ADST_DCT] = + dsp->itxfm_add[4 /* lossless */][DCT_ADST] = + dsp->itxfm_add[4 /* lossless */][ADST_ADST] = ff_vp9_iwht_iwht_4x4_add_mmx; + } init_ipred(8, mmx, v, VERT); } |