From 56febc993b928ccc039a32158ca60b234c311875 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 17 Jan 2015 22:28:46 +0100 Subject: h264: move the slice type variables into the per-slice context --- libavcodec/h264_cavlc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libavcodec/h264_cavlc.c') diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index 37647b9e83..3ccd756544 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -708,7 +708,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h, H264SliceContext *sl) tprintf(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, h->mb_x, h->mb_y); cbp = 0; /* avoid warning. FIXME: find a solution without slowing down the code */ - if(h->slice_type_nos != AV_PICTURE_TYPE_I){ + if (sl->slice_type_nos != AV_PICTURE_TYPE_I) { if(h->mb_skip_run==-1) h->mb_skip_run= get_ue_golomb(&h->gb); @@ -729,7 +729,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h, H264SliceContext *sl) sl->prev_mb_skipped = 0; mb_type= get_ue_golomb(&h->gb); - if(h->slice_type_nos == AV_PICTURE_TYPE_B){ + if (sl->slice_type_nos == AV_PICTURE_TYPE_B) { if(mb_type < 23){ partition_count= b_mb_type_info[mb_type].partition_count; mb_type= b_mb_type_info[mb_type].type; @@ -737,7 +737,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h, H264SliceContext *sl) mb_type -= 23; goto decode_intra_mb; } - }else if(h->slice_type_nos == AV_PICTURE_TYPE_P){ + } else if (sl->slice_type_nos == AV_PICTURE_TYPE_P) { if(mb_type < 5){ partition_count= p_mb_type_info[mb_type].partition_count; mb_type= p_mb_type_info[mb_type].type; @@ -746,12 +746,12 @@ int ff_h264_decode_mb_cavlc(H264Context *h, H264SliceContext *sl) goto decode_intra_mb; } }else{ - assert(h->slice_type_nos == AV_PICTURE_TYPE_I); - if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type) + assert(sl->slice_type_nos == AV_PICTURE_TYPE_I); + if (sl->slice_type == AV_PICTURE_TYPE_SI && mb_type) mb_type--; decode_intra_mb: if(mb_type > 25){ - av_log(h->avctx, AV_LOG_ERROR, "mb_type %d in %c slice too large at %d %d\n", mb_type, av_get_picture_type_char(h->slice_type), h->mb_x, h->mb_y); + av_log(h->avctx, AV_LOG_ERROR, "mb_type %d in %c slice too large at %d %d\n", mb_type, av_get_picture_type_char(sl->slice_type), h->mb_x, h->mb_y); return -1; } partition_count=0; @@ -763,7 +763,7 @@ decode_intra_mb: if(MB_FIELD(h)) mb_type |= MB_TYPE_INTERLACED; - h->slice_table[ mb_xy ]= h->slice_num; + h->slice_table[mb_xy] = sl->slice_num; if(IS_INTRA_PCM(mb_type)){ const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] * @@ -834,7 +834,7 @@ decode_intra_mb: }else if(partition_count==4){ int i, j, sub_partition_count[4], list, ref[2][4]; - if(h->slice_type_nos == AV_PICTURE_TYPE_B){ + if (sl->slice_type_nos == AV_PICTURE_TYPE_B) { for(i=0; i<4; i++){ h->sub_mb_type[i]= get_ue_golomb_31(&h->gb); if(h->sub_mb_type[i] >=13){ @@ -852,7 +852,7 @@ decode_intra_mb: sl->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE; } }else{ - assert(h->slice_type_nos == AV_PICTURE_TYPE_P); //FIXME SP correct ? + assert(sl->slice_type_nos == AV_PICTURE_TYPE_P); //FIXME SP correct ? for(i=0; i<4; i++){ h->sub_mb_type[i]= get_ue_golomb_31(&h->gb); if(h->sub_mb_type[i] >=4){ -- cgit v1.2.3