mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
cbs_h266: H266RawPredWeightTable, expose num_weights_l0 and num_weights_l1
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
ea8571dc99
commit
088bda0f8e
@ -666,6 +666,9 @@ typedef struct H266RawPredWeightTable {
|
|||||||
int8_t luma_offset_l1[15];
|
int8_t luma_offset_l1[15];
|
||||||
int8_t delta_chroma_weight_l1[15][2];
|
int8_t delta_chroma_weight_l1[15][2];
|
||||||
int16_t delta_chroma_offset_l1[15][2];
|
int16_t delta_chroma_offset_l1[15][2];
|
||||||
|
|
||||||
|
uint8_t num_weights_l0; ///< NumWeightsL0
|
||||||
|
uint8_t num_weights_l1; ///< NumWeightsL1
|
||||||
} H266RawPredWeightTable;
|
} H266RawPredWeightTable;
|
||||||
|
|
||||||
typedef struct H266RawPictureHeader {
|
typedef struct H266RawPictureHeader {
|
||||||
|
@ -2507,7 +2507,6 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
H266RawPredWeightTable *current)
|
H266RawPredWeightTable *current)
|
||||||
{
|
{
|
||||||
int err, i, j;
|
int err, i, j;
|
||||||
uint8_t num_weights_l0, num_weights_l1;
|
|
||||||
ue(luma_log2_weight_denom, 0, 7);
|
ue(luma_log2_weight_denom, 0, 7);
|
||||||
if (sps->sps_chroma_format_idc != 0) {
|
if (sps->sps_chroma_format_idc != 0) {
|
||||||
se(delta_chroma_log2_weight_denom,
|
se(delta_chroma_log2_weight_denom,
|
||||||
@ -2516,21 +2515,21 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
} else {
|
} else {
|
||||||
infer(delta_chroma_log2_weight_denom, 0);
|
infer(delta_chroma_log2_weight_denom, 0);
|
||||||
}
|
}
|
||||||
if (pps->pps_wp_info_in_ph_flag)
|
if (pps->pps_wp_info_in_ph_flag) {
|
||||||
ue(num_l0_weights, 0,
|
ue(num_l0_weights, 0,
|
||||||
FFMIN(15, ref_lists->rpl_ref_list[0].num_ref_entries));
|
FFMIN(15, ref_lists->rpl_ref_list[0].num_ref_entries));
|
||||||
else
|
infer(num_weights_l0, current->num_l0_weights);
|
||||||
infer(num_l0_weights, 0);
|
} else {
|
||||||
num_weights_l0 = pps->pps_wp_info_in_ph_flag ?
|
infer(num_weights_l0, num_ref_idx_active[0]);
|
||||||
current->num_l0_weights : num_ref_idx_active[0];
|
}
|
||||||
for (i = 0; i < num_weights_l0; i++) {
|
for (i = 0; i < current->num_weights_l0; i++) {
|
||||||
flags(luma_weight_l0_flag[i], 1, i);
|
flags(luma_weight_l0_flag[i], 1, i);
|
||||||
}
|
}
|
||||||
if (sps->sps_chroma_format_idc != 0) {
|
if (sps->sps_chroma_format_idc != 0) {
|
||||||
for (i = 0; i < num_weights_l0; i++)
|
for (i = 0; i < current->num_weights_l0; i++)
|
||||||
flags(chroma_weight_l0_flag[i], 1, i);
|
flags(chroma_weight_l0_flag[i], 1, i);
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_weights_l0; i++) {
|
for (i = 0; i < current->num_weights_l0; i++) {
|
||||||
if (current->luma_weight_l0_flag[i]) {
|
if (current->luma_weight_l0_flag[i]) {
|
||||||
ses(delta_luma_weight_l0[i], -128, 127, 1, i);
|
ses(delta_luma_weight_l0[i], -128, 127, 1, i);
|
||||||
ses(luma_offset_l0[i], -128, 127, 1, i);
|
ses(luma_offset_l0[i], -128, 127, 1, i);
|
||||||
@ -2546,28 +2545,26 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pps->pps_weighted_bipred_flag && pps->pps_wp_info_in_ph_flag &&
|
if (pps->pps_weighted_bipred_flag &&
|
||||||
ref_lists->rpl_ref_list[1].num_ref_entries > 0) {
|
ref_lists->rpl_ref_list[1].num_ref_entries > 0) {
|
||||||
ue(num_l1_weights, 0,
|
if (pps->pps_wp_info_in_ph_flag) {
|
||||||
FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries));
|
ue(num_l1_weights, 0,
|
||||||
}
|
FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries));
|
||||||
if (!pps->pps_weighted_bipred_flag ||
|
infer(num_weights_l1, current->num_l1_weights);
|
||||||
(pps->pps_wp_info_in_ph_flag &&
|
} else {
|
||||||
ref_lists->rpl_ref_list[1].num_ref_entries == 0)) {
|
infer(num_weights_l1, num_ref_idx_active[1]);
|
||||||
num_weights_l1 = 0;
|
}
|
||||||
} else if (pps->pps_wp_info_in_ph_flag) {
|
|
||||||
num_weights_l1 = current->num_l1_weights;
|
|
||||||
} else {
|
} else {
|
||||||
num_weights_l1 = num_ref_idx_active[1];
|
infer(num_weights_l1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_weights_l1; i++)
|
for (i = 0; i < current->num_weights_l1; i++)
|
||||||
flags(luma_weight_l1_flag[i], 1, i);
|
flags(luma_weight_l1_flag[i], 1, i);
|
||||||
if (sps->sps_chroma_format_idc != 0) {
|
if (sps->sps_chroma_format_idc != 0) {
|
||||||
for (i = 0; i < num_weights_l1; i++)
|
for (i = 0; i < current->num_weights_l1; i++)
|
||||||
flags(chroma_weight_l1_flag[i], 1, i);
|
flags(chroma_weight_l1_flag[i], 1, i);
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_weights_l1; i++) {
|
for (i = 0; i < current->num_weights_l1; i++) {
|
||||||
if (current->luma_weight_l1_flag[i]) {
|
if (current->luma_weight_l1_flag[i]) {
|
||||||
ses(delta_luma_weight_l1[i], -128, 127, 1, i);
|
ses(delta_luma_weight_l1[i], -128, 127, 1, i);
|
||||||
ses(luma_offset_l1[i], -128, 127, 1, i);
|
ses(luma_offset_l1[i], -128, 127, 1, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user