diff mbox

[FFmpeg-devel] lavc/sheervideo: Fix Y prediction for interlaced frames with alpha

Message ID 201703012349.13409.cehoyos@ag.or.at
State Accepted
Commit 46082c2b3f2158ca3a69b7cd2b105cc763e9c3e7
Headers show

Commit Message

Carl Eugen Hoyos March 1, 2017, 10:49 p.m. UTC
Hi!

Attached patch fixes ticket #6210 visually.

Please review, Carl Eugen
From 305b1916d99465896abbd1fbf401c6e4fba062a5 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date: Wed, 1 Mar 2017 23:45:10 +0100
Subject: [PATCH] lavc/sheervideo: Fix Y prediction for interlaced frames with
 transparency.

Based on 260de8a2 by Paul B Mahol.
Fixes ticket #6210.
---
 libavcodec/sheervideo.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Paul B Mahol March 2, 2017, 10:09 a.m. UTC | #1
On 3/1/17, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
> Hi!
>
> Attached patch fixes ticket #6210 visually.
>
> Please review, Carl Eugen
>

lgtm
Carl Eugen Hoyos March 2, 2017, 5:21 p.m. UTC | #2
2017-03-02 11:09 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
> On 3/1/17, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
>> Hi!
>>
>> Attached patch fixes ticket #6210 visually.
>>
>> Please review, Carl Eugen
>>
>
> lgtm

Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c
index e8f008b..9d2da7f 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;