Browse code

h264: Fix invalid interlaced progressive MB combinations for direct mode prediction. Fixes Ticket312

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 833a195905405fc9646c7544ce9d0f3279608977)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/11/21 10:03:13
Showing 1 changed files
... ...
@@ -253,6 +253,10 @@ static void pred_spatial_direct_motion(H264Context * const h, int *mb_type){
253 253
             mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy + s->mb_stride];
254 254
             b8_stride = 2+4*s->mb_stride;
255 255
             b4_stride *= 6;
256
+            if(IS_INTERLACED(mb_type_col[0]) != IS_INTERLACED(mb_type_col[1])){
257
+                mb_type_col[0] &= ~MB_TYPE_INTERLACED;
258
+                mb_type_col[1] &= ~MB_TYPE_INTERLACED;
259
+            }
256 260
 
257 261
             sub_mb_type |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
258 262
             if(    (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)