aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-21 02:03:13 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-21 16:48:40 +0100
commitb8fc3017690f89748948b861e09971a5e1a7bd07 (patch)
tree8eb472b9af7f554c56b8415d45bfd75689f7b13e
parent9b667da05d43063f602715feca037a999dee8000 (diff)
downloadffmpeg-b8fc3017690f89748948b861e09971a5e1a7bd07.tar.gz
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>
-rw-r--r--libavcodec/h264_direct.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index 0b19353656..4ebb60e41c 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -253,6 +253,10 @@ static void pred_spatial_direct_motion(H264Context * const h, int *mb_type){
mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy + s->mb_stride];
b8_stride = 2+4*s->mb_stride;
b4_stride *= 6;
+ if(IS_INTERLACED(mb_type_col[0]) != IS_INTERLACED(mb_type_col[1])){
+ mb_type_col[0] &= ~MB_TYPE_INTERLACED;
+ mb_type_col[1] &= ~MB_TYPE_INTERLACED;
+ }
sub_mb_type |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
if( (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)