Commit 70d8bd1e authored by michael's avatar michael

Drop a few redundant slice_num checks.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21844 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5005ecea
...@@ -722,13 +722,10 @@ static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_sl ...@@ -722,13 +722,10 @@ static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_sl
int mb_type; int mb_type;
if(intra_slice){ if(intra_slice){
MpegEncContext * const s = &h->s;
const int mba_xy = h->left_mb_xy[0];
const int mbb_xy = h->top_mb_xy;
int ctx=0; int ctx=0;
if( h->slice_table[mba_xy] == h->slice_num && !IS_INTRA4x4( s->current_picture.mb_type[mba_xy] ) ) if( h->left_type[0] && !IS_INTRA4x4(h->left_type[0]))
ctx++; ctx++;
if( h->slice_table[mbb_xy] == h->slice_num && !IS_INTRA4x4( s->current_picture.mb_type[mbb_xy] ) ) if( h->top_type && !IS_INTRA4x4(h->top_type) )
ctx++; ctx++;
if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 ) if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 )
return 0; /* I4x4 */ return 0; /* I4x4 */
...@@ -806,10 +803,10 @@ static int decode_cabac_mb_chroma_pre_mode( H264Context *h) { ...@@ -806,10 +803,10 @@ static int decode_cabac_mb_chroma_pre_mode( H264Context *h) {
int ctx = 0; int ctx = 0;
/* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */ /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */
if( h->slice_table[mba_xy] == h->slice_num && h->chroma_pred_mode_table[mba_xy] != 0 ) if( h->left_type[0] && h->chroma_pred_mode_table[mba_xy] != 0 )
ctx++; ctx++;
if( h->slice_table[mbb_xy] == h->slice_num && h->chroma_pred_mode_table[mbb_xy] != 0 ) if( h->top_type && h->chroma_pred_mode_table[mbb_xy] != 0 )
ctx++; ctx++;
if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 ) if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 )
...@@ -1234,14 +1231,12 @@ int ff_h264_decode_mb_cabac(H264Context *h) { ...@@ -1234,14 +1231,12 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
fill_decode_neighbors(h, -(MB_FIELD)); fill_decode_neighbors(h, -(MB_FIELD));
if( h->slice_type_nos == FF_B_TYPE ) { if( h->slice_type_nos == FF_B_TYPE ) {
const int mba_xy = h->left_mb_xy[0];
const int mbb_xy = h->top_mb_xy;
int ctx = 0; int ctx = 0;
assert(h->slice_type_nos == FF_B_TYPE); assert(h->slice_type_nos == FF_B_TYPE);
if( h->slice_table[mba_xy] == h->slice_num && !IS_DIRECT( s->current_picture.mb_type[mba_xy] ) ) if( !IS_DIRECT( h->left_type[0]-1 ) )
ctx++; ctx++;
if( h->slice_table[mbb_xy] == h->slice_num && !IS_DIRECT( s->current_picture.mb_type[mbb_xy] ) ) if( !IS_DIRECT( h->top_type-1 ) )
ctx++; ctx++;
if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+ctx] ) ){ if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+ctx] ) ){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment