diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-01-17 22:28:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-03-21 11:27:13 +0100 |
commit | 56febc993b928ccc039a32158ca60b234c311875 (patch) | |
tree | cf903dfec7dc8d31049ad427fb9265363e1b1988 /libavcodec/dxva2_h264.c | |
parent | 5f390eef8ee2b8adab00c5d2923a52aa261eb999 (diff) | |
download | ffmpeg-56febc993b928ccc039a32158ca60b234c311875.tar.gz |
h264: move the slice type variables into the per-slice context
Diffstat (limited to 'libavcodec/dxva2_h264.c')
-rw-r--r-- | libavcodec/dxva2_h264.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index dbc5087619..9218316df9 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -223,8 +223,8 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, slice->first_mb_in_slice = (h->mb_y >> FIELD_OR_MBAFF_PICTURE(h)) * h->mb_width + h->mb_x; slice->NumMbsForSlice = 0; /* XXX it is set once we have all slices */ slice->BitOffsetToSliceData = get_bits_count(&h->gb); - slice->slice_type = ff_h264_get_slice_type(h); - if (h->slice_type_fixed) + slice->slice_type = ff_h264_get_slice_type(sl); + if (sl->slice_type_fixed) slice->slice_type += 5; slice->luma_log2_weight_denom = sl->luma_log2_weight_denom; slice->chroma_log2_weight_denom = sl->chroma_log2_weight_denom; @@ -278,7 +278,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, slice->slice_qs_delta = 0; /* XXX not implemented by Libav */ slice->slice_qp_delta = sl->qscale - h->pps.init_qp; slice->redundant_pic_cnt = h->redundant_pic_count; - if (h->slice_type == AV_PICTURE_TYPE_B) + if (sl->slice_type == AV_PICTURE_TYPE_B) slice->direct_spatial_mv_pred_flag = h->direct_spatial_mv_pred; slice->cabac_init_idc = h->pps.cabac ? h->cabac_init_idc : 0; if (h->deblocking_filter < 2) @@ -417,6 +417,7 @@ static int dxva2_h264_decode_slice(AVCodecContext *avctx, uint32_t size) { const H264Context *h = avctx->priv_data; + const H264SliceContext *sl = &h->slice_ctx[0]; struct dxva_context *ctx = avctx->hwaccel_context; const H264Picture *current_picture = h->cur_pic_ptr; struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; @@ -438,7 +439,7 @@ static int dxva2_h264_decode_slice(AVCodecContext *avctx, &ctx_pic->pp, position, size); ctx_pic->slice_count++; - if (h->slice_type != AV_PICTURE_TYPE_I && h->slice_type != AV_PICTURE_TYPE_SI) + if (sl->slice_type != AV_PICTURE_TYPE_I && sl->slice_type != AV_PICTURE_TYPE_SI) ctx_pic->pp.wBitFields &= ~(1 << 15); /* Set IntraPicFlag to 0 */ return 0; } |