Ignore:
Timestamp:
16 Jun 2015, 04:13:09 (9 years ago)
Author:
mediatek-htm
Message:

The reactivation of depth intra skip mode (DIS), the MACRO is "NH_3D_DIS".

by Yi-Wen Chen (yiwen.chen@…)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp

    r1227 r1258  
    739739    }
    740740#endif
    741 #if H_3D
     741#if NH_3D_DIS
    742742    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
    743743    if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() )
     
    15831583  }
    15841584
    1585 #if H_3D
     1585#if NH_3D_DIS
    15861586  m_pcEntropyCoder->encodeDIS( pcCU, uiAbsPartIdx );
    15871587  if(!pcCU->getDISFlag(uiAbsPartIdx))
     
    16281628  setCodeChromaQpAdjFlag( codeChromaQpAdj );
    16291629  setdQPFlag( bCodeDQP );
    1630 #if H_3D
     1630#if NH_3D_DIS
    16311631  }
    16321632#endif
     
    20212021            mergeCandBuffer[uiMergeCand] = 1;
    20222022          }
    2023 #if H_3D
     2023#if NH_3D_DIS
    20242024          rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
    20252025#endif
     
    20632063              }
    20642064              rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
    2065 #if H_3D
     2065#if NH_3D_DIS
    20662066              rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
    20672067#endif
     
    22142214      }
    22152215#endif
    2216 #if H_3D
     2216#if NH_3D_DIS
    22172217      rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
    22182218#endif
     
    23312331          }
    23322332          rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
    2333 #if H_3D
     2333#if NH_3D_DIS
    23342334          rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
    23352335#endif
     
    24402440    pMask   += 2*uiMaskStride;
    24412441  }
    2442 }
    2443 
    2444 Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
    2445 {
    2446   UInt uiDepth = rpcTempCU->getDepth( 0 );
    2447   if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
    2448   {
    2449     return;
    2450   }
    2451 
    2452 #if NH_3D_VSO // M5
    2453   if( m_pcRdCost->getUseRenModel() )
    2454   {
    2455     UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ( COMPONENT_Y );
    2456     UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ( COMPONENT_Y );
    2457     Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getAddr    ( COMPONENT_Y );
    2458     UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ( COMPONENT_Y );
    2459     m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    2460   }
    2461 #endif
    2462 
    2463   rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
    2464   rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
    2465   rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
    2466   rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
    2467 
    2468   rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
    2469   rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth);
    2470   rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
    2471   rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
    2472 #if NH_3D_SDC_INTRA
    2473   rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
    2474 #endif
    2475 
    2476   UInt uiPreCalcDistC;
    2477   m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
    2478 
    2479 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
    2480   Int oldTraceCopyBack = g_traceCopyBack;
    2481   g_traceCopyBack = false; 
    2482 #endif
    2483   m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
    2484   #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 
    2485     g_traceCopyBack = oldTraceCopyBack;
    2486   #endif
    2487 
    2488 
    2489   m_pcEntropyCoder->resetBits();
    2490   if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
    2491   {
    2492     m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
    2493   }
    2494   m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
    2495   m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
    2496 
    2497 
    2498   m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    2499 
    2500   rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
    2501   rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
    2502 
    2503 
    2504 #if NH_3D_VSO // M6
    2505   if( m_pcRdCost->getUseLambdaScaleVSO())
    2506   {
    2507     rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 
    2508   }
    2509   else
    2510 #endif
    2511     rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    2512 
    2513 
    2514   xCheckDQP( rpcTempCU );
    2515   xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
    25162442}
    25172443
     
    26512577}
    26522578#endif
    2653 
     2579#if NH_3D_DIS
     2580Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     2581{
     2582  UInt uiDepth = rpcTempCU->getDepth( 0 );
     2583  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
     2584  {
     2585    return;
     2586  }
     2587
     2588#if NH_3D_VSO // M5
     2589  if( m_pcRdCost->getUseRenModel() )
     2590  {
     2591    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ( COMPONENT_Y );
     2592    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ( COMPONENT_Y );
     2593    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getAddr    ( COMPONENT_Y );
     2594    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ( COMPONENT_Y );
     2595    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     2596  }
     2597#endif
     2598
     2599  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2600  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     2601  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
     2602  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
     2603
     2604  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
     2605  rpcTempCU->setCbfSubParts(0, COMPONENT_Y, 0, uiDepth);
     2606  rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
     2607  rpcTempCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, DC_IDX, 0, uiDepth);
     2608#if NH_3D_SDC_INTRA
     2609  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
     2610#endif
     2611
     2612  UInt uiPreCalcDistC;
     2613  m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
     2614
     2615#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     2616  Int oldTraceCopyBack = g_traceCopyBack;
     2617  g_traceCopyBack = false; 
     2618#endif
     2619  m_ppcRecoYuvTemp[uiDepth]->copyToPicComponent(COMPONENT_Y, rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getCtuRsAddr(), rpcTempCU->getZorderIdxInCtu() );
     2620#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 
     2621  g_traceCopyBack = oldTraceCopyBack;
     2622#endif
     2623
     2624  m_pcEntropyCoder->resetBits();
     2625  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     2626  {
     2627    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
     2628  }
     2629  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2630  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
     2631
     2632  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
     2633
     2634  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
     2635  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
     2636
     2637#if NH_3D_VSO // M6
     2638  if( m_pcRdCost->getUseLambdaScaleVSO())
     2639  {
     2640    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 
     2641  }
     2642  else
     2643#endif
     2644  rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
     2645
     2646  xCheckDQP( rpcTempCU );
     2647  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
     2648}
     2649#endif
    26542650Void TEncCu::xCheckRDCostIntra( TComDataCU *&rpcBestCU,
    26552651                                TComDataCU *&rpcTempCU,
     
    26772673
    26782674  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
    2679 #if H_3D
     2675#if NH_3D_DIS
    26802676  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
    26812677#endif
     
    27152711    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
    27162712  }
    2717 #if H_3D
     2713#if NH_3D_DIS
    27182714  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
    27192715  if(!rpcTempCU->getDISFlag(0))
     
    27352731  setCodeChromaQpAdjFlag( codeChromaQpAdjFlag );
    27362732  setdQPFlag( bCodeDQP );
    2737 #if H_3D
     2733#if NH_3D_DIS
    27382734  }
    27392735#endif
     
    27822778
    27832779  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
    2784 #if H_3D
     2780#if NH_3D_DIS
    27852781  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
    27862782#endif
     
    28042800
    28052801  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
    2806 #if H_3D
     2802#if NH_3D_DIS
    28072803  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
    28082804#endif
Note: See TracChangeset for help on using the changeset viewer.