Ticket #1193: bp_sei_fix.patch

File bp_sei_fix.patch, 2.4 KB (added by o.nakagami, 10 years ago)
  • source/Lib/TLibDecoder/SEIread.cpp

     
    444444  {
    445445    READ_FLAG( code, "rap_cpb_params_present_flag" );                   sei.m_rapCpbParamsPresentFlag = code;
    446446  }
     447  if( sei.m_rapCpbParamsPresentFlag )
     448  {
     449    READ_CODE( pHRD->getCpbRemovalDelayLengthMinus1() + 1, code, "cpb_delay_offset" );      sei.m_cpbDelayOffset = code;
     450    READ_CODE( pHRD->getDpbOutputDelayLengthMinus1()  + 1, code, "dpb_delay_offset" );      sei.m_dpbDelayOffset = code;
     451  }
    447452  //read splicing flag and cpb_removal_delay_delta
    448453  READ_FLAG( code, "concatenation_flag");
    449454  sei.m_concatenationFlag = code;
    450455  READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" );
    451456  sei.m_auCpbRemovalDelayDelta = code + 1;
    452   if( sei.m_rapCpbParamsPresentFlag )
    453   {
    454     READ_CODE( pHRD->getCpbRemovalDelayLengthMinus1() + 1, code, "cpb_delay_offset" );      sei.m_cpbDelayOffset = code;
    455     READ_CODE( pHRD->getDpbOutputDelayLengthMinus1()  + 1, code, "dpb_delay_offset" );      sei.m_dpbDelayOffset = code;
    456   }
    457457  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    458458  {
    459459    if( ( ( nalOrVcl == 0 ) && ( pHRD->getNalHrdParametersPresentFlag() ) ) ||
  • source/Lib/TLibEncoder/SEIwrite.cpp

     
    308308  {
    309309    WRITE_FLAG( sei.m_rapCpbParamsPresentFlag, "rap_cpb_params_present_flag" );
    310310  }
    311   WRITE_FLAG( sei.m_concatenationFlag, "concatenation_flag");
    312   WRITE_CODE( sei.m_auCpbRemovalDelayDelta - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_delta_minus1" );
    313311  if( sei.m_rapCpbParamsPresentFlag )
    314312  {
    315313    WRITE_CODE( sei.m_cpbDelayOffset, hrd->getCpbRemovalDelayLengthMinus1() + 1, "cpb_delay_offset" );
    316314    WRITE_CODE( sei.m_dpbDelayOffset, hrd->getDpbOutputDelayLengthMinus1()  + 1, "dpb_delay_offset" );
    317315  }
     316  WRITE_FLAG( sei.m_concatenationFlag, "concatenation_flag");
     317  WRITE_CODE( sei.m_auCpbRemovalDelayDelta - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_delta_minus1" );
    318318  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    319319  {
    320320    if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) ||