Ticket #113: ffmpeg-mbcabac-loops.patch
| File ffmpeg-mbcabac-loops.patch, 1.5 kB (added by astrange, 2 years ago) |
|---|
-
h264.c
old new 5655 5655 const int mba_xy = h->left_mb_xy[0]; 5656 5656 const int mbb_xy = h->top_mb_xy; 5657 5657 int ctx = 0; 5658 int bits ;5658 int bits, i = 2; 5659 5659 5660 5660 if( h->slice_table[mba_xy] == h->slice_num && !IS_DIRECT( s->current_picture.mb_type[mba_xy] ) ) 5661 5661 ctx++; … … 5670 5670 } 5671 5671 5672 5672 bits = get_cabac_noinline( &h->cabac, &h->cabac_state[27+4] ) << 3; 5673 bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 2; 5674 bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 1; 5675 bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ); 5673 for (; i >= 0; i--) bits |= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << i; 5674 5676 5675 if( bits < 8 ) 5677 5676 return bits + 3; /* B_Bi_16x16 through B_L1_L0_16x8 */ 5678 5677 else if( bits == 13 ) { … … 5727 5726 } 5728 5727 5729 5728 static int decode_cabac_mb_intra4x4_pred_mode( H264Context *h, int pred_mode ) { 5730 int mode = 0 ;5729 int mode = 0, i = 0; 5731 5730 5732 5731 if( get_cabac( &h->cabac, &h->cabac_state[68] ) ) 5733 5732 return pred_mode; 5734 5733 5735 mode += 1 * get_cabac( &h->cabac, &h->cabac_state[69] ); 5736 mode += 2 * get_cabac( &h->cabac, &h->cabac_state[69] ); 5737 mode += 4 * get_cabac( &h->cabac, &h->cabac_state[69] ); 5734 for (; i <= 2; i++) mode |= get_cabac( &h->cabac, &h->cabac_state[69] ) << i; 5738 5735 5739 5736 if( mode >= pred_mode ) 5740 5737 return mode + 1;
