[vlc-commits] packetizer: hevc: split pref/suffix sei

Francois Cartegnie git at videolan.org
Fri Jan 12 16:23:16 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 12 13:40:19 2018 +0100| [c0893f0afcc7fea50d64d636842cb368a618aacb] | committer: Thomas Guillem

packetizer: hevc: split pref/suffix sei

(cherry picked from commit 2e134414b827f0d8e7f9df12e5d1baefd5201d9e)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=c0893f0afcc7fea50d64d636842cb368a618aacb
---

 modules/mux/mp4/libmp4mux.c   | 17 +++++++++++++----
 modules/packetizer/hevc_nal.c | 12 ++++++++----
 modules/packetizer/hevc_nal.h |  9 ++++++---
 3 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index bf087ab426..78cb1e3a31 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -621,13 +621,22 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt, bool b_completeness)
                 }
                 break;
             case HEVC_NAL_PREF_SEI:
-                if(params.i_sei_count != HEVC_DCR_SEI_COUNT)
+                if(params.i_seipref_count != HEVC_DCR_SEI_COUNT)
                 {
-                    params.p_sei[params.i_sei_count] = p_nal;
-                    params.rgi_sei[params.i_sei_count] = i_nal;
-                    params.i_sei_count++;
+                    params.p_seipref[params.i_seipref_count] = p_nal;
+                    params.rgi_seipref[params.i_seipref_count] = i_nal;
+                    params.i_seipref_count++;
                 }
                 break;
+            case HEVC_NAL_SUFF_SEI:
+                if(params.i_seisuff_count != HEVC_DCR_SEI_COUNT)
+                {
+                    params.p_seisuff[params.i_seisuff_count] = p_nal;
+                    params.rgi_seisuff[params.i_seisuff_count] = i_nal;
+                    params.i_seisuff_count++;
+                }
+                break;
+
             default:
                 break;
         }
diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c
index 9bbd16e88d..0e6d71df8d 100644
--- a/modules/packetizer/hevc_nal.c
+++ b/modules/packetizer/hevc_nal.c
@@ -1400,7 +1400,8 @@ uint8_t * hevc_create_dcr( const struct hevc_dcr_params *p_params,
     HEVC_DCR_ADD_SIZES(p_params->i_vps_count, p_params->rgi_vps);
     HEVC_DCR_ADD_SIZES(p_params->i_sps_count, p_params->rgi_sps);
     HEVC_DCR_ADD_SIZES(p_params->i_pps_count, p_params->rgi_pps);
-    HEVC_DCR_ADD_SIZES(p_params->i_sei_count, p_params->rgi_sei);
+    HEVC_DCR_ADD_SIZES(p_params->i_seipref_count, p_params->rgi_seipref);
+    HEVC_DCR_ADD_SIZES(p_params->i_seisuff_count, p_params->rgi_seisuff);
 
     uint8_t *p_data = malloc( i_total_size );
     if( p_data == NULL )
@@ -1428,7 +1429,8 @@ uint8_t * hevc_create_dcr( const struct hevc_dcr_params *p_params,
               (i_nal_length_size - 1) );
     /* total number of arrays */
     *p++ = !!p_params->i_vps_count + !!p_params->i_sps_count +
-           !!p_params->i_pps_count + !!p_params->i_sei_count;
+           !!p_params->i_pps_count + !!p_params->i_seipref_count +
+           !!p_params->i_seisuff_count;
 
     /* Write NAL arrays */
     HEVC_DCR_ADD_NALS(HEVC_NAL_VPS, p_params->i_vps_count,
@@ -1437,8 +1439,10 @@ uint8_t * hevc_create_dcr( const struct hevc_dcr_params *p_params,
                       p_params->p_sps, p_params->rgi_sps);
     HEVC_DCR_ADD_NALS(HEVC_NAL_PPS, p_params->i_pps_count,
                       p_params->p_pps, p_params->rgi_pps);
-    HEVC_DCR_ADD_NALS(HEVC_NAL_PREF_SEI, p_params->i_sei_count,
-                      p_params->p_sei, p_params->rgi_sei);
+    HEVC_DCR_ADD_NALS(HEVC_NAL_PREF_SEI, p_params->i_seipref_count,
+                      p_params->p_seipref, p_params->rgi_seipref);
+    HEVC_DCR_ADD_NALS(HEVC_NAL_SUFF_SEI, p_params->i_seisuff_count,
+                      p_params->p_seisuff, p_params->rgi_seisuff);
 
     return p_data;
 }
diff --git a/modules/packetizer/hevc_nal.h b/modules/packetizer/hevc_nal.h
index ed4c9cade1..777622d903 100644
--- a/modules/packetizer/hevc_nal.h
+++ b/modules/packetizer/hevc_nal.h
@@ -220,12 +220,15 @@ struct hevc_dcr_params
     const uint8_t *p_vps[HEVC_DCR_VPS_COUNT],
                   *p_sps[HEVC_DCR_SPS_COUNT],
                   *p_pps[HEVC_DCR_VPS_COUNT],
-                  *p_sei[HEVC_DCR_SEI_COUNT];
+                  *p_seipref[HEVC_DCR_SEI_COUNT],
+                  *p_seisuff[HEVC_DCR_SEI_COUNT];
     uint8_t rgi_vps[HEVC_DCR_VPS_COUNT],
             rgi_sps[HEVC_DCR_SPS_COUNT],
             rgi_pps[HEVC_DCR_PPS_COUNT],
-            rgi_sei[HEVC_DCR_SEI_COUNT];
-    uint8_t i_vps_count, i_sps_count, i_pps_count, i_sei_count;
+            rgi_seipref[HEVC_DCR_SEI_COUNT],
+            rgi_seisuff[HEVC_DCR_SEI_COUNT];
+    uint8_t i_vps_count, i_sps_count, i_pps_count;
+    uint8_t i_seipref_count, i_seisuff_count;
     struct hevc_dcr_values *p_values;
 };
 



More information about the vlc-commits mailing list