comparison h264_cabac.c @ 11168:a820571a6712 libavcodec

Set sub_mb_type in direct_cache instead of just the direct flag. Simpler, cleaner and faster.
author michael
date Sun, 14 Feb 2010 16:51:31 +0000
parents c163ffa8c59e
children d092ec99cb59
comparison
equal deleted inserted replaced
11167:c163ffa8c59e 11168:a820571a6712
1445 ff_h264_pred_direct_motion(h, &mb_type); 1445 ff_h264_pred_direct_motion(h, &mb_type);
1446 h->ref_cache[0][scan8[4]] = 1446 h->ref_cache[0][scan8[4]] =
1447 h->ref_cache[1][scan8[4]] = 1447 h->ref_cache[1][scan8[4]] =
1448 h->ref_cache[0][scan8[12]] = 1448 h->ref_cache[0][scan8[12]] =
1449 h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE; 1449 h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
1450 if( h->ref_count[0] > 1 || h->ref_count[1] > 1 ) {
1451 for( i = 0; i < 4; i++ ) 1450 for( i = 0; i < 4; i++ )
1452 if( IS_DIRECT(h->sub_mb_type[i]) ) 1451 fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, (h->sub_mb_type[i]>>1)&0xFF, 1 );
1453 fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, MB_TYPE_DIRECT2>>1, 1 );
1454 }
1455 } 1452 }
1456 } else { 1453 } else {
1457 for( i = 0; i < 4; i++ ) { 1454 for( i = 0; i < 4; i++ ) {
1458 h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h ); 1455 h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h );
1459 sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; 1456 sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;