diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-08-31 14:17:51 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-08-31 14:17:51 +0000 |
commit | e7fce5e9fbfee90d855fd6aba4b767525f06816a (patch) | |
tree | f293534bc3679988b1c63861254d0111d3ed01fb | |
parent | 8e779b900f0132d4152812154fec27b0f603ba8d (diff) | |
download | ffmpeg-e7fce5e9fbfee90d855fd6aba4b767525f06816a.tar.gz |
bitexact hack for the simple mmx idct
Originally committed as revision 886 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/i386/dsputil_mmx.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/dsputil_mmx.c index f1bace79dd..190e282767 100644 --- a/libavcodec/i386/dsputil_mmx.c +++ b/libavcodec/i386/dsputil_mmx.c @@ -524,6 +524,28 @@ void dsputil_init_mmx(void) #endif } +void gen_idct_put(UINT8 *dest, int line_size, DCTELEM *block); + +/** + * this will send coeff matrixes which would have different results for the 16383 type MMX vs C IDCTs to the C IDCT + */ +void bit_exact_idct_put(UINT8 *dest, int line_size, INT16 *block){ + if( block[0]>1022 && block[1]==0 && block[4 ]==0 && block[5 ]==0 + && block[8]==0 && block[9]==0 && block[12]==0 && block[13]==0){ + int16_t tmp[64]; + int i; + + for(i=0; i<64; i++) + tmp[i]= block[i]; + for(i=0; i<64; i++) + block[i]= tmp[block_permute_op(i)]; + + simple_idct_put(dest, line_size, block); + } + else + gen_idct_put(dest, line_size, block); +} + /* remove any non bit exact operation (testing purpose). NOTE that this function should be kept as small as possible because it is always difficult to test automatically non bit exact cases. */ @@ -546,5 +568,9 @@ void dsputil_set_bit_exact_mmx(void) put_no_rnd_pixels_tab[2] = put_no_rnd_pixels_y2_mmx; avg_pixels_tab[3] = avg_pixels_xy2_mmx; } +#ifdef SIMPLE_IDCT + if(ff_idct_put==gen_idct_put && ff_idct == simple_idct_mmx) + ff_idct_put= bit_exact_idct_put; +#endif } } |