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
Unified · Split
| @@ -3221,19 +3221,27 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, · 3220 unmodified lines | |||
| 3221 | flag(sh_cabac_init_flag); | 3221 | flag(sh_cabac_init_flag); |
| 3222 | else | 3222 | else |
| 3223 | infer(sh_cabac_init_flag, 0); | 3223 | infer(sh_cabac_init_flag, 0); |
| 3224 | if (ph->ph_temporal_mvp_enabled_flag && !pps->pps_rpl_info_in_ph_flag) { | 3224 | if (ph->ph_temporal_mvp_enabled_flag) { |
| 3225 | if (current->sh_slice_type == VVC_SLICE_TYPE_B) | 3225 | if (!pps->pps_rpl_info_in_ph_flag) { |
| 3226 | flag(sh_collocated_from_l0_flag); | 3226 | if (current->sh_slice_type == VVC_SLICE_TYPE_B) |
| 3227 | else | 3227 | flag(sh_collocated_from_l0_flag); |
| 3228 | infer(sh_collocated_from_l0_flag, 1); | 3228 | else |
| 3229 | if ((current->sh_collocated_from_l0_flag && | 3229 | infer(sh_collocated_from_l0_flag, 1); |
| 3230 | current->num_ref_idx_active[0] > 1) || | 3230 | if ((current->sh_collocated_from_l0_flag && |
| 3231 | (!current->sh_collocated_from_l0_flag && | 3231 | current->num_ref_idx_active[0] > 1) || |
| 3232 | current->num_ref_idx_active[1] > 1)) { | 3232 | (!current->sh_collocated_from_l0_flag && |
| 3233 | unsigned int idx = current->sh_collocated_from_l0_flag ? 0 : 1; | 3233 | current->num_ref_idx_active[1] > 1)) { |
| 3234 | ue(sh_collocated_ref_idx, 0, current->num_ref_idx_active[idx] - 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 | } | ||
| 3235 | } else { | 3239 | } 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); | ||
| 3237 | } | 3245 | } |
| 3238 | } | 3246 | } |
| 3239 | if (!pps->pps_wp_info_in_ph_flag && | 3247 | if (!pps->pps_wp_info_in_ph_flag && |