diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-08-28 17:07:01 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-09-12 22:11:55 +0100 |
commit | 067a9ddeb8feff1f724856f0054930c55219f76b (patch) | |
tree | a961bedf31f99ef5c76bde3e247c1643c9e25b91 /libavcodec | |
parent | f763489364416bb6866adc4f4a96012dd2ca1bd0 (diff) |
cbs_h265: Fix ranges of prediction weight offsets
The bracketing was wrong - '-' binds before '<<'. This would
previously incorrectly reject the streams in the WP_A and WP_B
conformance tests.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/cbs_h265_syntax_template.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c index 8564220d53..a194887d76 100644 --- a/libavcodec/cbs_h265_syntax_template.c +++ b/libavcodec/cbs_h265_syntax_template.c @@ -1133,7 +1133,7 @@ static int FUNC(pred_weight_table)(CodedBitstreamContext *ctx, RWContext *rw, se(delta_luma_weight_l0[i], -128, +127); se(luma_offset_l0[i], -(1 << (sps->bit_depth_luma_minus8 + 8 - 1)), - +(1 << (sps->bit_depth_luma_minus8 + 8 - 1) - 1)); + ((1 << (sps->bit_depth_luma_minus8 + 8 - 1)) - 1)); } else { infer(delta_luma_weight_l0[i], 0); infer(luma_offset_l0[i], 0); @@ -1143,7 +1143,7 @@ static int FUNC(pred_weight_table)(CodedBitstreamContext *ctx, RWContext *rw, se(delta_chroma_weight_l0[i][j], -128, +127); se(chroma_offset_l0[i][j], -(4 << (sps->bit_depth_chroma_minus8 + 8 - 1)), - +(4 << (sps->bit_depth_chroma_minus8 + 8 - 1) - 1)); + ((4 << (sps->bit_depth_chroma_minus8 + 8 - 1)) - 1)); } } else { for (j = 0; j < 2; j++) { @@ -1173,8 +1173,8 @@ static int FUNC(pred_weight_table)(CodedBitstreamContext *ctx, RWContext *rw, if (current->luma_weight_l1_flag[i]) { se(delta_luma_weight_l1[i], -128, +127); se(luma_offset_l1[i], - - 1 << (sps->bit_depth_luma_minus8 + 8 - 1), - + 1 << (sps->bit_depth_luma_minus8 + 8 - 1) - 1); + -(1 << (sps->bit_depth_luma_minus8 + 8 - 1)), + ((1 << (sps->bit_depth_luma_minus8 + 8 - 1)) - 1)); } else { infer(delta_luma_weight_l1[i], 0); infer(luma_offset_l1[i], 0); @@ -1183,8 +1183,8 @@ static int FUNC(pred_weight_table)(CodedBitstreamContext *ctx, RWContext *rw, for (j = 0; j < 2; j++) { se(delta_chroma_weight_l1[i][j], -128, +127); se(chroma_offset_l1[i][j], - - 4 << (sps->bit_depth_chroma_minus8 + 8 - 1), - + 4 << (sps->bit_depth_chroma_minus8 + 8 - 1) - 1); + -(4 << (sps->bit_depth_chroma_minus8 + 8 - 1)), + ((4 << (sps->bit_depth_chroma_minus8 + 8 - 1)) - 1)); } } else { for (j = 0; j < 2; j++) { |