@ -805,6 +805,8 @@ static int decode_mb_b(AVSContext *h, enum cavs_mb mb_type)
ff_cavs_mv ( h , MV_BWD_X0 , MV_BWD_C2 , MV_PRED_MEDIAN , BLK_16X16 , 0 ) ;
break ;
case B_8X8 :
# define TMP_UNUSED_INX 7
flags = 0 ;
for ( block = 0 ; block < 4 ; block + + )
sub_type [ block ] = get_bits ( & h - > gb , 2 ) ;
for ( block = 0 ; block < 4 ; block + + ) {
@ -812,11 +814,30 @@ static int decode_mb_b(AVSContext *h, enum cavs_mb mb_type)
case B_SUB_DIRECT :
if ( ! h - > col_type_base [ h - > mbidx ] ) {
/* intra MB at co-location, do in-plane prediction */
ff_cavs_mv ( h , mv_scan [ block ] , mv_scan [ block ] - 3 ,
MV_PRED_BSKIP , BLK_8X8 , 1 ) ;
ff_cavs_mv ( h , mv_scan [ block ] + MV_BWD_OFFS ,
mv_scan [ block ] - 3 + MV_BWD_OFFS ,
MV_PRED_BSKIP , BLK_8X8 , 0 ) ;
if ( flags = = 0 ) {
// if col-MB is a Intra MB, current Block size is 16x16.
// AVS standard section 9.9.1
if ( block > 0 ) {
h - > mv [ TMP_UNUSED_INX ] = h - > mv [ MV_FWD_X0 ] ;
h - > mv [ TMP_UNUSED_INX + MV_BWD_OFFS ] = h - > mv [ MV_FWD_X0 + MV_BWD_OFFS ] ;
}
ff_cavs_mv ( h , MV_FWD_X0 , MV_FWD_C2 ,
MV_PRED_BSKIP , BLK_8X8 , 1 ) ;
ff_cavs_mv ( h , MV_FWD_X0 + MV_BWD_OFFS ,
MV_FWD_C2 + MV_BWD_OFFS ,
MV_PRED_BSKIP , BLK_8X8 , 0 ) ;
if ( block > 0 ) {
flags = mv_scan [ block ] ;
h - > mv [ flags ] = h - > mv [ MV_FWD_X0 ] ;
h - > mv [ flags + MV_BWD_OFFS ] = h - > mv [ MV_FWD_X0 + MV_BWD_OFFS ] ;
h - > mv [ MV_FWD_X0 ] = h - > mv [ TMP_UNUSED_INX ] ;
h - > mv [ MV_FWD_X0 + MV_BWD_OFFS ] = h - > mv [ TMP_UNUSED_INX + MV_BWD_OFFS ] ;
} else
flags = MV_FWD_X0 ;
} else {
h - > mv [ mv_scan [ block ] ] = h - > mv [ flags ] ;
h - > mv [ mv_scan [ block ] + MV_BWD_OFFS ] = h - > mv [ flags + MV_BWD_OFFS ] ;
}
} else
mv_pred_direct ( h , & h - > mv [ mv_scan [ block ] ] ,
& h - > col_mv [ h - > mbidx * 4 + block ] ) ;
@ -832,6 +853,7 @@ static int decode_mb_b(AVSContext *h, enum cavs_mb mb_type)
break ;
}
}
# undef TMP_UNUSED_INX
for ( block = 0 ; block < 4 ; block + + ) {
if ( sub_type [ block ] = = B_SUB_BWD )
ff_cavs_mv ( h , mv_scan [ block ] + MV_BWD_OFFS ,