Commit be46eb71 authored by Paul B Mahol's avatar Paul B Mahol

avcodec/pixlet: clip chroma before shifting

Fixes artifacts.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 1daa08bd
......@@ -482,8 +482,8 @@ static void postprocess_chroma(AVFrame *frame, int w, int h, int depth)
for (j = 0; j < h; j++) {
for (i = 0; i < w; i++) {
dstu[i] = (add + srcu[i]) << shift;
dstv[i] = (add + srcv[i]) << shift;
dstu[i] = av_clip(add + srcu[i], 0, 32767) << shift;
dstv[i] = av_clip(add + srcv[i], 0, 32767) << shift;
}
dstu += strideu;
dstv += stridev;
......
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