mirror of
https://github.com/librempeg/librempeg
synced 2024-11-21 16:44:05 +00:00
libavcodec/mjpeg: preserve unclipped last_dc value
Perform av_clip_int16(val) _after_ copying the value to last_dc. This change ensures that clipping is applied only within the context of the current block, preventing the propagation of clipped values to subsequent DC components. Related commits:c28f648b19
anddffae122d0
Related ticket: 4683 Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
c8e6ab8654
commit
ed091b37c5
@ -843,9 +843,8 @@ static int decode_block(MJpegDecodeContext *s, int16_t *block, int component,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
val = val * (unsigned)quant_matrix[0] + s->last_dc[component];
|
||||
val = av_clip_int16(val);
|
||||
s->last_dc[component] = val;
|
||||
block[0] = val;
|
||||
block[0] = av_clip_int16(val);
|
||||
/* AC coefs */
|
||||
i = 0;
|
||||
{OPEN_READER(re, &s->gb);
|
||||
|
@ -3,4 +3,4 @@
|
||||
#codec_id 0: rawvideo
|
||||
#dimensions 0: 999x749
|
||||
#sar 0: 1/1
|
||||
0, 0, 0, 1, 1496502, 0xd91deb4b
|
||||
0, 0, 0, 1, 1496502, 0x44efc0af
|
||||
|
Loading…
Reference in New Issue
Block a user