Commit 8aea97a4 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeglsdec: Implement the 4th (lossy) transform

Fixes remainder of Ticket893

Std deviation from the intended image is 0.11, max sample error +-1
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 937cfebd
......@@ -391,6 +391,16 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
src[x+1] = g;
}
break;
case 4:
for (x = off; x < w; x += 3) {
int r = src[x+0] - (( 359 * (src[x+2]-128) + 490) >> 8);
int g = src[x+0] - (( 88 * (src[x+1]-128) - 183 * (src[x+2]-128) + 30) >> 8);
int b = src[x+0] + ((454 * (src[x+1]-128) + 574) >> 8);
src[x+0] = av_clip_uint8(r);
src[x+1] = av_clip_uint8(g);
src[x+2] = av_clip_uint8(b);
}
break;
}
src += s->picture.linesize[0];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment