Changeset 475 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
15 Nov 2013, 14:55:37 (11 years ago)
Author:
nokia
Message:

Integrate auxiliary picture layers (JCTVC-O0041)

Location:
branches/SHM-4.0-dev/source/Lib/TLibDecoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r468 r475  
    602602  {
    603603#endif
     604#if AUXILIARY_PICTURES
     605    READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) );
     606#else
    604607    READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     608#endif
    605609    assert(uiCode <= 3);
    606610    // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
     
    10491053    {
    10501054      READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode);
     1055#if !AUXILIARY_PICTURES
    10511056      assert( uiCode <= vps->getMaxLayerId() );
     1057#endif
    10521058    }
    10531059  }
     
    13061312{
    13071313  UInt uiCode;
     1314#if AUXILIARY_PICTURES
     1315  READ_CODE( 2, uiCode, "chroma_format_idc" );               repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) );
     1316#else
    13081317  READ_CODE( 2, uiCode, "chroma_format_idc" );               repFormat->setChromaFormatVpsIdc( uiCode );
    1309 
     1318#endif
     1319 
    13101320  if( repFormat->getChromaFormatVpsIdc() == 3 )
    13111321  {
     
    18081818    {
    18091819      READ_FLAG(uiCode, "slice_sao_luma_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
     1820#if AUXILIARY_PICTURES
     1821      ChromaFormat format;
     1822#if REPN_FORMAT_IN_VPS
     1823      if( ( sps->getLayerId() == 0 ) || sps->getUpdateRepFormatFlag() )
     1824      {
     1825        format = sps->getChromaFormatIdc();
     1826      }
     1827      else
     1828      {
     1829        format = rpcSlice->getVPS()->getVpsRepFormat( rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc();
     1830      }
     1831#else
     1832      format = sps->getChromaFormatIdc();
     1833#endif
     1834      if (format != CHROMA_400)
     1835      {
     1836#endif
    18101837      READ_FLAG(uiCode, "slice_sao_chroma_flag");  rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode);
     1838#if AUXILIARY_PICTURES
     1839      }
     1840      else
     1841      {
     1842        rpcSlice->setSaoEnabledFlagChroma(false);
     1843      }
     1844#endif
    18111845    }
    18121846
     
    24112445
    24122446  Int iDeltaDenom;
     2447#if AUXILIARY_PICTURES
     2448  if (pcSlice->getChromaFormatIdc() == CHROMA_400)
     2449  {
     2450    bChroma = false;
     2451  }
     2452#endif
    24132453  // decode delta_luma_log2_weight_denom :
    24142454  READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" );     // ue(v): luma_log2_weight_denom
     
    24302470
    24312471      wp[0].uiLog2WeightDenom = uiLog2WeightDenomLuma;
     2472#if AUXILIARY_PICTURES
     2473      if (!bChroma)
     2474      {
     2475        wp[1].uiLog2WeightDenom = 0;
     2476        wp[2].uiLog2WeightDenom = 0;
     2477      }
     2478      else
     2479      {
     2480#endif
    24322481      wp[1].uiLog2WeightDenom = uiLog2WeightDenomChroma;
    24332482      wp[2].uiLog2WeightDenom = uiLog2WeightDenomChroma;
     2483#if AUXILIARY_PICTURES
     2484      }
     2485#endif
    24342486
    24352487      UInt  uiCode;
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r442 r475  
    356356    uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;
    357357    uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();
     358#if AUXILIARY_PICTURES
     359    ChromaFormat format = pcCU->getSlice()->getChromaFormatIdc();
     360    UInt uiGrayVal = 1 << (uiSampleBits - 1);
     361#endif
    358362
    359363    for(uiY = 0; uiY < uiHeight; uiY++)
     
    362366      {
    363367        UInt uiSample;
     368#if AUXILIARY_PICTURES
     369        if (format == CHROMA_400)
     370          uiSample = uiGrayVal;
     371        else
     372#endif
    364373        m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample);
    365374        piPCMSample[uiX] = uiSample;
     
    378387      {
    379388        UInt uiSample;
     389#if AUXILIARY_PICTURES
     390        if (format == CHROMA_400)
     391          uiSample = uiGrayVal;
     392        else
     393#endif
    380394        m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample);
    381395        piPCMSample[uiX] = uiSample;
     
    665679  UInt uiSymbol;
    666680
     681#if AUXILIARY_PICTURES
     682  if ( pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 )
     683  {
     684    uiSymbol = DC_IDX;
     685  }
     686  else
     687  {
     688#endif
    667689  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUChromaPredSCModel.get( 0, 0, 0 ) );
    668690
     
    681703    }
    682704  }
     705#if AUXILIARY_PICTURES
     706  }
     707#endif
    683708  pcCU->setChromIntraDirSubParts( uiSymbol, uiAbsPartIdx, uiDepth );
    684709  return;
     
    885910  UInt uiSymbol;
    886911  const UInt uiCtx = pcCU->getCtxQtCbf( eType, uiTrDepth );
     912#if AUXILIARY_PICTURES
     913  if (pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 && (eType == TEXT_CHROMA_U || eType == TEXT_CHROMA_V))
     914  {
     915    uiSymbol = 0;
     916  }
     917  else
     918  {
     919#endif
    887920  m_pcTDecBinIf->decodeBin( uiSymbol , m_cCUQtCbfSCModel.get( 0, eType ? TEXT_CHROMA: eType, uiCtx ) );
     921#if AUXILIARY_PICTURES
     922  }
     923#endif
    888924 
    889925  DTRACE_CABAC_VL( g_nSymbolCounter++ )
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r464 r475  
    179179
    180180        m_cIlpPic[j] = new  TComPic;
     181#if AUXILIARY_PICTURES
     182#if REPN_FORMAT_IN_VPS
     183#if SVC_UPSAMPLING
     184        m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true);
     185#else
     186        m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     187#endif
     188#else
     189#if SVC_UPSAMPLING
     190        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true);
     191#else
     192        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     193#endif
     194#endif
     195#else
    181196#if REPN_FORMAT_IN_VPS
    182197#if SVC_UPSAMPLING
     
    190205#else
    191206        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     207#endif
    192208#endif
    193209#endif
     
    291307#endif
    292308   
     309#if AUXILIARY_PICTURES
     310#if REPN_FORMAT_IN_VPS
     311#if SVC_UPSAMPLING
     312    rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     313                     conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     314#else
     315    rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     316                     conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     317#endif
     318#else
     319#if SVC_UPSAMPLING
     320    rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     321                     conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     322#else
     323    rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     324                     conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     325#endif
     326#endif
     327#else
    293328#if REPN_FORMAT_IN_VPS
    294329#if SVC_UPSAMPLING
     
    308343#endif
    309344#endif
     345#endif
    310346
    311347    rpcPic->getPicSym()->allocSaoParam(&m_cSAO);
     
    348384  rpcPic->destroy();
    349385
     386#if AUXILIARY_PICTURES
     387#if REPN_FORMAT_IN_VPS
     388#if SVC_UPSAMPLING
     389  rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     390                   conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     391
     392#else
     393  rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     394                   conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     395#endif
     396#else
     397#if SVC_UPSAMPLING
     398  rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     399                   conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     400
     401#else
     402  rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     403                   conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     404#endif
     405#endif
     406#else
    350407#if REPN_FORMAT_IN_VPS
    351408#if SVC_UPSAMPLING
     
    365422  rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    366423                   conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     424#endif
    367425#endif
    368426#endif
     
    15261584          Window &conformanceWindow = sps->getConformanceWindow();
    15271585          Window defaultDisplayWindow = sps->getVuiParametersPresentFlag() ? sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
     1586#if AUXILIARY_PICTURES
    15281587#if SVC_UPSAMPLING
    15291588#if AVC_SYNTAX
    1530 
     1589          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);
     1590#else
     1591          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);
     1592#endif
     1593#else
     1594          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);
     1595#endif
     1596#else
     1597#if SVC_UPSAMPLING
     1598#if AVC_SYNTAX
    15311599          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);
    15321600#else
     
    15351603#else
    15361604          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);
     1605#endif
    15371606#endif
    15381607        }
Note: See TracChangeset for help on using the changeset viewer.