summaryrefslogtreecommitdiff
path: root/libavcodec/h264_cabac.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-01-17 22:28:46 +0100
committerAnton Khirnov <anton@khirnov.net>2015-03-21 11:27:14 +0100
commitd4d9068cdf8f4b2b87ae87a2ef880d243f77b977 (patch)
tree2ede3f693c54ca02c41d90549295fe5868f55b54 /libavcodec/h264_cabac.c
parent0edbe6faa7ef80daf0e84353cbe733389bf1a522 (diff)
h264: move mb_{x,y} into the per-slice context
Diffstat (limited to 'libavcodec/h264_cabac.c')
-rw-r--r--libavcodec/h264_cabac.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index fb75ff0df5..88f50d6be3 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1288,7 +1288,7 @@ static int decode_cabac_field_decoding_flag(H264Context *h, H264SliceContext *sl
unsigned long ctx = 0;
- ctx += h->mb_field_decoding_flag & !!h->mb_x; //for FMO:(s->current_picture.mb_type[mba_xy] >> 7) & (h->slice_table[mba_xy] == h->slice_num);
+ ctx += h->mb_field_decoding_flag & !!sl->mb_x; //for FMO:(s->current_picture.mb_type[mba_xy] >> 7) & (h->slice_table[mba_xy] == h->slice_num);
ctx += (h->cur_pic.mb_type[mbb_xy] >> 7) & (h->slice_table[mbb_xy] == sl->slice_num);
return get_cabac_noinline( &sl->cabac, &(sl->cabac_state+70)[ctx] );
@@ -1914,21 +1914,21 @@ int ff_h264_decode_mb_cabac(H264Context *h, H264SliceContext *sl)
int decode_chroma = h->sps.chroma_format_idc == 1 || h->sps.chroma_format_idc == 2;
const int pixel_shift = h->pixel_shift;
- mb_xy = sl->mb_xy = h->mb_x + h->mb_y*h->mb_stride;
+ mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride;
- tprintf(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, h->mb_x, h->mb_y);
+ tprintf(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, sl->mb_x, sl->mb_y);
if (sl->slice_type_nos != AV_PICTURE_TYPE_I) {
int skip;
/* a skipped mb needs the aff flag from the following mb */
- if (FRAME_MBAFF(h) && (h->mb_y & 1) == 1 && sl->prev_mb_skipped)
+ if (FRAME_MBAFF(h) && (sl->mb_y & 1) == 1 && sl->prev_mb_skipped)
skip = sl->next_mb_skipped;
else
- skip = decode_cabac_mb_skip(h, sl, h->mb_x, h->mb_y );
+ skip = decode_cabac_mb_skip(h, sl, sl->mb_x, sl->mb_y );
/* read skip flags */
if( skip ) {
- if (FRAME_MBAFF(h) && (h->mb_y & 1) == 0) {
+ if (FRAME_MBAFF(h) && (sl->mb_y & 1) == 0) {
h->cur_pic.mb_type[mb_xy] = MB_TYPE_SKIP;
- sl->next_mb_skipped = decode_cabac_mb_skip(h, sl, h->mb_x, h->mb_y+1 );
+ sl->next_mb_skipped = decode_cabac_mb_skip(h, sl, sl->mb_x, sl->mb_y+1 );
if(!sl->next_mb_skipped)
h->mb_mbaff = h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h, sl);
}
@@ -1944,7 +1944,7 @@ int ff_h264_decode_mb_cabac(H264Context *h, H264SliceContext *sl)
}
}
if (FRAME_MBAFF(h)) {
- if( (h->mb_y&1) == 0 )
+ if ((sl->mb_y & 1) == 0)
h->mb_mbaff =
h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h, sl);
}
@@ -2367,7 +2367,7 @@ decode_intra_mb:
ctx= 3;
val++;
if(val > 2*max_qp){ //prevent infinite loop
- av_log(h->avctx, AV_LOG_ERROR, "cabac decode of qscale diff failed at %d %d\n", h->mb_x, h->mb_y);
+ av_log(h->avctx, AV_LOG_ERROR, "cabac decode of qscale diff failed at %d %d\n", sl->mb_x, sl->mb_y);
return -1;
}
}