comparison h264_cabac.c @ 11172:458393d0db0a libavcodec

Merge the single line function decode_cabac_mb_transform_size() into the calling code. 8 cpu cycles faster
author michael
date Mon, 15 Feb 2010 01:04:07 +0000
parents 57a27888f388
children 63f55748173c
comparison
equal deleted inserted replaced
11171:57a27888f388 11172:458393d0db0a
921 type += 4; 921 type += 4;
922 } 922 }
923 type += 2*get_cabac( &h->cabac, &h->cabac_state[39] ); 923 type += 2*get_cabac( &h->cabac, &h->cabac_state[39] );
924 type += get_cabac( &h->cabac, &h->cabac_state[39] ); 924 type += get_cabac( &h->cabac, &h->cabac_state[39] );
925 return type; 925 return type;
926 }
927
928 static inline int decode_cabac_mb_transform_size( H264Context *h ) {
929 return get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] );
930 } 926 }
931 927
932 static int decode_cabac_mb_ref( H264Context *h, int list, int n ) { 928 static int decode_cabac_mb_ref( H264Context *h, int list, int n ) {
933 int refa = h->ref_cache[list][scan8[n] - 1]; 929 int refa = h->ref_cache[list][scan8[n] - 1];
934 int refb = h->ref_cache[list][scan8[n] - 8]; 930 int refb = h->ref_cache[list][scan8[n] - 8];
1385 fill_decode_caches(h, mb_type); 1381 fill_decode_caches(h, mb_type);
1386 1382
1387 if( IS_INTRA( mb_type ) ) { 1383 if( IS_INTRA( mb_type ) ) {
1388 int i, pred_mode; 1384 int i, pred_mode;
1389 if( IS_INTRA4x4( mb_type ) ) { 1385 if( IS_INTRA4x4( mb_type ) ) {
1390 if( dct8x8_allowed && decode_cabac_mb_transform_size( h ) ) { 1386 if( dct8x8_allowed && get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] ) ) {
1391 mb_type |= MB_TYPE_8x8DCT; 1387 mb_type |= MB_TYPE_8x8DCT;
1392 for( i = 0; i < 16; i+=4 ) { 1388 for( i = 0; i < 16; i+=4 ) {
1393 int pred = pred_intra_mode( h, i ); 1389 int pred = pred_intra_mode( h, i );
1394 int mode = decode_cabac_mb_intra4x4_pred_mode( h, pred ); 1390 int mode = decode_cabac_mb_intra4x4_pred_mode( h, pred );
1395 fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 ); 1391 fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
1647 } 1643 }
1648 1644
1649 h->cbp_table[mb_xy] = h->cbp = cbp; 1645 h->cbp_table[mb_xy] = h->cbp = cbp;
1650 1646
1651 if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) { 1647 if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) {
1652 if( decode_cabac_mb_transform_size( h ) ) 1648 mb_type |= MB_TYPE_8x8DCT * get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] );
1653 mb_type |= MB_TYPE_8x8DCT;
1654 } 1649 }
1655 s->current_picture.mb_type[mb_xy]= mb_type; 1650 s->current_picture.mb_type[mb_xy]= mb_type;
1656 1651
1657 if( cbp || IS_INTRA16x16( mb_type ) ) { 1652 if( cbp || IS_INTRA16x16( mb_type ) ) {
1658 const uint8_t *scan, *scan8x8, *dc_scan; 1653 const uint8_t *scan, *scan8x8, *dc_scan;