File: 0012-packetizer-h264-fix-reading-prediction-weight-tables.patch

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (52 lines) | stat: -rw-r--r-- 2,344 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: =?utf-8?q?Fran=C3=A7ois_Cartegnie?= <fcvlcdev@free.fr>
Date: Tue, 2 Jul 2024 10:31:51 +0200
Subject: packetizer: h264: fix reading prediction weight tables

(cherry picked from commit f878115e184a4d896e4df39bccbde32ea6d9357c)
---
 modules/packetizer/h264_nal.c   | 4 ++--
 modules/packetizer/h264_nal.h   | 1 +
 modules/packetizer/h264_slice.c | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/packetizer/h264_nal.c b/modules/packetizer/h264_nal.c
index 10c267e..2c70771 100644
--- a/modules/packetizer/h264_nal.c
+++ b/modules/packetizer/h264_nal.c
@@ -591,8 +591,8 @@ static bool h264_parse_picture_parameter_set_rbsp( bs_t *p_bs,
         }
     }
 
-    bs_read_ue( p_bs ); /* num_ref_idx_l0_default_active_minus1 */
-    bs_read_ue( p_bs ); /* num_ref_idx_l1_default_active_minus1 */
+    p_pps->num_ref_idx_l01_default_active_minus1[0] = bs_read_ue( p_bs );
+    p_pps->num_ref_idx_l01_default_active_minus1[1] = bs_read_ue( p_bs );
     p_pps->weighted_pred_flag = bs_read( p_bs, 1 );
     p_pps->weighted_bipred_idc = bs_read( p_bs, 2 );
     bs_read_se( p_bs ); /* pic_init_qp_minus26 */
diff --git a/modules/packetizer/h264_nal.h b/modules/packetizer/h264_nal.h
index edb9c04..5f6d74a 100644
--- a/modules/packetizer/h264_nal.h
+++ b/modules/packetizer/h264_nal.h
@@ -150,6 +150,7 @@ struct h264_picture_parameter_set_t
     uint8_t i_redundant_pic_present_flag;
     uint8_t weighted_pred_flag;
     uint8_t weighted_bipred_idc;
+    uint32_t num_ref_idx_l01_default_active_minus1[2];
 };
 
 struct h264_sequence_parameter_set_extension_t
diff --git a/modules/packetizer/h264_slice.c b/modules/packetizer/h264_slice.c
index d05256e..1c4d2a2 100644
--- a/modules/packetizer/h264_slice.c
+++ b/modules/packetizer/h264_slice.c
@@ -101,7 +101,8 @@ bool h264_decode_slice( const uint8_t *p_buffer, size_t i_buffer,
     if( p_pps->i_redundant_pic_present_flag )
         bs_read_ue( &s ); /* redudant_pic_count */
 
-    unsigned num_ref_idx_l01_active_minus1[2] = {0 , 0};
+    uint32_t num_ref_idx_l01_active_minus1[2] = { p_pps->num_ref_idx_l01_default_active_minus1[0],
+                                                  p_pps->num_ref_idx_l01_default_active_minus1[1] };
 
     if( i_slice_type == 1 || i_slice_type == 6 ) /* B slices */
         bs_read1( &s ); /* direct_spatial_mv_pred_flag */