[vlc-commits] packetizer: add limited reverse iso_color_tables lookup
Francois Cartegnie
git at videolan.org
Wed Oct 17 20:40:58 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 11 16:04:22 2018 +0200| [df96b6023da8bea3ca2bbf4dddefe1b52fd92929] | committer: Francois Cartegnie
packetizer: add limited reverse iso_color_tables lookup
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=df96b6023da8bea3ca2bbf4dddefe1b52fd92929
---
modules/packetizer/iso_color_tables.h | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/modules/packetizer/iso_color_tables.h b/modules/packetizer/iso_color_tables.h
index e75540844d..de9c116570 100644
--- a/modules/packetizer/iso_color_tables.h
+++ b/modules/packetizer/iso_color_tables.h
@@ -70,6 +70,17 @@ static inline video_color_primaries_t iso_23001_8_cp_to_vlc_primaries( uint8_t v
: COLOR_PRIMARIES_UNDEF;
}
+static inline enum iso_23001_8_cp vlc_primaries_to_iso_23001_8_cp( video_color_primaries_t v )
+{
+ for(size_t i=1; i<ARRAY_SIZE(iso_23001_8_cp_to_vlc_primaries_table); i++)
+ if(iso_23001_8_cp_to_vlc_primaries_table[i] == v)
+ return (enum iso_23001_8_cp) i;
+ if( v == COLOR_PRIMARIES_EBU_3213 )
+ return ISO_23001_8_CP_EBU_3213;
+ else
+ return ISO_23001_8_CP_UNSPECIFIED;
+}
+
enum iso_23001_8_tc
{
ISO_23001_8_TC_RESERVED_0 = 0,
@@ -123,6 +134,14 @@ static inline video_transfer_func_t iso_23001_8_tc_to_vlc_xfer( uint8_t v )
: TRANSFER_FUNC_UNDEF;
}
+static inline enum iso_23001_8_tc vlc_xfer_to_iso_23001_8_tc( video_transfer_func_t v )
+{
+ for(size_t i=1; i<ARRAY_SIZE(iso_23001_8_tc_to_vlc_xfer_table); i++)
+ if(iso_23001_8_tc_to_vlc_xfer_table[i] == v)
+ return (enum iso_23001_8_cp) i;
+ return ISO_23001_8_TC_UNSPECIFIED;
+}
+
enum iso_23001_8_mc
{
ISO_23001_8_MC_IDENTITY = 0,
@@ -168,4 +187,12 @@ static inline video_color_space_t iso_23001_8_mc_to_vlc_coeffs( uint8_t v )
: COLOR_SPACE_UNDEF;
}
+static inline enum iso_23001_8_mc vlc_coeffs_to_iso_23001_8_mc( video_color_space_t v )
+{
+ for(size_t i=1; i<ARRAY_SIZE(iso_23001_8_mc_to_vlc_coeffs_table); i++)
+ if(iso_23001_8_mc_to_vlc_coeffs_table[i] == v)
+ return (enum iso_23001_8_cp) i;
+ return ISO_23001_8_MC_UNSPECIFIED;
+}
+
#endif /* VLC_ISO_23001_8_COLOR_TABLES_H_ */
More information about the vlc-commits
mailing list