Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecCu.cpp


Ignore:
Timestamp:
20 Feb 2013, 22:07:43 (12 years ago)
Author:
tech
Message:

Reintegrated branch 5.1-dev0 rev. 295.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r189 r296  
    5454  m_ppcYuvResi = NULL;
    5555  m_ppcYuvReco = NULL;
    56 #if HHI_INTER_VIEW_RESIDUAL_PRED
     56#if H3D_IVRP
    5757  m_ppcYuvResPred = NULL;
    5858#endif
     
    8282  m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1];
    8383  m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
    84 #if HHI_INTER_VIEW_RESIDUAL_PRED
     84#if H3D_IVRP
    8585  m_ppcYuvResPred = new TComYuv*   [m_uiMaxDepth-1];
    8686#endif
     
    9696    m_ppcYuvResi[ui] = new TComYuv;    m_ppcYuvResi[ui]->create( uiWidth, uiHeight );
    9797    m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight );
    98 #if HHI_INTER_VIEW_RESIDUAL_PRED
     98#if H3D_IVRP
    9999    m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
    100100#endif
     
    120120    m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL;
    121121    m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
    122 #if HHI_INTER_VIEW_RESIDUAL_PRED
     122#if H3D_IVRP
    123123    m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
    124124#endif
     
    128128  delete [] m_ppcYuvResi; m_ppcYuvResi = NULL;
    129129  delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
    130 #if HHI_INTER_VIEW_RESIDUAL_PRED
     130#if H3D_IVRP
    131131  delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
    132132#endif
     
    148148  }
    149149
    150 #if BURST_IPCM
    151150  pcCU->setNumSucIPCM(0);
    152 #endif
    153151
    154152  // start from the top level CU
     
    240238  if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) )
    241239  {
    242 #if BURST_IPCM
    243240    if(pcCU->getNumSucIPCM() == 0)
    244241    {
     
    252249      pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx );
    253250    }
    254 #else
    255 #if HHI_MPI
    256     if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) )
    257 #endif
    258     m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
    259 #endif
    260251  }
    261252  else
     
    323314
    324315  // decode CU mode and the partition size
    325 #if BURST_IPCM
    326316  if( !pcCU->getSlice()->isIntra() && pcCU->getNumSucIPCM() == 0 )
    327 #else
    328   if( !pcCU->getSlice()->isIntra() )
    329 #endif
    330317#if HHI_MPI
    331318  if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 )
     
    339326    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    340327    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
    341 #if HHI_INTER_VIEW_MOTION_PRED
     328#if H3D_IVMP
    342329    TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    343330    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
     
    361348
    362349      UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
     350
    363351      for( UInt ui = 0; ui < uiCurrPartNumb; ui++ )
    364352      {
    365353        const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) );
     354#if MERL_VSP_C0152
     355        Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui);
     356        pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx);
     357#endif
    366358        pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP );
    367359        pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N );
     
    370362        pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth );
    371363      }
     364#if LGE_ILLUCOMP_DEPTH_C0046
     365      m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     366#endif
    372367    }
    373368    else
    374369    {
    375370#endif
    376 #if SIMP_MRG_PRUN     
    377371    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
     372#if MERL_VSP_C0152
     373    Int iVSPIndexTrue[3] = {-1, -1, -1};
     374    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
     375    {
     376      Int iVSPIdx = 0;
     377      Int numVspIdx;
     378      numVspIdx = 3;
     379      for (Int i = 0; i < numVspIdx; i++)
     380      {
     381        if (iVSPIndexTrue[i] == uiMergeIndex)
     382          {
     383            iVSPIdx = i+1;
     384            break;
     385          }
     386      }
     387      pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth );  //Initialize the VSP, may change later in get InterMergeCandidates()
     388    }
     389#else
    378390    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    379 #else
    380     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    381     UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    382391#endif
    383392    pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
     
    400409    }
    401410#endif
    402 #if HHI_INTER_VIEW_RESIDUAL_PRED
     411#if H3D_IVRP && !MTK_MDIVRP_C0138
    403412    m_pcEntropyDecoder->decodeResPredFlag( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 );
    404413#endif
     
    411420  {
    412421#endif
    413 #if BURST_IPCM
    414422  if( pcCU->getNumSucIPCM() == 0 )
    415423  {
     
    424432    pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
    425433  }
    426 #else
    427   m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
    428   m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
    429 #endif
    430434
    431435  if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
     
    449453 
    450454#if LGE_ILLUCOMP_B0045
     455#if LGE_ILLUCOMP_DEPTH_C0046 && HHI_MPI
     456  if( pcCU->getTextureModeDepth( uiAbsPartIdx ) != uiDepth )
     457  {
     458#endif
    451459  m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    452460#endif
    453461
    454 #if HHI_INTER_VIEW_RESIDUAL_PRED
     462#if H3D_IVRP && !MTK_MDIVRP_C0138
    455463  if( !pcCU->isIntra( uiAbsPartIdx ) )
    456464  {
    457465    m_pcEntropyDecoder->decodeResPredFlag    ( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 );
     466  }
     467#endif
     468#if LGE_ILLUCOMP_DEPTH_C0046 && HHI_MPI
    458469  }
    459470#endif
     
    467478
    468479      UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
     480
    469481      for( UInt ui = 0; ui < uiCurrPartNumb; ui++ )
    470482      {
    471483        const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) );
     484#if MERL_VSP_C0152
     485        Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui);
     486        pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx);
     487#endif
    472488        pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER );
    473489        pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N );
     
    476492        pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth );
    477493      }
    478 
     494#if LGE_ILLUCOMP_DEPTH_C0046
     495      m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     496#endif
    479497      if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary )
    480498      {
     
    551569  }
    552570
    553 #if BURST_IPCM
    554571  if( pcCU->getNumSucIPCM() > 0 )
    555572  {
     
    557574    return;
    558575  }
    559 #endif
    560576
    561577  ruiIsLast = xDecodeSliceEnd( pcCU, uiAbsPartIdx, uiDepth);
     
    658674 
    659675  // inter prediction
     676#if MERL_VSP_C0152
     677  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth], uiAbsPartIdx );
     678#else
    660679  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    661  
     680#endif
     681#if MTK_MDIVRP_C0138
     682  if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
     683  {
     684    m_pcPrediction->residualPrediction(pcCU, m_ppcYuvReco[uiDepth], m_ppcYuvResPred[uiDepth]);
     685  }
     686#endif
     687
    662688#if HHI_MPI
    663689  if( pcCU->getTextureModeDepth( 0 ) != -1 )
     
    665691#endif
    666692
    667 #if HHI_INTER_VIEW_RESIDUAL_PRED
     693#if H3D_IVRP && !MTK_MDIVRP_C0138
    668694  if( pcCU->getResPredFlag( 0 ) )
    669695  {
     
    695721  else
    696722  {
    697 #if HHI_INTER_VIEW_RESIDUAL_PRED
     723#if H3D_IVRP
     724#if MTK_MDIVRP_C0138
     725    if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
     726#else
    698727    if( pcCU->getResPredFlag( 0 ) )
     728#endif
    699729    {
    700730      m_ppcYuvReco[uiDepth]->clip( pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
     
    765795 
    766796  //===== inverse transform =====
    767 #if H0736_AVC_STYLE_QP_RANGE
    768797  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 );
    769 #else
    770   m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 );
    771 #endif
    772798
    773799  Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA];
     
    885911  if(eText == TEXT_CHROMA_U)
    886912  {
    887 #if H0736_AVC_STYLE_QP_RANGE
    888913    m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() );
    889 #else
    890     m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset() );
    891 #endif
    892914  }
    893915  else
    894916  {
    895 #if H0736_AVC_STYLE_QP_RANGE
    896917    m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );
    897 #else
    898     m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );
    899 #endif
    900918  }
    901919
     
    11971215  pResi = m_ppcYuvResi[uiDepth]->getLumaAddr();
    11981216
    1199 #if H0736_AVC_STYLE_QP_RANGE
    12001217  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 );
    1201 #else
    1202   m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 );
    1203 #endif
    12041218
    12051219  m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff );
    12061220 
    12071221  // Cb and Cr
    1208 #if H0736_AVC_STYLE_QP_RANGE
    12091222  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() );
    1210 #else
    1211   m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset() );
    1212 #endif
    12131223
    12141224  uiWidth  >>= 1;
     
    12171227  m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff );
    12181228
    1219 #if H0736_AVC_STYLE_QP_RANGE
    12201229  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );
    1221 #else
    1222   m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );
    1223 #endif
    12241230
    12251231  piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr();
     
    13751381  Int iSumPix[2];
    13761382  memset(iSumPix, 0, sizeof(Int)*2);
    1377  
     1383#if HS_REFERENCE_SUBSAMPLE_C0154
     1384  Int subSamplePix;
     1385  if ( uiSize == 64 || uiSize == 32 )
     1386  {
     1387    subSamplePix = 2;
     1388  }
     1389  else
     1390  {
     1391    subSamplePix = 1;
     1392  }
     1393  for (Int y=0; y<uiSize; y+=subSamplePix)
     1394  {
     1395    for (Int x=0; x<uiSize; x+=subSamplePix)
     1396    {
     1397      UChar ucSegment = pMask?(UChar)pMask[x]:0;
     1398      assert( ucSegment < uiNumSegments );
     1399 
     1400      iSumDepth[ucSegment] += pOrig[x];
     1401      iSumPix[ucSegment]   += 1;
     1402    }
     1403    pOrig  += uiStride*subSamplePix;
     1404    pMask  += uiMaskStride*subSamplePix;
     1405  }
     1406#else
    13781407  for (Int y=0; y<uiSize; y++)
    13791408  {
     
    13901419    pMask  += uiMaskStride;
    13911420  }
    1392  
     1421#endif
    13931422  // compute mean for each segment
    13941423  for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ )
Note: See TracChangeset for help on using the changeset viewer.