diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-03-21 16:14:31 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-03-28 09:48:31 +0200 |
commit | e481458bc308ee838deaeacac51929514762e7a7 (patch) | |
tree | 5ce061d8d1ffa62aded7fdac43e95ee00d8e5ea9 /libavcodec/vaapi_h264.c | |
parent | 90ed6c5cf7f236bc9efb47c97b40358c666d1386 (diff) | |
download | ffmpeg-e481458bc308ee838deaeacac51929514762e7a7.tar.gz |
h264: factor out pred weight table parsing into a separate file
This will allow decoupling the parser from the decoder.
Diffstat (limited to 'libavcodec/vaapi_h264.c')
-rw-r--r-- | libavcodec/vaapi_h264.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 7f7de56c8f..431a428b47 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -195,25 +195,25 @@ static void fill_vaapi_plain_pred_weight_table(H264Context *h, H264SliceContext *sl = &h->slice_ctx[0]; unsigned int i, j; - *luma_weight_flag = sl->luma_weight_flag[list]; - *chroma_weight_flag = sl->chroma_weight_flag[list]; + *luma_weight_flag = sl->pwt.luma_weight_flag[list]; + *chroma_weight_flag = sl->pwt.chroma_weight_flag[list]; for (i = 0; i < sl->ref_count[list]; i++) { /* VA API also wants the inferred (default) values, not only what is available in the bitstream (7.4.3.2). */ - if (sl->luma_weight_flag[list]) { - luma_weight[i] = sl->luma_weight[i][list][0]; - luma_offset[i] = sl->luma_weight[i][list][1]; + if (sl->pwt.luma_weight_flag[list]) { + luma_weight[i] = sl->pwt.luma_weight[i][list][0]; + luma_offset[i] = sl->pwt.luma_weight[i][list][1]; } else { - luma_weight[i] = 1 << sl->luma_log2_weight_denom; + luma_weight[i] = 1 << sl->pwt.luma_log2_weight_denom; luma_offset[i] = 0; } for (j = 0; j < 2; j++) { - if (sl->chroma_weight_flag[list]) { - chroma_weight[i][j] = sl->chroma_weight[i][list][j][0]; - chroma_offset[i][j] = sl->chroma_weight[i][list][j][1]; + if (sl->pwt.chroma_weight_flag[list]) { + chroma_weight[i][j] = sl->pwt.chroma_weight[i][list][j][0]; + chroma_offset[i][j] = sl->pwt.chroma_weight[i][list][j][1]; } else { - chroma_weight[i][j] = 1 << sl->chroma_log2_weight_denom; + chroma_weight[i][j] = 1 << sl->pwt.chroma_log2_weight_denom; chroma_offset[i][j] = 0; } } @@ -339,8 +339,8 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, slice_param->disable_deblocking_filter_idc = sl->deblocking_filter < 2 ? !sl->deblocking_filter : sl->deblocking_filter; slice_param->slice_alpha_c0_offset_div2 = sl->slice_alpha_c0_offset / 2; slice_param->slice_beta_offset_div2 = sl->slice_beta_offset / 2; - slice_param->luma_log2_weight_denom = sl->luma_log2_weight_denom; - slice_param->chroma_log2_weight_denom = sl->chroma_log2_weight_denom; + slice_param->luma_log2_weight_denom = sl->pwt.luma_log2_weight_denom; + slice_param->chroma_log2_weight_denom = sl->pwt.chroma_log2_weight_denom; fill_vaapi_RefPicList(slice_param->RefPicList0, sl->ref_list[0], sl->list_count > 0 ? sl->ref_count[0] : 0); fill_vaapi_RefPicList(slice_param->RefPicList1, sl->ref_list[1], sl->list_count > 1 ? sl->ref_count[1] : 0); |