changeset 11191:5e583a785508 libavcodec

Move check for and call of predict_field_decoding_flag() from the mb code to the row code. This function would only be needed on a MB basis for MBAFF+FMO
author michael
date Wed, 17 Feb 2010 02:14:02 +0000
parents afc60af2d008
children e1b4f03037d5
files h264.c h264.h h264_cabac.c h264_cavlc.c
diffstat 4 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Tue Feb 16 23:43:08 2010 +0000
+++ b/h264.c	Wed Feb 17 02:14:02 2010 +0000
@@ -2257,6 +2257,8 @@
                 ++s->mb_y;
                 if(FIELD_OR_MBAFF_PICTURE) {
                     ++s->mb_y;
+                    if(FRAME_MBAFF && s->mb_y < s->mb_height)
+                        predict_field_decoding_flag(h);
                 }
             }
 
@@ -2295,6 +2297,8 @@
                 ++s->mb_y;
                 if(FIELD_OR_MBAFF_PICTURE) {
                     ++s->mb_y;
+                    if(FRAME_MBAFF && s->mb_y < s->mb_height)
+                        predict_field_decoding_flag(h);
                 }
                 if(s->mb_y >= s->mb_height){
                     tprintf(s->avctx, "slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
--- a/h264.h	Tue Feb 16 23:43:08 2010 +0000
+++ b/h264.h	Wed Feb 17 02:14:02 2010 +0000
@@ -1453,7 +1453,7 @@
 
 static void predict_field_decoding_flag(H264Context *h){
     MpegEncContext * const s = &h->s;
-    const int mb_xy= h->mb_xy;
+    const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
     int mb_type = (h->slice_table[mb_xy-1] == h->slice_num)
                 ? s->current_picture.mb_type[mb_xy-1]
                 : (h->slice_table[mb_xy-s->mb_stride] == h->slice_num)
--- a/h264_cabac.c	Tue Feb 16 23:43:08 2010 +0000
+++ b/h264_cabac.c	Wed Feb 17 02:14:02 2010 +0000
@@ -1196,8 +1196,6 @@
     if( h->slice_type_nos != FF_I_TYPE ) {
         int skip;
         /* a skipped mb needs the aff flag from the following mb */
-        if( FRAME_MBAFF && s->mb_x==0 && (s->mb_y&1)==0 )
-            predict_field_decoding_flag(h);
         if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped )
             skip = h->next_mb_skipped;
         else
--- a/h264_cavlc.c	Tue Feb 16 23:43:08 2010 +0000
+++ b/h264_cavlc.c	Wed Feb 17 02:14:02 2010 +0000
@@ -547,8 +547,6 @@
             if(FRAME_MBAFF && (s->mb_y&1) == 0){
                 if(s->mb_skip_run==0)
                     h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&s->gb);
-                else
-                    predict_field_decoding_flag(h);
             }
             decode_mb_skip(h);
             return 0;