From: Thomas Mundt Date: Fri, 27 Jun 2014 18:12:06 +0000 (-0700) Subject: AVC-Intra: fix compatibility with Avid Transfermanager X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=450cf7ae2592ee0cb474bcefedf90c9911605e26;p=libx264 AVC-Intra: fix compatibility with Avid Transfermanager --- diff --git a/encoder/encoder.c b/encoder/encoder.c index bf96f45b..416bf0cf 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 bada400f..1a40b712 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 );