Added tk->visual_w and tk->visual_h variables, specifying the track's visual presenta...
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Wed, 9 Feb 2005 10:08:48 +0000 (10:08 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Wed, 9 Feb 2005 10:08:48 +0000 (10:08 +0000)
mj2/mj2.c
mj2/mj2.h

index 74418cf09204900f641d0b7a9e94e0f85148a93f..e76c3cacc39728cf04035ed296a674ba60f421ff 100644 (file)
--- a/mj2/mj2.c
+++ b/mj2/mj2.c
@@ -255,6 +255,8 @@ int mj2_init_stdmovie(mj2_movie_t * movie)
       tk->vsub = 2;            /* 4:2:0                                                      */
       tk->hoff = 0;
       tk->voff = 0;
+      tk->visual_w = tk->w << 16;
+      tk->visual_h = tk->h << 16;
     }
   }
   return 0;
@@ -2286,9 +2288,9 @@ void mj2_write_tkhd(mj2_tk_t * tk)
   cio_write(tk->trans_matrix[7], 4);
   cio_write(tk->trans_matrix[8], 4);
 
-  cio_write(tk->w << 16, 4);   /* Video Width  */
+  cio_write(tk->visual_w, 4);  /* Video Visual Width  */
 
-  cio_write(tk->h << 16, 4);   /* Video Height */
+  cio_write(tk->visual_h, 4);  /* Video Visual Height */
 
   box.length = cio_tell() - box.init_pos;
   cio_seek(box.init_pos);
@@ -2358,9 +2360,9 @@ int mj2_read_tkhd(mj2_tk_t * tk)
   tk->trans_matrix[7] = cio_read(4);
   tk->trans_matrix[8] = cio_read(4);
 
-  tk->w = cio_read(4) >> 16;   /* Video Width  */
+  tk->visual_w = cio_read(4);  /* Video Visual Width  */
 
-  tk->h = cio_read(4) >> 16;   /* Video Height */
+  tk->visual_h = cio_read(4);  /* Video Visual Height */
 
   if (cio_tell() - box.init_pos != box.length) {
     fprintf(stderr, "Error with TKHD Box size\n");
index d200d0984aacfc1340d31955f96b6bdfa36ebede..0ba4897d2f57794f06715d79878df65a77a467fe 100644 (file)
--- a/mj2/mj2.h
+++ b/mj2/mj2.h
@@ -88,6 +88,8 @@ typedef struct {              /* Video Track Parameters    */
   int Dim[2];
   int w;
   int h;
+  int visual_w;
+  int visual_h;
   int CbCr_subsampling_dx;
   int CbCr_subsampling_dy;
  // int subsampling_dx;