comparison h264_cabac.c @ 11167:c163ffa8c59e libavcodec

Store sub_mb_type in direct_cache/direct_table. This is equal complexity but could be more usefull.
author michael
date Sun, 14 Feb 2010 14:41:27 +0000
parents 5bd834bd759b
children a820571a6712
comparison
equal deleted inserted replaced
11166:5bd834bd759b 11167:c163ffa8c59e
949 int refb = h->ref_cache[list][scan8[n] - 8]; 949 int refb = h->ref_cache[list][scan8[n] - 8];
950 int ref = 0; 950 int ref = 0;
951 int ctx = 0; 951 int ctx = 0;
952 952
953 if( h->slice_type_nos == FF_B_TYPE) { 953 if( h->slice_type_nos == FF_B_TYPE) {
954 if( refa > 0 && !h->direct_cache[scan8[n] - 1] ) 954 if( refa > 0 && !(h->direct_cache[scan8[n] - 1]&(MB_TYPE_DIRECT2>>1)) )
955 ctx++; 955 ctx++;
956 if( refb > 0 && !h->direct_cache[scan8[n] - 8] ) 956 if( refb > 0 && !(h->direct_cache[scan8[n] - 8]&(MB_TYPE_DIRECT2>>1)) )
957 ctx += 2; 957 ctx += 2;
958 } else { 958 } else {
959 if( refa > 0 ) 959 if( refa > 0 )
960 ctx++; 960 ctx++;
961 if( refb > 0 ) 961 if( refb > 0 )
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 ) { 1450 if( h->ref_count[0] > 1 || h->ref_count[1] > 1 ) {
1451 for( i = 0; i < 4; i++ ) 1451 for( i = 0; i < 4; i++ )
1452 if( IS_DIRECT(h->sub_mb_type[i]) ) 1452 if( IS_DIRECT(h->sub_mb_type[i]) )
1453 fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, 1, 1 ); 1453 fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, MB_TYPE_DIRECT2>>1, 1 );
1454 } 1454 }
1455 } 1455 }
1456 } else { 1456 } else {
1457 for( i = 0; i < 4; i++ ) { 1457 for( i = 0; i < 4; i++ ) {
1458 h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h ); 1458 h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h );