From e481458bc308ee838deaeacac51929514762e7a7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 21 Mar 2016 16:14:31 +0100 Subject: h264: factor out pred weight table parsing into a separate file This will allow decoupling the parser from the decoder. --- libavcodec/h264_mb.c | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'libavcodec/h264_mb.c') diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c index 2487b96ceb..f94333b590 100644 --- a/libavcodec/h264_mb.c +++ b/libavcodec/h264_mb.c @@ -419,8 +419,8 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon x_offset, y_offset, qpix_put, chroma_put, pixel_shift, chroma_idc); - if (sl->use_weight == 2) { - int weight0 = sl->implicit_weight[refn0][refn1][sl->mb_y & 1]; + if (sl->pwt.use_weight == 2) { + int weight0 = sl->pwt.implicit_weight[refn0][refn1][sl->mb_y & 1]; int weight1 = 64 - weight0; luma_weight_avg(dest_y, tmp_y, sl->mb_linesize, height, 5, weight0, weight1, 0); @@ -430,23 +430,23 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon chroma_height, 5, weight0, weight1, 0); } else { luma_weight_avg(dest_y, tmp_y, sl->mb_linesize, height, - sl->luma_log2_weight_denom, - sl->luma_weight[refn0][0][0], - sl->luma_weight[refn1][1][0], - sl->luma_weight[refn0][0][1] + - sl->luma_weight[refn1][1][1]); + sl->pwt.luma_log2_weight_denom, + sl->pwt.luma_weight[refn0][0][0], + sl->pwt.luma_weight[refn1][1][0], + sl->pwt.luma_weight[refn0][0][1] + + sl->pwt.luma_weight[refn1][1][1]); chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize, chroma_height, - sl->chroma_log2_weight_denom, - sl->chroma_weight[refn0][0][0][0], - sl->chroma_weight[refn1][1][0][0], - sl->chroma_weight[refn0][0][0][1] + - sl->chroma_weight[refn1][1][0][1]); + sl->pwt.chroma_log2_weight_denom, + sl->pwt.chroma_weight[refn0][0][0][0], + sl->pwt.chroma_weight[refn1][1][0][0], + sl->pwt.chroma_weight[refn0][0][0][1] + + sl->pwt.chroma_weight[refn1][1][0][1]); chroma_weight_avg(dest_cr, tmp_cr, sl->mb_uvlinesize, chroma_height, - sl->chroma_log2_weight_denom, - sl->chroma_weight[refn0][0][1][0], - sl->chroma_weight[refn1][1][1][0], - sl->chroma_weight[refn0][0][1][1] + - sl->chroma_weight[refn1][1][1][1]); + sl->pwt.chroma_log2_weight_denom, + sl->pwt.chroma_weight[refn0][0][1][0], + sl->pwt.chroma_weight[refn1][1][1][0], + sl->pwt.chroma_weight[refn0][0][1][1] + + sl->pwt.chroma_weight[refn1][1][1][1]); } } else { int list = list1 ? 1 : 0; @@ -457,18 +457,18 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon qpix_put, chroma_put, pixel_shift, chroma_idc); luma_weight_op(dest_y, sl->mb_linesize, height, - sl->luma_log2_weight_denom, - sl->luma_weight[refn][list][0], - sl->luma_weight[refn][list][1]); - if (sl->use_weight_chroma) { + sl->pwt.luma_log2_weight_denom, + sl->pwt.luma_weight[refn][list][0], + sl->pwt.luma_weight[refn][list][1]); + if (sl->pwt.use_weight_chroma) { chroma_weight_op(dest_cb, sl->mb_uvlinesize, chroma_height, - sl->chroma_log2_weight_denom, - sl->chroma_weight[refn][list][0][0], - sl->chroma_weight[refn][list][0][1]); + sl->pwt.chroma_log2_weight_denom, + sl->pwt.chroma_weight[refn][list][0][0], + sl->pwt.chroma_weight[refn][list][0][1]); chroma_weight_op(dest_cr, sl->mb_uvlinesize, chroma_height, - sl->chroma_log2_weight_denom, - sl->chroma_weight[refn][list][1][0], - sl->chroma_weight[refn][list][1][1]); + sl->pwt.chroma_log2_weight_denom, + sl->pwt.chroma_weight[refn][list][1][0], + sl->pwt.chroma_weight[refn][list][1][1]); } } } -- cgit v1.2.3