diff options
author | Mans Rullgard <mans@mansr.com> | 2012-04-12 13:55:49 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-04-21 18:56:19 +0100 |
commit | 2bcbd98459915baefc15043d02f4a942ebcd33da (patch) | |
tree | 8dc1411f9bab944622c785efbd9c5dc4959b00ee /libavcodec/mjpegdec.c | |
parent | 95510be8c35753da8f48062b28b65e7acdab965f (diff) | |
download | ffmpeg-2bcbd98459915baefc15043d02f4a942ebcd33da.tar.gz |
Remove lowres video decoding
This feature is complex, of questionable utility, and slows down
normal decoding.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 5eab559f84..8552ec1a6f 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -796,21 +796,6 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, return 0; } -static av_always_inline void mjpeg_copy_block(uint8_t *dst, const uint8_t *src, - int linesize, int lowres) -{ - switch (lowres) { - case 0: copy_block8(dst, src, linesize, linesize, 8); - break; - case 1: copy_block4(dst, src, linesize, linesize, 4); - break; - case 2: copy_block2(dst, src, linesize, linesize, 2); - break; - case 3: *dst = *src; - break; - } -} - static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, int Al, const uint8_t *mb_bitmask, const AVFrame *reference) @@ -869,16 +854,16 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, x = 0; y = 0; for (j = 0; j < n; j++) { - block_offset = (((linesize[c] * (v * mb_y + y) * 8) + - (h * mb_x + x) * 8) >> s->avctx->lowres); + block_offset = ((linesize[c] * (v * mb_y + y) * 8) + + (h * mb_x + x) * 8); if (s->interlaced && s->bottom_field) block_offset += linesize[c] >> 1; ptr = data[c] + block_offset; if (!s->progressive) { if (copy_mb) - mjpeg_copy_block(ptr, reference_data[c] + block_offset, - linesize[c], s->avctx->lowres); + copy_block8(ptr, reference_data[c] + block_offset, + linesize[c], linesize[c], 8); else { s->dsp.clear_block(s->block); if (decode_block(s, s->block, i, @@ -968,7 +953,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, } for (mb_y = 0; mb_y < s->mb_height; mb_y++) { - int block_offset = (mb_y * linesize * 8 >> s->avctx->lowres); + int block_offset = mb_y * linesize * 8; uint8_t *ptr = data + block_offset; int block_idx = mb_y * s->block_stride[c]; DCTELEM (*block)[64] = &s->blocks[c][block_idx]; @@ -993,11 +978,11 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, if (last_scan) { if (copy_mb) { - mjpeg_copy_block(ptr, reference_data + block_offset, - linesize, s->avctx->lowres); + copy_block8(ptr, reference_data + block_offset, + linesize, linesize, 8); } else { s->dsp.idct_put(ptr, linesize, *block); - ptr += 8 >> s->avctx->lowres; + ptr += 8; } } } @@ -1667,7 +1652,6 @@ AVCodec ff_mjpeg_decoder = { .close = ff_mjpeg_decode_end, .decode = ff_mjpeg_decode_frame, .capabilities = CODEC_CAP_DR1, - .max_lowres = 3, .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), .priv_class = &mjpegdec_class, }; @@ -1681,6 +1665,5 @@ AVCodec ff_thp_decoder = { .close = ff_mjpeg_decode_end, .decode = ff_mjpeg_decode_frame, .capabilities = CODEC_CAP_DR1, - .max_lowres = 3, .long_name = NULL_IF_CONFIG_SMALL("Nintendo Gamecube THP video"), }; |