summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mb.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-01-17 18:45:29 +0100
committerAnton Khirnov <anton@khirnov.net>2015-03-21 11:27:09 +0100
commit92c6c2a605f9b077b8fbc25b7ed6625541232b87 (patch)
tree51e89e9a2492a69f9364daaf4d63b0ba31f04e56 /libavcodec/h264_mb.c
parentd8a45d2d49f54fde042b195f9d5859251252493d (diff)
h264: split weighted pred-related vars into per-slice context
Diffstat (limited to 'libavcodec/h264_mb.c')
-rw-r--r--libavcodec/h264_mb.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c
index 61d68ab4ec..b2899b62a7 100644
--- a/libavcodec/h264_mb.c
+++ b/libavcodec/h264_mb.c
@@ -362,7 +362,8 @@ static av_always_inline void mc_part_std(H264Context *h, int n, int square,
}
}
-static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
+static av_always_inline void mc_part_weighted(H264Context *h, H264SliceContext *sl,
+ int n, int square,
int height, int delta,
uint8_t *dest_y, uint8_t *dest_cb,
uint8_t *dest_cr,
@@ -415,8 +416,8 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
x_offset, y_offset, qpix_put, chroma_put,
pixel_shift, chroma_idc);
- if (h->use_weight == 2) {
- int weight0 = h->implicit_weight[refn0][refn1][h->mb_y & 1];
+ if (sl->use_weight == 2) {
+ int weight0 = sl->implicit_weight[refn0][refn1][h->mb_y & 1];
int weight1 = 64 - weight0;
luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
height, 5, weight0, weight1, 0);
@@ -426,23 +427,23 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
chroma_height, 5, weight0, weight1, 0);
} else {
luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
- h->luma_log2_weight_denom,
- h->luma_weight[refn0][0][0],
- h->luma_weight[refn1][1][0],
- h->luma_weight[refn0][0][1] +
- h->luma_weight[refn1][1][1]);
+ 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]);
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn0][0][0][0],
- h->chroma_weight[refn1][1][0][0],
- h->chroma_weight[refn0][0][0][1] +
- h->chroma_weight[refn1][1][0][1]);
+ 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]);
chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn0][0][1][0],
- h->chroma_weight[refn1][1][1][0],
- h->chroma_weight[refn0][0][1][1] +
- h->chroma_weight[refn1][1][1][1]);
+ 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]);
}
} else {
int list = list1 ? 1 : 0;
@@ -453,18 +454,18 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
qpix_put, chroma_put, pixel_shift, chroma_idc);
luma_weight_op(dest_y, h->mb_linesize, height,
- h->luma_log2_weight_denom,
- h->luma_weight[refn][list][0],
- h->luma_weight[refn][list][1]);
- if (h->use_weight_chroma) {
+ sl->luma_log2_weight_denom,
+ sl->luma_weight[refn][list][0],
+ sl->luma_weight[refn][list][1]);
+ if (sl->use_weight_chroma) {
chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn][list][0][0],
- h->chroma_weight[refn][list][0][1]);
+ sl->chroma_log2_weight_denom,
+ sl->chroma_weight[refn][list][0][0],
+ sl->chroma_weight[refn][list][0][1]);
chroma_weight_op(dest_cr, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn][list][1][0],
- h->chroma_weight[refn][list][1][1]);
+ sl->chroma_log2_weight_denom,
+ sl->chroma_weight[refn][list][1][0],
+ sl->chroma_weight[refn][list][1][1]);
}
}
}
@@ -801,7 +802,7 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type,
#define SIMPLE 0
#include "h264_mb_template.c"
-void ff_h264_hl_decode_mb(H264Context *h)
+void ff_h264_hl_decode_mb(H264Context *h, H264SliceContext *sl)
{
const int mb_xy = h->mb_xy;
const int mb_type = h->cur_pic.mb_type[mb_xy];
@@ -810,13 +811,13 @@ void ff_h264_hl_decode_mb(H264Context *h)
if (CHROMA444(h)) {
if (is_complex || h->pixel_shift)
- hl_decode_mb_444_complex(h);
+ hl_decode_mb_444_complex(h, sl);
else
- hl_decode_mb_444_simple_8(h);
+ hl_decode_mb_444_simple_8(h, sl);
} else if (is_complex) {
- hl_decode_mb_complex(h);
+ hl_decode_mb_complex(h, sl);
} else if (h->pixel_shift) {
- hl_decode_mb_simple_16(h);
+ hl_decode_mb_simple_16(h, sl);
} else
- hl_decode_mb_simple_8(h);
+ hl_decode_mb_simple_8(h, sl);
}