[vlc-commits] demux: libmp4: SmDm is fixed point

Francois Cartegnie git at videolan.org
Wed Aug 22 11:32:37 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Aug 22 10:43:14 2018 +0200| [206d0a9b2bbf589c6f51acd6f07cbf595c61d7f0] | committer: Francois Cartegnie

demux: libmp4: SmDm is fixed point

(cherry picked from commit dcb0c69563163968c2538504d9f619ab69fe44be)

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

 modules/demux/mp4/libmp4.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index b71abf8739..6f068e1242 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2008,11 +2008,21 @@ static int MP4_ReadBox_SmDm( stream_t *p_stream, MP4_Box_t *p_box )
 
     const uint8_t RGB2GBR[3] = {2,0,1};
     for(int i=0; i<6; i++)
+    {
         MP4_GET2BYTES( p_SmDm->primaries[RGB2GBR[i/2] + i%2] );
+        p_SmDm->primaries[index] = 50000 * (double)p_SmDm->primaries[index] / (double)(1<<16);
+    }
+
     for(int i=0; i<2; i++)
+    {
         MP4_GET2BYTES( p_SmDm->white_point[i] );
+        p_SmDm->white_point[i] = 50000 * (double)p_SmDm->white_point[i] / (double)(1<<16);
+    }
+
     MP4_GET4BYTES( p_SmDm->i_luminanceMax );
     MP4_GET4BYTES( p_SmDm->i_luminanceMin );
+    p_SmDm->i_luminanceMax = 10000 * (double)p_SmDm->i_luminanceMax / (double) (1<<8);
+    p_SmDm->i_luminanceMin = 10000 * (double)p_SmDm->i_luminanceMin / (double) (1<<14);
 
     MP4_READBOX_EXIT( 1 );
 }



More information about the vlc-commits mailing list