[x264-devel] AVC-Intra: fix compatibility with Avid Transfermanager

Thomas Mundt git at videolan.org
Sun Jul 20 11:58:29 CEST 2014


x264 | branch: master | Thomas Mundt <loudmax at yahoo.de> | Fri Jun 27 11:12:06 2014 -0700| [450cf7ae2592ee0cb474bcefedf90c9911605e26] | committer: Fiona Glaser

AVC-Intra: fix compatibility with Avid Transfermanager

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=450cf7ae2592ee0cb474bcefedf90c9911605e26
---

 encoder/encoder.c |   25 +++++++++++++++++++++++--
 encoder/set.c     |    8 ++++++--
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index bf96f45..416bf0c 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -1403,7 +1403,11 @@ x264_t *x264_encoder_open( x264_param_t *param )
     /* Init x264_t */
     h->i_frame = -1;
     h->i_frame_num = 0;
-    h->i_idr_pic_id = 0;
+
+    if( h->param.i_avcintra_class )
+        h->i_idr_pic_id = 5;
+    else
+        h->i_idr_pic_id = 0;
 
     if( (uint64_t)h->param.i_timebase_den * 2 > UINT32_MAX )
     {
@@ -2455,7 +2459,24 @@ static inline void x264_slice_init( x264_t *h, int i_nal_type, int i_global_qp )
         x264_slice_header_init( h, &h->sh, h->sps, h->pps, h->i_idr_pic_id, h->i_frame_num, i_global_qp );
 
         /* alternate id */
-        h->i_idr_pic_id ^= 1;
+        if( h->param.i_avcintra_class )
+        {
+            switch( h->i_idr_pic_id )
+            {
+                case 5:
+                    h->i_idr_pic_id = 3;
+                    break;
+                case 3:
+                    h->i_idr_pic_id = 4;
+                    break;
+                case 4:
+                default:
+                    h->i_idr_pic_id = 5;
+                    break;
+            }
+        }
+        else
+            h->i_idr_pic_id ^= 1;
     }
     else
     {
diff --git a/encoder/set.c b/encoder/set.c
index bada400..1a40b71 100644
--- a/encoder/set.c
+++ b/encoder/set.c
@@ -742,11 +742,15 @@ int x264_sei_avcintra_umid_write( x264_t *h, bs_t *s )
     data[20] = 0x13;
     /* These bytes appear to be some sort of frame/seconds counter in certain applications,
      * but others jump around, so leave them as zero for now */
-    data[21] = data[22] = 0;
-
+    data[22] = data[23] = data[25] = data[26] = 0;
     data[28] = 0x14;
+    data[30] = data[31] = data[33] = data[34] = 0;
     data[36] = 0x60;
     data[41] = 0x22; /* Believed to be some sort of end of basic UMID identifier */
+    data[60] = 0x62;
+    data[62] = data[63] = data[65] = data[66] = 0;
+    data[68] = 0x63;
+    data[70] = data[71] = data[73] = data[74] = 0;
 
     x264_sei_write( &h->out.bs, data, len, SEI_USER_DATA_UNREGISTERED );
 



More information about the x264-devel mailing list