summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mb.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-03-21 16:14:31 +0100
committerAnton Khirnov <anton@khirnov.net>2016-03-28 09:48:31 +0200
commite481458bc308ee838deaeacac51929514762e7a7 (patch)
tree5ce061d8d1ffa62aded7fdac43e95ee00d8e5ea9 /libavcodec/h264_mb.c
parent90ed6c5cf7f236bc9efb47c97b40358c666d1386 (diff)
h264: factor out pred weight table parsing into a separate file
This will allow decoupling the parser from the decoder.
Diffstat (limited to 'libavcodec/h264_mb.c')
-rw-r--r--libavcodec/h264_mb.c54
1 files changed, 27 insertions, 27 deletions
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]);
}
}
}