[FFmpeg-devel] [PATCH 2/2] mjpegdec: fix handling of rstn in progressive jpegs.
Alexander Strasser
eclipse7 at gmx.net
Tue Dec 25 11:49:55 CET 2012
Hi Michael,
Michael Niedermayer wrote:
> mjpegdec: fix handling of rstn in progressive jpegs.
> Fixes Ticket2003
I find the commit message a bit hard to deal with. Either I understood
the code correctly and RSTn handling was missing entirely for progressive
jpegs or you fixed some existing RSTn handling code.
In the first case I would find "mjpegdec: Handle RSTn in progressive jpegs"
much clearer. In the second case it would be good to have a sentence or two
in the body of the commit message that say what was wrong before/is done
better with the patch.
Patch seems fine to me. But you have better domain knowledge of jpeg
decoding and our jpeg decoder.
Alexander
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
> libavcodec/mjpegdec.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index cf7dd8c..2ad1e2d 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1141,6 +1141,9 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
> uint8_t *last_nnz = &s->last_nnz[c][block_idx];
> for (mb_x = 0; mb_x < s->mb_width; mb_x++, block++, last_nnz++) {
> int ret;
> + if (s->restart_interval && !s->restart_count)
> + s->restart_count = s->restart_interval;
> +
> if (Ah)
> ret = decode_block_refinement(s, *block, last_nnz, s->ac_index[0],
> quant_matrix, ss, se, Al, &EOBRUN);
> @@ -1157,6 +1160,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
> s->dsp.idct_put(ptr, linesize, *block);
> ptr += 8 >> s->avctx->lowres;
> }
> + handle_rstn(s, 0);
> }
> }
> return 0;
> --
> 1.7.9.5
More information about the ffmpeg-devel
mailing list