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

Francois Cartegnie git at videolan.org
Wed Aug 8 15:17:14 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Aug  8 14:25:28 2018 +0200| [e30314a439ca0f462fb3e524c6cda98b03b09065] | committer: Francois Cartegnie

packatizer: move color lookup tables for refactoring

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

 modules/demux/Makefile.am                                   |  2 +-
 modules/demux/mp4/essetup.c                                 |  2 +-
 modules/demux/mp4/heif.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 f5cd872fa3..83534711b9 100644
--- a/modules/demux/Makefile.am
+++ b/modules/demux/Makefile.am
@@ -205,9 +205,9 @@ libmp4_plugin_la_SOURCES = demux/mp4/mp4.c demux/mp4/mp4.h \
                            demux/mp4/languages.h \
                            demux/mp4/heif.c demux/mp4/heif.h \
                            demux/mp4/avci.h \
-                           demux/mp4/color_config.h \
                            demux/mp4/essetup.c demux/mp4/meta.c \
                            demux/asf/asfpacket.c demux/asf/asfpacket.h \
+                           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 463247886c..413ac3d251 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/demux/mp4/heif.c b/modules/demux/mp4/heif.c
index a8c26e7ee6..f7dffcd2a5 100644
--- a/modules/demux/mp4/heif.c
+++ b/modules/demux/mp4/heif.c
@@ -32,7 +32,7 @@
 
 #include "libmp4.h"
 #include "heif.h"
-#include "color_config.h"
+#include "../../packetizer/iso_color_tables.h"
 
 struct heif_private_t
 {
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