diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-05-20 01:03:40 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-05-20 01:03:40 +0000 |
commit | 6d50b2e673f7bea1bcb873e9f8d158f9bec123eb (patch) | |
tree | 070977d7fd413ac11006dfd170918a6ec963c92d | |
parent | 3859736446d112dab7f1df00eca28290789df0fa (diff) | |
download | ffmpeg-6d50b2e673f7bea1bcb873e9f8d158f9bec123eb.tar.gz |
cleanup
Originally committed as revision 1893 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mjpeg.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 58cf89fc33..7bb3d73435 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -903,11 +903,7 @@ static int mjpeg_decode_sof0(MJpegDecodeContext *s) static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index) { int code, diff; -#if 1 code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2); -#else - code = get_vlc(&s->gb, &s->vlcs[0][dc_index]); -#endif if (code < 0) { dprintf("mjpeg_decode_dc: bad vlc: %d:%d (%p)\n", 0, dc_index, @@ -917,9 +913,7 @@ static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index) if (code == 0) { diff = 0; } else { - diff = get_bits(&s->gb, code); - if ((diff & (1 << (code - 1))) == 0) - diff = (-1 << code) | (diff + 1); + diff = get_xbits(&s->gb, code); } return diff; } @@ -947,11 +941,8 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block, ac_vlc = &s->vlcs[1][ac_index]; i = 1; for(;;) { -#if 1 code = get_vlc2(&s->gb, s->vlcs[1][ac_index].table, 9, 2); -#else - code = get_vlc(&s->gb, ac_vlc); -#endif + if (code < 0) { dprintf("error ac\n"); return -1; @@ -964,9 +955,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block, } else { run = code >> 4; nbits = code & 0xf; - level = get_bits(&s->gb, nbits); - if ((level & (1 << (nbits - 1))) == 0) - level = (-1 << nbits) | (level + 1); + level = get_xbits(&s->gb, nbits); i += run; if (i >= 64) { dprintf("error count: %d\n", i); |