[FFmpeg-cvslog] r14543 - trunk/libavcodec/h264.c

michael subversion
Tue Aug 5 01:06:45 CEST 2008


Author: michael
Date: Tue Aug  5 01:06:45 2008
New Revision: 14543

Log:
port col_parity code from spatial mode to temporal mode,
i also love it if people duplicate code and fix one but not the other.


Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Tue Aug  5 01:06:45 2008
@@ -1185,12 +1185,12 @@ static inline void pred_direct_motion(H2
                     else
                         *mb_type |= MB_TYPE_8x8;
                 }else{
-                    /* field to frame scaling */
-                    /* col_mb_y = (mb_y&~1) + (topAbsDiffPOC < bottomAbsDiffPOC ? 0 : 1)
-                     * but in MBAFF, top and bottom POC are equal */
-                    int dy = (s->mb_y&1) ? 1 : 2;
+                    int cur_poc = s->current_picture_ptr->poc;
+                    int *col_poc = h->ref_list[1]->field_poc;
+                    int col_parity = FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc);
+                    int dy = 2*col_parity - (s->mb_y&1);
                     mb_types_col[0] =
-                    mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
+                    mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy + col_parity*s->mb_stride];
                     l1ref0 += dy*h->b8_stride;
                     l1ref1 += dy*h->b8_stride;
                     l1mv0 += 2*dy*h->b_stride;




More information about the ffmpeg-cvslog mailing list