[vlc-commits] packatizer: move color lookup tables for refactoring

Francois Cartegnie git at videolan.org
Tue Dec 18 18:14:36 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Aug  8 14:25:28 2018 +0200| [7461e254c40e724f8ab23242c1d44486c5504407] | committer: Hugo Beauzée-Luyssen

packatizer: move color lookup tables for refactoring

(cherry picked from commit e30314a439ca0f462fb3e524c6cda98b03b09065)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/demux/Makefile.am                                   |  2 +-
 modules/demux/mp4/essetup.c                                 |  2 +-
 modules/packetizer/av1_obu.c                                |  2 +-
 .../mp4/color_config.h => packetizer/iso_color_tables.h}    | 13 +++++++------
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/demux/Makefile.am b/modules/demux/Makefile.am
index 7f9771ebe8..1c2785fc4a 100644
--- a/modules/demux/Makefile.am
+++ b/modules/demux/Makefile.am
@@ -210,8 +210,8 @@ libmp4_plugin_la_SOURCES = demux/mp4/mp4.c demux/mp4/mp4.h \
                            demux/av1_unpack.h \
                            demux/asf/asfpacket.c demux/asf/asfpacket.h \
                            demux/mp4/avci.h \
-                           demux/mp4/color_config.h \
                            demux/mp4/essetup.c demux/mp4/meta.c \
+                           packetizer/iso_color_tables.h \
                            meta_engine/ID3Genres.h
 libmp4_plugin_la_LIBADD = $(LIBM)
 libmp4_plugin_la_LDFLAGS = $(AM_LDFLAGS)
diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 6bb527d3dd..133202d0ec 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -28,7 +28,7 @@
 #include "avci.h"
 #include "../xiph.h"
 #include "../../packetizer/dts_header.h"
-#include "color_config.h"
+#include "../../packetizer/iso_color_tables.h"
 
 #include <vlc_demux.h>
 #include <vlc_aout.h>
diff --git a/modules/packetizer/av1_obu.c b/modules/packetizer/av1_obu.c
index 7bb9a257b0..4e97470266 100644
--- a/modules/packetizer/av1_obu.c
+++ b/modules/packetizer/av1_obu.c
@@ -27,7 +27,7 @@
 
 #include "av1.h"
 #include "av1_obu.h"
-#include "demux/mp4/color_config.h"
+#include "iso_color_tables.h"
 
 #include <assert.h>
 
diff --git a/modules/demux/mp4/color_config.h b/modules/packetizer/iso_color_tables.h
similarity index 93%
rename from modules/demux/mp4/color_config.h
rename to modules/packetizer/iso_color_tables.h
index 00d1855db5..e75540844d 100644
--- a/modules/demux/mp4/color_config.h
+++ b/modules/packetizer/iso_color_tables.h
@@ -17,12 +17,13 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
-#ifndef VLC_MP4_COLOR_CONFIG_H_
-#define VLC_MP4_COLOR_CONFIG_H_
+#ifndef VLC_ISO_23001_8_COLOR_TABLES_H_
+#define VLC_ISO_23001_8_COLOR_TABLES_H_
 
 #include <vlc_es.h>
 
 /* no free spec, grabbed from av1 bitstream spec */
+/* superset of h26x, see T-REC H262 2007 amd2 and H264/HEVC specs */
 
 enum iso_23001_8_cp
 {
@@ -60,7 +61,7 @@ static const uint8_t iso_23001_8_cp_to_vlc_primaries_table[] =
     /* [ISO_23001_8_CP_EBU_3213]       = COLOR_PRIMARIES_EBU_3213, see below */
 };
 
-static inline uint8_t iso_23001_8_cp_to_vlc_primaries( uint8_t v )
+static inline video_color_primaries_t iso_23001_8_cp_to_vlc_primaries( uint8_t v )
 {
     if( v == ISO_23001_8_CP_EBU_3213 )
         return COLOR_PRIMARIES_EBU_3213;
@@ -115,7 +116,7 @@ static const uint8_t iso_23001_8_tc_to_vlc_xfer_table[] =
     [ISO_23001_8_TC_HLG]            = TRANSFER_FUNC_HLG,
 };
 
-static inline uint8_t iso_23001_8_tc_to_vlc_xfer( uint8_t v )
+static inline video_transfer_func_t iso_23001_8_tc_to_vlc_xfer( uint8_t v )
 {
     return v < ARRAY_SIZE(iso_23001_8_tc_to_vlc_xfer_table)
            ? iso_23001_8_tc_to_vlc_xfer_table[v]
@@ -160,11 +161,11 @@ static const uint8_t iso_23001_8_mc_to_vlc_coeffs_table[] =
     [ISO_23001_8_MC_ICTCP]       = COLOR_SPACE_UNDEF,
 };
 
-static inline uint8_t iso_23001_8_mc_to_vlc_coeffs( uint8_t v )
+static inline video_color_space_t iso_23001_8_mc_to_vlc_coeffs( uint8_t v )
 {
     return v < ARRAY_SIZE(iso_23001_8_mc_to_vlc_coeffs_table)
            ? iso_23001_8_mc_to_vlc_coeffs_table[v]
            : COLOR_SPACE_UNDEF;
 }
 
-#endif /* VLC_MP4_COLOR_CONFIG_H_ */
+#endif /* VLC_ISO_23001_8_COLOR_TABLES_H_ */



More information about the vlc-commits mailing list