aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/indeo2.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2016-02-22 19:58:19 -0500
committerMichael Niedermayer <michael@niedermayer.cc>2016-03-16 11:32:51 +0100
commit73f3c8f73edf0a69502233b2c50fa9e7104f99ec (patch)
tree677003db7de49208db5fc12d16f2ec142ae04dec /libavcodec/indeo2.c
parent522ab0b9a92962edda7156a91a494a1e2b8a7f64 (diff)
downloadffmpeg-73f3c8f73edf0a69502233b2c50fa9e7104f99ec.tar.gz
indeo2: Fix banding artefacts
Rename luma table to delta table and change how it is used. CC: libav-stable@libav.org Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Diego Biurrun <diego@biurrun.de> (cherry picked from commit f8c34f4b8d62afad3f63cf3d9617d73735bef8c1)
Diffstat (limited to 'libavcodec/indeo2.c')
-rw-r--r--libavcodec/indeo2.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 3424e00b38..17f236761d 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -146,6 +146,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
AVFrame *picture = data;
AVFrame * const p = s->picture;
int start, ret;
+ int ltab, ctab;
if ((ret = ff_reget_buffer(avctx, p)) < 0)
return ret;
@@ -168,34 +169,36 @@ static int ir2_decode_frame(AVCodecContext *avctx,
if ((ret = init_get_bits8(&s->gb, buf + start, buf_size - start)) < 0)
return ret;
+ ltab = buf[0x22] & 3;
+ ctab = buf[0x22] >> 2;
if (s->decode_delta) { /* intraframe */
if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
p->data[0], p->linesize[0],
- ir2_luma_table)) < 0)
+ ir2_delta_table[ltab])) < 0)
return ret;
/* swapped U and V */
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
p->data[2], p->linesize[2],
- ir2_luma_table)) < 0)
+ ir2_delta_table[ctab])) < 0)
return ret;
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
p->data[1], p->linesize[1],
- ir2_luma_table)) < 0)
+ ir2_delta_table[ctab])) < 0)
return ret;
} else { /* interframe */
if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height,
p->data[0], p->linesize[0],
- ir2_luma_table)) < 0)
+ ir2_delta_table[ltab])) < 0)
return ret;
/* swapped U and V */
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
p->data[2], p->linesize[2],
- ir2_luma_table)) < 0)
+ ir2_delta_table[ctab])) < 0)
return ret;
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
p->data[1], p->linesize[1],
- ir2_luma_table)) < 0)
+ ir2_delta_table[ctab])) < 0)
return ret;
}