aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2017-03-01 23:45:10 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2017-03-02 18:11:57 +0100
commit46082c2b3f2158ca3a69b7cd2b105cc763e9c3e7 (patch)
tree8c522f58ee52b4e2417bed3b89fa0d6d98a42f66
parentd1bfd19ad196b33d6fde07dbb9060946368ec2c1 (diff)
downloadffmpeg-46082c2b3f2158ca3a69b7cd2b105cc763e9c3e7.tar.gz
lavc/sheervideo: Fix Y prediction for interlaced frames with transparency.
Based on 260de8a2 by Paul B Mahol. Fixes ticket #6210.
-rw-r--r--libavcodec/sheervideo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c
index e8f008b7e4..9d2da7ffb4 100644
--- a/libavcodec/sheervideo.c
+++ b/libavcodec/sheervideo.c
@@ -2185,7 +2185,7 @@ static void decode_aybri(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
dst_v[x] = get_bits(gb, 8);
}
} else {
- int pred[4] = { 125, 125, -128, -128 };
+ int pred[4] = { 125, s->alt ? 125 : -146, -128, -128 };
for (x = 0; x < avctx->width; x++) {
int a, y, u, v;
@@ -2263,7 +2263,7 @@ static void decode_aybr(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
dst_v[x] = get_bits(gb, 8);
}
} else {
- int pred[4] = { 125, 125, -128, -128 };
+ int pred[4] = { 125, s->alt ? 125 : -146, -128, -128 };
for (x = 0; x < avctx->width; x++) {
int a, y, u, v;
@@ -2959,6 +2959,7 @@ static int decode_frame(AVCodecContext *avctx,
}
break;
case MKTAG('A', 'Y', 'B', 'R'):
+ s->alt = 1;
case MKTAG('A', 'Y', 'b', 'R'):
avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
s->decode_frame = decode_aybr;
@@ -2968,6 +2969,7 @@ static int decode_frame(AVCodecContext *avctx,
}
break;
case MKTAG('A', 'y', 'B', 'R'):
+ s->alt = 1;
case MKTAG('A', 'y', 'b', 'R'):
avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
s->decode_frame = decode_aybri;