|
|
@@ -251,10 +251,10 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb) |
|
|
uint8_t luma_weight_l1_flag[16]; |
|
|
uint8_t luma_weight_l1_flag[16]; |
|
|
uint8_t chroma_weight_l1_flag[16]; |
|
|
uint8_t chroma_weight_l1_flag[16]; |
|
|
|
|
|
|
|
|
s->sh.luma_log2_weight_denom = av_clip_c(get_ue_golomb_long(gb), 0, 7); |
|
|
|
|
|
|
|
|
s->sh.luma_log2_weight_denom = av_clip(get_ue_golomb_long(gb), 0, 7); |
|
|
if (s->sps->chroma_format_idc != 0) { |
|
|
if (s->sps->chroma_format_idc != 0) { |
|
|
int delta = get_se_golomb(gb); |
|
|
int delta = get_se_golomb(gb); |
|
|
s->sh.chroma_log2_weight_denom = av_clip_c(s->sh.luma_log2_weight_denom + delta, 0, 7); |
|
|
|
|
|
|
|
|
s->sh.chroma_log2_weight_denom = av_clip(s->sh.luma_log2_weight_denom + delta, 0, 7); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for (i = 0; i < s->sh.nb_refs[L0]; i++) { |
|
|
for (i = 0; i < s->sh.nb_refs[L0]; i++) { |
|
|
@@ -282,7 +282,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb) |
|
|
int delta_chroma_weight_l0 = get_se_golomb(gb); |
|
|
int delta_chroma_weight_l0 = get_se_golomb(gb); |
|
|
int delta_chroma_offset_l0 = get_se_golomb(gb); |
|
|
int delta_chroma_offset_l0 = get_se_golomb(gb); |
|
|
s->sh.chroma_weight_l0[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l0; |
|
|
s->sh.chroma_weight_l0[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l0; |
|
|
s->sh.chroma_offset_l0[i][j] = av_clip_c((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j]) |
|
|
|
|
|
|
|
|
s->sh.chroma_offset_l0[i][j] = av_clip((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j]) |
|
|
>> s->sh.chroma_log2_weight_denom) + 128), -128, 127); |
|
|
>> s->sh.chroma_log2_weight_denom) + 128), -128, 127); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
@@ -318,7 +318,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb) |
|
|
int delta_chroma_weight_l1 = get_se_golomb(gb); |
|
|
int delta_chroma_weight_l1 = get_se_golomb(gb); |
|
|
int delta_chroma_offset_l1 = get_se_golomb(gb); |
|
|
int delta_chroma_offset_l1 = get_se_golomb(gb); |
|
|
s->sh.chroma_weight_l1[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l1; |
|
|
s->sh.chroma_weight_l1[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l1; |
|
|
s->sh.chroma_offset_l1[i][j] = av_clip_c((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j]) |
|
|
|
|
|
|
|
|
s->sh.chroma_offset_l1[i][j] = av_clip((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j]) |
|
|
>> s->sh.chroma_log2_weight_denom) + 128), -128, 127); |
|
|
>> s->sh.chroma_log2_weight_denom) + 128), -128, 127); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
@@ -964,7 +964,7 @@ static void hls_residual_coding(HEVCContext *s, int x0, int y0, |
|
|
else |
|
|
else |
|
|
offset = s->pps->cr_qp_offset + s->sh.slice_cr_qp_offset; |
|
|
offset = s->pps->cr_qp_offset + s->sh.slice_cr_qp_offset; |
|
|
|
|
|
|
|
|
qp_i = av_clip_c(qp_y + offset, -s->sps->qp_bd_offset, 57); |
|
|
|
|
|
|
|
|
qp_i = av_clip(qp_y + offset, -s->sps->qp_bd_offset, 57); |
|
|
if (qp_i < 30) |
|
|
if (qp_i < 30) |
|
|
qp = qp_i; |
|
|
qp = qp_i; |
|
|
else if (qp_i > 43) |
|
|
else if (qp_i > 43) |
|
|
|