[bTSstream-devel] mp2v: add colorspace fields

Christophe Massiot git at videolan.org
Tue Apr 7 22:30:02 CEST 2015


bitstream | branch: master | Christophe Massiot <cmassiot at openheadend.tv> | Tue Apr  7 22:29:42 2015 +0200| [f430ee1866f632adf92124583ad99c9d62561b43] | committer: Christophe Massiot

mp2v: add colorspace fields

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

 mpeg/mp2v.h |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/mpeg/mp2v.h b/mpeg/mp2v.h
index e52b25e..9289877 100644
--- a/mpeg/mp2v.h
+++ b/mpeg/mp2v.h
@@ -454,6 +454,48 @@ static inline bool mp2vseqdx_get_color(const uint8_t *p_mp2vseqdx)
     return !!(p_mp2vseqdx[4] & 0x1);
 }
 
+static inline void mp2vseqdx_set_primaries(uint8_t *p_mp2vseqdx,
+                                                 uint8_t i_primaries)
+{
+    mp2vseqdx_set_color(p_mp2vseqdx);
+    p_mp2vseqdx[5] = i_primaries;
+}
+
+static inline uint8_t mp2vseqdx_get_primaries(const uint8_t *p_mp2vseqdx)
+{
+    if (!mp2vseqdx_get_color(p_mp2vseqdx))
+        return 1;
+    return p_mp2vseqdx[5];
+}
+
+static inline void mp2vseqdx_set_transfer(uint8_t *p_mp2vseqdx,
+                                          uint8_t i_transfer)
+{
+    mp2vseqdx_set_color(p_mp2vseqdx);
+    p_mp2vseqdx[6] = i_transfer;
+}
+
+static inline uint8_t mp2vseqdx_get_transfer(const uint8_t *p_mp2vseqdx)
+{
+    if (!mp2vseqdx_get_color(p_mp2vseqdx))
+        return 1;
+    return p_mp2vseqdx[6];
+}
+
+static inline void mp2vseqdx_set_matrixcoeffs(uint8_t *p_mp2vseqdx,
+                                              uint8_t i_matrixcoeffs)
+{
+    mp2vseqdx_set_color(p_mp2vseqdx);
+    p_mp2vseqdx[7] = i_matrixcoeffs;
+}
+
+static inline uint8_t mp2vseqdx_get_matrixcoeffs(const uint8_t *p_mp2vseqdx)
+{
+    if (!mp2vseqdx_get_color(p_mp2vseqdx))
+        return 1;
+    return p_mp2vseqdx[7];
+}
+
 static inline void mp2vseqdx_set_horizontal(uint8_t *p_mp2vseqdx,
                                             uint16_t i_horizontal)
 {



More information about the biTStream-devel mailing list