History

avcodec/cbs_h266: fix sh_collocated_from_l0_flag and sh_collocated_ref_idx infer

we have to infer sh_collocated_from_l0_flag and sh_collocated_ref_idx from picture head if pps_rpl_info_in_ph_flag is true

Nuo Mi committed 2 years ago

Commit 191fbd71 parent cd540a31 file · +20 −12Browse files

Unified · Split

libavcodec/cbs_h266_syntax_template.c+20−12
@@ -3221,19 +3221,27 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, · 3220 unmodified lines
32213221 flag(sh_cabac_init_flag);
32223222 else
32233223 infer(sh_cabac_init_flag, 0);
3224− if (ph->ph_temporal_mvp_enabled_flag && !pps->pps_rpl_info_in_ph_flag) {
3225− if (current->sh_slice_type == VVC_SLICE_TYPE_B)
3226− flag(sh_collocated_from_l0_flag);
3227− else
3228− infer(sh_collocated_from_l0_flag, 1);
3229− if ((current->sh_collocated_from_l0_flag &&
3230− current->num_ref_idx_active[0] > 1) ||
3231− (!current->sh_collocated_from_l0_flag &&
3232− current->num_ref_idx_active[1] > 1)) {
3233− unsigned int idx = current->sh_collocated_from_l0_flag ? 0 : 1;
3234− ue(sh_collocated_ref_idx, 0, current->num_ref_idx_active[idx] - 1);
3224+ if (ph->ph_temporal_mvp_enabled_flag) {
3225+ if (!pps->pps_rpl_info_in_ph_flag) {
3226+ if (current->sh_slice_type == VVC_SLICE_TYPE_B)
3227+ flag(sh_collocated_from_l0_flag);
3228+ else
3229+ infer(sh_collocated_from_l0_flag, 1);
3230+ if ((current->sh_collocated_from_l0_flag &&
3231+ current->num_ref_idx_active[0] > 1) ||
3232+ (!current->sh_collocated_from_l0_flag &&
3233+ current->num_ref_idx_active[1] > 1)) {
3234+ unsigned int idx = current->sh_collocated_from_l0_flag ? 0 : 1;
3235+ ue(sh_collocated_ref_idx, 0, current->num_ref_idx_active[idx] - 1);
3236+ } else {
3237+ infer(sh_collocated_ref_idx, 0);
3238+ }
32353239 } else {
3236− infer(sh_collocated_ref_idx, 0);
3240+ if (current->sh_slice_type == VVC_SLICE_TYPE_B)
3241+ infer(sh_collocated_from_l0_flag, ph->ph_collocated_from_l0_flag);
3242+ else
3243+ infer(sh_collocated_from_l0_flag, 1);
3244+ infer(sh_collocated_ref_idx, ph->ph_collocated_ref_idx);
32373245 }
32383246 }
32393247 if (!pps->pps_wp_info_in_ph_flag &&

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t