diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-01-13 04:59:37 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-01-13 04:59:37 +0000 |
commit | badaf88eeb4602afec502b5822d05fc8bb9da05b (patch) | |
tree | d9c1d65206755f08616079d76cd54c95b5b63c3f /libavcodec/dsputil.c | |
parent | 05f361f0c7d13aaa8883f401d5a524d4ec8cba94 (diff) | |
download | ffmpeg-badaf88eeb4602afec502b5822d05fc8bb9da05b.tar.gz |
(commit by michael)
dequantizers skip trailing zeros
msmpeg4 non-intra decoder has its dequantizer "build in" now
Originally committed as revision 260 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 9811df73e3..f45d051e21 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -83,9 +83,24 @@ static UINT8 simple_mmx_permutation[64]={ 0x32, 0x3A, 0x33, 0x3B, 0x36, 0x3E, 0x37, 0x3F, }; +/* used to skip zeros at the end */ +UINT8 zigzag_end[64]; + UINT8 permutation[64]; //UINT8 invPermutation[64]; +static void build_zigzag_end() +{ + int lastIndex; + int lastIndexAfterPerm=0; + for(lastIndex=0; lastIndex<64; lastIndex++) + { + if(zigzag_direct[lastIndex] > lastIndexAfterPerm) + lastIndexAfterPerm= zigzag_direct[lastIndex]; + zigzag_end[lastIndex]= lastIndexAfterPerm + 1; + } +} + void get_pixels_c(DCTELEM *block, const UINT8 *pixels, int line_size) { DCTELEM *p; @@ -509,4 +524,6 @@ void dsputil_init(void) block_permute(default_intra_matrix); block_permute(default_non_intra_matrix); } + + build_zigzag_end(); } |