diff mbox series

[FFmpeg-devel] avcodec/hevc, h2645_parse: Fix HEVC NAL unit names and constants

Message ID 20200318134123.14932-1-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] avcodec/hevc, h2645_parse: Fix HEVC NAL unit names and constants | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt March 18, 2020, 1:41 p.m. UTC
This commit fixes the names and constants of the reserved NAL units
with nal_unit_type 22 resp. 23. They were "IRAP_IRAP_VLC2x", but are
actually "RSV_IRAP_VLC2x".

This also required a change to cbs_h265_syntax_template.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
Should I realign the enum?

 libavcodec/cbs_h265_syntax_template.c | 2 +-
 libavcodec/h2645_parse.c              | 4 ++--
 libavcodec/hevc.h                     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Anton Khirnov March 20, 2020, 9:27 a.m. UTC | #1
Quoting Andreas Rheinhardt (2020-03-18 14:41:23)
> This commit fixes the names and constants of the reserved NAL units
> with nal_unit_type 22 resp. 23. They were "IRAP_IRAP_VLC2x", but are
> actually "RSV_IRAP_VLC2x".
> 
> This also required a change to cbs_h265_syntax_template.c.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---

Looks ok.

> Should I realign the enum?

Sure
Andreas Rheinhardt March 24, 2020, 11:01 p.m. UTC | #2
Anton Khirnov:
> Quoting Andreas Rheinhardt (2020-03-18 14:41:23)
>> This commit fixes the names and constants of the reserved NAL units
>> with nal_unit_type 22 resp. 23. They were "IRAP_IRAP_VLC2x", but are
>> actually "RSV_IRAP_VLC2x".
>>
>> This also required a change to cbs_h265_syntax_template.c.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
>> ---
> 
> Looks ok.
> 
>> Should I realign the enum?
> 
> Sure
> 
Applied together with a cosmetic patch for the realignment. Thanks.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
index 15114548c6..180a045c34 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -1275,7 +1275,7 @@  static int FUNC(slice_segment_header)(CodedBitstreamContext *ctx, RWContext *rw,
     flag(first_slice_segment_in_pic_flag);
 
     if (current->nal_unit_header.nal_unit_type >= HEVC_NAL_BLA_W_LP &&
-        current->nal_unit_header.nal_unit_type <= HEVC_NAL_IRAP_VCL23)
+        current->nal_unit_header.nal_unit_type <= HEVC_NAL_RSV_IRAP_VCL23)
         flag(no_output_of_prior_pics_flag);
 
     ue(slice_pic_parameter_set_id, 0, 63);
diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 0f3343004f..2e03871640 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -169,8 +169,8 @@  static const char *hevc_nal_type_name[64] = {
     "IDR_W_RADL", // HEVC_NAL_IDR_W_RADL
     "IDR_N_LP", // HEVC_NAL_IDR_N_LP
     "CRA_NUT", // HEVC_NAL_CRA_NUT
-    "IRAP_IRAP_VCL22", // HEVC_NAL_IRAP_VCL22
-    "IRAP_IRAP_VCL23", // HEVC_NAL_IRAP_VCL23
+    "RSV_IRAP_VCL22", // HEVC_NAL_RSV_IRAP_VCL22
+    "RSV_IRAP_VCL23", // HEVC_NAL_RSV_IRAP_VCL23
     "RSV_VCL24", // HEVC_NAL_RSV_VCL24
     "RSV_VCL25", // HEVC_NAL_RSV_VCL25
     "RSV_VCL26", // HEVC_NAL_RSV_VCL26
diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h
index 56b5541d90..e15d89fa95 100644
--- a/libavcodec/hevc.h
+++ b/libavcodec/hevc.h
@@ -48,8 +48,8 @@  enum HEVCNALUnitType {
     HEVC_NAL_IDR_W_RADL = 19,
     HEVC_NAL_IDR_N_LP   = 20,
     HEVC_NAL_CRA_NUT    = 21,
-    HEVC_NAL_IRAP_VCL22 = 22,
-    HEVC_NAL_IRAP_VCL23 = 23,
+    HEVC_NAL_RSV_IRAP_VCL22 = 22,
+    HEVC_NAL_RSV_IRAP_VCL23 = 23,
     HEVC_NAL_RSV_VCL24  = 24,
     HEVC_NAL_RSV_VCL25  = 25,
     HEVC_NAL_RSV_VCL26  = 26,