diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-22 21:37:54 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-22 22:26:55 +0200 |
commit | 70d54392f5015b9c6594fcae558f59f952501e3b (patch) | |
tree | bf8188c68474cebf9982c80cfe6244b3d4347f23 /libavcodec/mjpegdec.c | |
parent | 92ef4be4ab9fbb7d901b22e0036a4ca90b00a476 (diff) | |
download | ffmpeg-70d54392f5015b9c6594fcae558f59f952501e3b.tar.gz |
lowres2 support.
The new lowres support is limited to decoders where lowres decoding
is possible in high quality.
I was not able to measure any speed difference, but if one is found
the 2-3 lines that might affect speed can be made compile time conditional
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 330f4f5892..a841384af2 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1003,8 +1003,8 @@ 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); + block_offset = (((linesize[c] * (v * mb_y + y) * 8) + + (h * mb_x + x) * 8) >> s->avctx->lowres); if (s->interlaced && s->bottom_field) block_offset += linesize[c] >> 1; @@ -1814,6 +1814,7 @@ 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, }; @@ -1827,5 +1828,6 @@ 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"), }; |