changeset 3449:ec6096b1ab04 libavcodec

Use s->first_slice_line in checks instead of s->mb_y
author kostya
date Sun, 09 Jul 2006 02:44:05 +0000
parents f94d61396915
children 906c58dcb6ea
files vc1.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/vc1.c	Sun Jul 09 01:08:13 2006 +0000
+++ b/vc1.c	Sun Jul 09 02:44:05 2006 +0000
@@ -1698,13 +1698,13 @@
     if (pq < 9 || !overlap)
     {
         /* Set outer values */
-        if (!s->mb_y && (n!=2 && n!=3)) b=a=dcpred[scale];
+        if (s->first_slice_line && (n!=2 && n!=3)) b=a=dcpred[scale];
         if (s->mb_x == 0 && (n!=1 && n!=3)) b=c=dcpred[scale];
     }
     else
     {
         /* Set outer values */
-        if (!s->mb_y && (n!=2 && n!=3)) b=a=0;
+        if (s->first_slice_line && (n!=2 && n!=3)) b=a=0;
         if (s->mb_x == 0 && (n!=1 && n!=3)) b=c=0;
     }
 
@@ -2438,7 +2438,7 @@
                 if(s->mb_intra) {
                     /* check if prediction blocks A and C are available */
                     v->a_avail = v->c_avail = 0;
-                    if(i == 2 || i == 3 || s->mb_y)
+                    if(i == 2 || i == 3 || !s->first_slice_line)
                         v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
                     if(i == 1 || i == 3 || s->mb_x)
                         v->c_avail = v->mb_type[0][s->block_index[i] - 1];
@@ -2515,8 +2515,8 @@
                 int intrapred = 0;
                 for(i=0; i<6; i++)
                     if(is_intra[i]) {
-                        if(((s->mb_y || (i==2 || i==3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
-                             || ((s->mb_x || (i==1 || i==3)) && v->mb_type[0][s->block_index[i] - 1])) {
+                        if(((!s->first_slice_line || (i==2 || i==3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
+                            || ((s->mb_x || (i==1 || i==3)) && v->mb_type[0][s->block_index[i] - 1])) {
                             intrapred = 1;
                             break;
                         }
@@ -2534,7 +2534,7 @@
                 if (is_intra[i]) {
                     /* check if prediction blocks A and C are available */
                     v->a_avail = v->c_avail = 0;
-                    if(i == 2 || i == 3 || s->mb_y)
+                    if(i == 2 || i == 3 || !s->first_slice_line)
                         v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
                     if(i == 1 || i == 3 || s->mb_x)
                         v->c_avail = v->mb_type[0][s->block_index[i] - 1];
@@ -2620,6 +2620,7 @@
     //do frame decode
     s->mb_x = s->mb_y = 0;
     s->mb_intra = 1;
+    s->first_slice_line = 1;
     ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
     for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
         for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) {
@@ -2678,6 +2679,7 @@
             }
         }
         ff_draw_horiz_band(s, s->mb_y * 16, 16);
+        s->first_slice_line = 0;
     }
 }