Ignore:
Timestamp:
4 Jul 2013, 21:00:23 (11 years ago)
Author:
tech
Message:

Integrated following changes:

  • H_MV_FIX1071, fix of encoder side reference list construction on IRAP pictures, same as in HM11.
  • H_3D_VSO_FIX_BORDRE_EXTENSION, fixed uninitialized borders for org-yuvs in VSO
  • H_MV_ENC_DEC_TRAC, added cu/pu level trace ( only enabled when ENC_DEC_TRACE is enabled)
Location:
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp

    r504 r521  
    3939#include "TEncCavlc.h"
    4040#include "SEIwrite.h"
     41#include "../TLibCommon/TypeDef.h"
    4142
    4243//! \ingroup TLibEncoder
     
    4748Void  xTraceSPSHeader (TComSPS *pSPS)
    4849{
     50#if H_MV_ENC_DEC_TRAC
     51  fprintf( g_hTrace, "=========== Sequence Parameter Set ===========\n" );
     52#else
    4953  fprintf( g_hTrace, "=========== Sequence Parameter Set ID: %d ===========\n", pSPS->getSPSId() );
     54#endif
    5055}
    5156
    5257Void  xTracePPSHeader (TComPPS *pPPS)
    5358{
     59#if H_MV_ENC_DEC_TRAC
     60  fprintf( g_hTrace, "=========== Picture Parameter Set ===========\n" );
     61#else
    5462  fprintf( g_hTrace, "=========== Picture Parameter Set ID: %d ===========\n", pPPS->getPPSId() );
     63#endif
    5564}
    5665
     
    838847    //   colour_plane_id                                      u(2)
    839848
    840 #if H_MV
     849#if H_MV && !H_MV_FIX1071
    841850    // Temporary fix for FIX1071 should be removed later
    842851    TComReferencePictureSet* rps = pcSlice->getRPS();
     
    846855      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC());
    847856      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
    848 #if !H_MV
    849       // Temporary fix for FIX1071 should be removed later
     857#if !H_MV || H_MV_FIX1071
    850858      TComReferencePictureSet* rps = pcSlice->getRPS();
    851859#endif     
    852 #if FIX1071
     860#if FIX1071 && H_MV_FIX1071
     861      // check for bitstream restriction stating that:
     862      // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     863      // Ideally this process should not be repeated for each slice in a picture
     864      if (pcSlice->isIRAP())
     865      {
     866          for (Int picIdx = 0; picIdx < rps->getNumberOfPictures(); picIdx++)
     867          {
     868          assert (!rps->getUsed(picIdx));
     869          }
     870        }
     871#endif
     872#if FIX1071 && !H_MV_FIX1071
    853873      // Deal with bitstream restriction stating that:
    854874      // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     
    872892        }
    873893      }
    874 
    875894      if(pcSlice->getRPSidx() < 0 || useAltRps)
    876895#else
     
    10091028      pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0);
    10101029    }
    1011 #if H_MV
     1030#if H_MV && !H_MV_FIX1071
    10121031    // Temporary fix for FIX1071 should be removed later
    10131032    if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList( rps ) > 1)
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp

    r510 r521  
    12231223  UInt uiBPelY   = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1;
    12241224 
     1225#if H_MV_ENC_DEC_TRAC
     1226  DTRACE_CU_S("=========== coding_quadtree ===========\n")
     1227  DTRACE_CU("x0", uiLPelX)
     1228  DTRACE_CU("x1", uiTPelY)
     1229  DTRACE_CU("log2CbSize", g_uiMaxCUWidth>>uiDepth)
     1230  DTRACE_CU("cqtDepth"  , uiDepth)
     1231#endif
     1232
    12251233  TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx());
    12261234  // If slice start is within this cu...
     
    12571265  }
    12581266 
     1267#if H_MV_ENC_DEC_TRAC
     1268  DTRACE_CU_S("=========== coding_unit ===========\n")
     1269#endif
     1270
    12591271  if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())
    12601272  {
     
    12721284  if( pcCU->isSkipped( uiAbsPartIdx ) )
    12731285  {
     1286#if H_MV_ENC_DEC_TRAC
     1287    DTRACE_PU_S("=========== prediction_unit ===========\n")
     1288    DTRACE_PU("x0", uiLPelX)
     1289    DTRACE_PU("x1", uiTPelY)
     1290#endif
    12741291    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx );
    12751292#if H_3D_IC
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncEntropy.cpp

    r504 r521  
    368368  else
    369369  {
     370#if !H_MV_ENC_DEC_TRAC
    370371    {
    371372      DTRACE_CABAC_VL( g_nSymbolCounter++ );
     
    378379      DTRACE_CABAC_T( "\n" );
    379380    }
     381#endif
    380382   
    381383    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     
    495497  for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
    496498  {
     499#if H_MV_ENC_DEC_TRAC
     500    DTRACE_PU_S("=========== prediction_unit ===========\n")
     501       //Todo:
     502      //DTRACE_PU("x0", uiLPelX)
     503      //DTRACE_PU("x1", uiTPelY)
     504#endif
    497505    encodeMergeFlag( pcCU, uiSubPartIdx );
    498506    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp

    r510 r521  
    595595    pcSlice->getRPS()->setNumberOfLongtermPictures(0);
    596596
     597#if FIX1071 && H_MV_FIX1071
     598    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP()))
     599    {
     600      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP());
     601    }
     602#else
    597603    if(pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0)
    598604    {
    599605      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS());
    600606    }
     607#endif
    601608    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
    602609
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.cpp

    r504 r521  
    439439
    440440  xWriteUnaryMaxSymbol(iSymbol, m_cMVPIdxSCModel.get(0), 1, iNum-1);
     441#if H_MV_ENC_DEC_TRAC
     442#if ENC_DEC_TRACE
     443  if ( eRefList == REF_PIC_LIST_0 )
     444  {
     445    DTRACE_PU("mvp_l0_flag", iSymbol)
     446  }
     447  else
     448  {
     449    DTRACE_PU("mvp_l1_flag", iSymbol)
     450  }
     451#endif
     452#endif
    441453}
    442454
     
    449461    {
    450462      m_pcBinIf->encodeBin( eSize == SIZE_2Nx2N? 1 : 0, m_cCUPartSizeSCModel.get( 0, 0, 0 ) );
     463#if H_MV_ENC_DEC_TRAC
     464      DTRACE_CU("part_mode", eSize == SIZE_2Nx2N? 1 : 0)
     465#endif       
    451466    }
    452467    return;
    453468  }
    454469 
     470#if H_MV_ENC_DEC_TRAC         
     471  DTRACE_CU("part_mode", eSize )
     472#endif       
    455473  switch(eSize)
    456474  {
     
    531549  Int iPredMode = pcCU->getPredictionMode( uiAbsPartIdx );
    532550  m_pcBinIf->encodeBin( iPredMode == MODE_INTER ? 0 : 1, m_cCUPredModeSCModel.get( 0, 0, 0 ) );
     551#if H_MV_ENC_DEC_TRAC
     552  DTRACE_CU("pred_mode_flag", iPredMode == MODE_INTER ? 0 : 1);
     553#endif
    533554}
    534555
     
    537558  UInt uiSymbol = pcCU->getCUTransquantBypass(uiAbsPartIdx);
    538559  m_pcBinIf->encodeBin( uiSymbol, m_CUTransquantBypassFlagSCModel.get( 0, 0, 0 ) );
     560#if H_MV_ENC_DEC_TRAC
     561  DTRACE_CU("cu_transquant_bypass_flag", uiSymbol);
     562#endif
    539563}
    540564
     
    550574  UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ) ;
    551575  m_pcBinIf->encodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) );
     576#if !H_MV_ENC_DEC_TRAC
    552577  DTRACE_CABAC_VL( g_nSymbolCounter++ );
    553578  DTRACE_CABAC_T( "\tSkipFlag" );
     
    557582  DTRACE_CABAC_V( uiSymbol );
    558583  DTRACE_CABAC_T( "\n");
     584#else
     585  DTRACE_CU("cu_skip_flag", uiSymbol);
     586#endif
    559587}
    560588
     
    569597  m_pcBinIf->encodeBin( uiSymbol, *m_cCUMergeFlagExtSCModel.get( 0 ) );
    570598
     599#if H_MV_ENC_DEC_TRAC
     600  DTRACE_PU("merge_flag", uiSymbol);
     601#else
    571602  DTRACE_CABAC_VL( g_nSymbolCounter++ );
    572603  DTRACE_CABAC_T( "\tMergeFlag: " );
     
    577608  DTRACE_CABAC_V( uiAbsPartIdx );
    578609  DTRACE_CABAC_T( "\n" );
     610#endif
    579611}
    580612
     
    606638      }
    607639    }
    608   }
     640#if H_MV_ENC_DEC_TRAC
     641    DTRACE_PU("merge_idx", uiUnaryIdx);
     642#endif
     643  }
     644#if !H_MV_ENC_DEC_TRAC
    609645  DTRACE_CABAC_VL( g_nSymbolCounter++ );
    610646  DTRACE_CABAC_T( "\tparseMergeIndex()" );
     
    612648  DTRACE_CABAC_V( pcCU->getMergeIndex( uiAbsPartIdx ) );
    613649  DTRACE_CABAC_T( "\n" );
     650#endif
    614651}
    615652
     
    628665     m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 3 ) );
    629666  }
     667#if H_MV_ENC_DEC_TRAC
     668  DTRACE_CU("iv_res_pred_weight_idx", iW);
     669#endif
    630670}
    631671#endif
     
    643683  UInt uiCtxIC  = pcCU->getCtxICFlag( uiAbsPartIdx ) ;
    644684  m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );
     685#if !H_MV_ENC_DEC_TRAC
    645686  DTRACE_CABAC_VL( g_nSymbolCounter++ );
    646687  DTRACE_CABAC_T( "\tICFlag" );
     
    650691  DTRACE_CABAC_V( uiSymbol );
    651692  DTRACE_CABAC_T( "\n");
     693#else
     694  DTRACE_CU("ic_flag", uiSymbol );
     695#endif
    652696}
    653697#endif
     
    664708  assert( uiCtx < 3 );
    665709  m_pcBinIf->encodeBin( uiCurrSplitFlag, m_cCUSplitFlagSCModel.get( 0, 0, uiCtx ) );
     710#if !H_MV_ENC_DEC_TRAC
    666711  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    667712  DTRACE_CABAC_T( "\tSplitFlag\n" )
     713#else
     714  DTRACE_CU("split_cu_flag", uiCurrSplitFlag );
     715#endif
    668716  return;
    669717}
     
    672720{
    673721  m_pcBinIf->encodeBin( uiSymbol, m_cCUTransSubdivFlagSCModel.get( 0, 0, uiCtx ) );
     722#if !H_MV_ENC_DEC_TRAC
    674723  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    675724  DTRACE_CABAC_T( "\tparseTransformSubdivFlag()" )
     
    679728  DTRACE_CABAC_V( uiCtx )
    680729  DTRACE_CABAC_T( "\n" )
     730#endif
    681731}
    682732
     
    701751    }
    702752    m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );
     753#if H_MV_ENC_DEC_TRAC
     754    DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0);
     755#endif
    703756  } 
    704757  for (j=0;j<partNum;j++)
     
    711764        m_pcBinIf->encodeBinEP( predIdx[j]-1 );
    712765      }
     766#if H_MV_ENC_DEC_TRAC
     767      DTRACE_CU("mpm_idx", predIdx[j] );
     768#endif
    713769    }
    714770    else
     
    731787      }
    732788      m_pcBinIf->encodeBinsEP( dir[j], 5 );
     789#if H_MV_ENC_DEC_TRAC
     790      DTRACE_CU("rem_intra_luma_pred_mode", dir[j] );
     791#endif
    733792    }
    734793  }
     
    743802  {
    744803    m_pcBinIf->encodeBin( 0, m_cCUChromaPredSCModel.get( 0, 0, 0 ) );
     804#if H_MV_ENC_DEC_TRAC
     805    DTRACE_CU("intra_chroma_pred_mode", 0 );
     806#endif
    745807  }
    746808  else
     
    760822
    761823    m_pcBinIf->encodeBinsEP( uiIntraDirChroma, 2 );
     824#if H_MV_ENC_DEC_TRAC
     825    DTRACE_CU("intra_chroma_pred_mode", uiIntraDirChroma );
     826#endif
     827
    762828  }
    763829  return;
     
    777843    m_pcBinIf->encodeBin( uiInterDir, *( pCtx + 4 ) );
    778844  }
     845#if H_MV_ENC_DEC_TRAC
     846  DTRACE_PU("inter_pred_idc", uiInterDir );
     847#endif
     848
    779849  return;
    780850}
     
    809879      }
    810880    }
     881#if H_MV_ENC_DEC_TRAC
     882#if ENC_DEC_TRACE
     883    iRefFrame = pcCU->getCUMvField( eRefList )->getRefIdx( uiAbsPartIdx );
     884    if ( eRefList == REF_PIC_LIST_0 )
     885    {
     886      DTRACE_PU("ref_idx_l0", iRefFrame)
     887    }
     888    else
     889    {
     890      DTRACE_PU("ref_idx_l1", iRefFrame)
     891    }
     892#endif
     893#endif
    811894  }
    812895  return;
     
    896979  UInt uiCtx = pcCU->getCtxQtCbf( eType, uiTrDepth );
    897980  m_pcBinIf->encodeBin( uiCbf , m_cCUQtCbfSCModel.get( 0, eType ? TEXT_CHROMA : eType, uiCtx ) );
     981#if !H_MV_ENC_DEC_TRAC
    898982  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    899983  DTRACE_CABAC_T( "\tparseQtCbf()" )
     
    907991  DTRACE_CABAC_V( uiAbsPartIdx )
    908992  DTRACE_CABAC_T( "\n" )
     993#endif
    909994}
    910995
     
    9221007  UInt useTransformSkip = pcCU->getTransformSkip( uiAbsPartIdx,eTType);
    9231008  m_pcBinIf->encodeBin( useTransformSkip, m_cTransformSkipSCModel.get( 0, eTType? TEXT_CHROMA: TEXT_LUMA, 0 ) );
     1009#if !H_MV_ENC_DEC_TRAC
    9241010  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    9251011  DTRACE_CABAC_T("\tparseTransformSkip()");
     
    9331019  DTRACE_CABAC_V( uiAbsPartIdx )
    9341020  DTRACE_CABAC_T( "\n" )
     1021#endif
    9351022}
    9361023
     
    9471034
    9481035  m_pcBinIf->encodeBinTrm (uiIPCM);
    949 
     1036#if H_MV_ENC_DEC_TRAC         
     1037  DTRACE_CU("pcm_flag", uiIPCM)
     1038#endif
    9501039  if (writePCMSampleFlag)
    9511040  {
     
    10171106  UInt uiCtx = 0;
    10181107  m_pcBinIf->encodeBin( uiCbf , m_cCUQtRootCbfSCModel.get( 0, 0, uiCtx ) );
     1108#if !H_MV_ENC_DEC_TRAC
    10191109  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    10201110  DTRACE_CABAC_T( "\tparseQtRootCbf()" )
     
    10261116  DTRACE_CABAC_V( uiAbsPartIdx )
    10271117  DTRACE_CABAC_T( "\n" )
     1118#else
     1119  DTRACE_CU( "rqt_root_cbf", uiCbf )
     1120#endif
    10281121}
    10291122
     
    11161209Void TEncSbac::codeCoeffNxN( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType )
    11171210{
     1211#if !H_MV_ENC_DEC_TRAC
    11181212  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    11191213  DTRACE_CABAC_T( "\tparseCoeffNxN()\teType=" )
     
    11401234  DTRACE_CABAC_V(  pcCU->getPredictionMode( uiAbsPartIdx ) )
    11411235  DTRACE_CABAC_T( "\n" )
    1142 
     1236#endif
    11431237  if( uiWidth > m_pcSlice->getSPS()->getMaxTrSize() )
    11441238  {
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp

    r504 r521  
    13321332  DTRACE_CABAC_T( "\tPOC: " );
    13331333  DTRACE_CABAC_V( rpcPic->getPOC() );
     1334#if H_MV_ENC_DEC_TRAC
     1335  DTRACE_CABAC_T( " Layer: " );
     1336  DTRACE_CABAC_V( rpcPic->getLayerId() );
     1337#endif
    13341338  DTRACE_CABAC_T( "\n" );
    13351339#if ENC_DEC_TRACE
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp

    r479 r521  
    507507  // mark it should be extended
    508508  rpcPic->getPicYuvRec()->setBorderExtension(false);
     509#if H_3D_VSO_FIX_BORDRE_EXTENSION
     510  rpcPic->getPicYuvOrg()->setBorderExtension(false);
     511#endif
    509512}
    510513
Note: See TracChangeset for help on using the changeset viewer.