On Sat, Nov 26, 2011 at 01:11:49PM +0100, Kostya Shishkov wrote:
> On Sat, Nov 26, 2011 at 01:02:43PM +0100, Luca Barbato wrote:
> > On 26/11/11 12:25, Kostya Shishkov wrote:
> > >On Sat, Nov 26, 2011 at 11:04:10AM +0100, Luca Barbato wrote:
> > >>On 26/11/11 06:31, Mashiat Sarker Shakkhar wrote:
> > >>>From: Michael Niedermayer<[email protected]>
> > >>>
> > >>>Fixes: vc1 file from Ticket606
> > >>>Fixes: vc1+vc1+++artifacts*.vc1
> > >>>Fixes: mpeg+vc1+++salxxos.evo
> > >>
> > >>fcm; ///<  0->Progressive, 2->Frame-Interlace, 3->Field-Interlace
> > >>
> > >>So Use the same scantable for Progressive and Field-Interlace ?
> > >
> > >For us FCM is 0, 1 and 2. And scantables for interlaced mode should be used
> > >(it seems from the standard unless I got it wrong) for both FCM = 1 or 2.
> > 
> > libavcodec/dxva2_vc1.c seems to use it
> > 
> > pp->bSecondField            = v->interlace && v->fcm != 0x03 &&
> > !s->first_field;
> 
> it's incorrect then
> in vc1.c
> v->fcm = decode012(gb);
> it's a bit silly to address it by binary code anyway
> 
> > >Though the old approach was wrong too - there are enough files with 
> > >interlaced
> > >mode = 1 and FCM=0 (HD-DVD featured that, for example).
> > 
> > uhm so the patch isn't right completely...
> 
> yes

So here's my variant. I'll wait till Mashiat tests it though.
>From 0ba3413ee7ed5f66a2903575d7bdc6d36a8ebe55 Mon Sep 17 00:00:00 2001
From: Kostya Shishkov <[email protected]>
Date: Sat, 26 Nov 2011 13:23:39 +0100
Subject: [PATCH] vc1: select interlaced scan table by FCM element

Interlaced videos can contain progressive frames too and now wrong scantable
is selected for them.
---
 libavcodec/vc1dec.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 7a65f31..c479c08 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -3293,7 +3293,7 @@ static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n,
             i += skip;
             if (i > 63)
                 break;
-            if (!v->interlace)
+            if (!v->fcm)
                 idx = v->zz_8x8[0][i++];
             else
                 idx = v->zzi_8x8[i++];
@@ -3321,7 +3321,7 @@ static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n,
                 i += skip;
                 if (i > 15)
                     break;
-                if (!v->interlace)
+                if (!v->fcm)
                     idx = ff_vc1_simple_progressive_4x4_zz[i++];
                 else
                     idx = ff_vc1_adv_interlaced_4x4_zz[i++];
@@ -3348,7 +3348,7 @@ static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n,
                 i += skip;
                 if (i > 31)
                     break;
-                if (!v->interlace)
+                if (!v->fcm)
                     idx = v->zz_8x4[i++] + off;
                 else
                     idx = ff_vc1_adv_interlaced_8x4_zz[i++] + off;
@@ -3375,7 +3375,7 @@ static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n,
                 i += skip;
                 if (i > 31)
                     break;
-                if (!v->interlace)
+                if (!v->fcm)
                     idx = v->zz_4x8[i++] + off;
                 else
                     idx = ff_vc1_adv_interlaced_4x8_zz[i++] + off;
-- 
1.7.0.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to