diff mbox series

[FFmpeg-devel,v2,8/8] cbs_h266: slice_header, fix inference for pred_weight_table

Message ID TYSPR06MB643339FA1F9B4AD1A092D574AA0DA@TYSPR06MB6433.apcprd06.prod.outlook.com
State New
Headers show
Series None | expand

Commit Message

Nuo Mi Aug. 8, 2023, 10:59 a.m. UTC
---
 libavcodec/cbs_h266_syntax_template.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index b26d7c1a72..4075897b9a 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -3226,17 +3226,16 @@  static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
             } else {
                 infer(sh_collocated_ref_idx, 0);
             }
-            if (!pps->pps_wp_info_in_ph_flag &&
-                ((pps->pps_weighted_pred_flag &&
-                  current->sh_slice_type == VVC_SLICE_TYPE_P) ||
-                 (pps->pps_weighted_bipred_flag &&
-                  current->sh_slice_type == VVC_SLICE_TYPE_B))) {
-                CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists,
-                                               current->num_ref_idx_active,
-                                               &current->sh_pred_weight_table));
-            }
         }
-
+        if (!pps->pps_wp_info_in_ph_flag &&
+            ((pps->pps_weighted_pred_flag &&
+            current->sh_slice_type == VVC_SLICE_TYPE_P) ||
+            (pps->pps_weighted_bipred_flag &&
+            current->sh_slice_type == VVC_SLICE_TYPE_B))) {
+            CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists,
+                                           current->num_ref_idx_active,
+                                           &current->sh_pred_weight_table));
+        }
     }
     qp_bd_offset = 6 * sps->sps_bitdepth_minus8;
     if (!pps->pps_qp_delta_info_in_ph_flag)