Ignore:
Timestamp:
20 Jan 2014, 04:34:18 (11 years ago)
Author:
qualcomm
Message:

integration of JCT3V-G0122 (generalize SDC to all depth intra modes) by Qualcomm.

Location:
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h

    r773 r781  
    107107
    108108#if H_3D_DIM
     109#if QC_GENERIC_SDC_G0122
     110#define NUM_DEPTH_INTRA_MODE_CTX      1       ///< number of context models for depth intra modes
     111#else
    109112#define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
     113#endif
    110114#define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
    111115#define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
    112116#if H_3D_DIM_DMM
    113117#define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
     118#endif
     119#if QC_GENERIC_SDC_G0122
     120#define NUM_ANGLE_FLAG_CTX            3
     121#define NUM_INTRASDC_FLAG_CTX         3
    114122#endif
    115123#endif
     
    383391#endif
    384392#if H_3D_DIM
     393#if QC_GENERIC_SDC_G0122
     394static const UChar
     395INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
     396{
     397  { 154, },
     398  { 154, },
     399  { 154, }
     400};
     401#else
    385402static const UChar
    386403INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
     
    390407    {64, 0, CNU, CNU, 168, 109,   0, 0}
    391408};
     409#endif
     410
     411#if QC_GENERIC_SDC_G0122
     412static const UChar
     413INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
     414{
     415  { 154, 155, 156 },
     416  { 141, 185, 214 },
     417  { 155, 170, 157 },
     418};
     419static const UChar
     420INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =
     421{
     422  { 214, 229, 230 },
     423  { 215, 202, 174 },
     424  { 213, 201, 246 },
     425};
     426#endif
    392427
    393428static const UChar
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp

    r773 r781  
    24012401#endif
    24022402
     2403#if QC_GENERIC_SDC_G0122
     2404UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
     2405{
     2406  TComDataCU* pcTempCU;
     2407  UInt        uiTempPartIdx;
     2408  UInt        uiCtx = 0;
     2409
     2410  // Get BCBP of left PU
     2411  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2412  uiCtx    = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     2413
     2414  // Get BCBP of above PU
     2415  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2416  uiCtx   += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     2417
     2418  return uiCtx;
     2419}
     2420
     2421UInt TComDataCU::getCtxAngleFlag( UInt uiAbsPartIdx )
     2422{
     2423  TComDataCU* pcTempCU;
     2424  UInt        uiTempPartIdx;
     2425  UInt        uiCtx = 0;
     2426
     2427  // Get BCBP of left PU
     2428  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2429  uiCtx    = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0;
     2430
     2431  // Get BCBP of above PU
     2432  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2433  uiCtx   += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0;
     2434
     2435  return uiCtx;
     2436}
     2437#endif
     2438
    24032439UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
    24042440{
     
    26272663  if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
    26282664    return false;
    2629  
     2665#if QC_GENERIC_SDC_G0122
     2666  if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) )
     2667  {
     2668    return true;
     2669  }
     2670
     2671  if( getLumaIntraDir( uiAbsPartIdx ) < NUM_INTRA_MODE )
     2672  {
     2673    return true;
     2674  }
     2675
     2676  return false;
     2677#endif
    26302678  // check prediction mode
    26312679  UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h

    r773 r781  
    571571  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    572572  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
     573#if QC_GENERIC_SDC_G0122
     574  UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
     575  UInt          getCtxAngleFlag        ( UInt   uiAbsPartIdx );
     576#endif
    573577#endif
    574578#endif
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp

    r773 r781  
    416416
    417417#if H_3D_DIM
    418 Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc )
     418Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc
     419#if QC_GENERIC_SDC_G0122
     420  , TComWedgelet* dmm4Segmentation
     421#endif
     422  )
    419423{
    420424  assert( iWidth == iHeight  );
     
    442446    case( DMM4_IDX ):
    443447      {
     448#if QC_GENERIC_SDC_G0122
     449        if( dmm4Segmentation == NULL )
     450        {
     451          dmmSegmentation = new TComWedgelet( iWidth, iHeight );
     452          xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation );
     453        }
     454        else
     455        {
     456          xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmm4Segmentation );
     457          dmmSegmentation = dmm4Segmentation;
     458        }
     459#else
    444460        dmmSegmentation = new TComWedgelet( iWidth, iHeight );
    445461        xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation );
     462#endif
    446463      } break;
    447464    default: assert(0);
     
    494511
    495512#if H_3D_DIM_DMM
     513#if QC_GENERIC_SDC_G0122
     514  if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
     515#else
    496516  if( dimType == DMM4_IDX ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
     517#endif
    497518#endif
    498519}
     
    21842205  Int iSumPix[2];
    21852206  memset(iSumPix, 0, sizeof(Int)*2);
    2186  
     2207#if QC_GENERIC_SDC_G0122
     2208  for( Int i = 0; i < uiNumSegments; i++ )
     2209  {
     2210    rpSegMeans[i] = 0;
     2211  }
     2212#endif
    21872213  if (orgDC == false)
    21882214  {
     
    21992225      rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ];
    22002226    }
     2227#if QC_GENERIC_SDC_G0122
     2228    else if( getDimType( uiIntraMode ) == DMM4_IDX )
     2229    {
     2230      Pel *ptmpOrig = pOrig;
     2231      Bool *ptmpMask = pMask, bBreak = false;
     2232      UChar ucSegment = ptmpMask? (UChar) ptmpMask[0] : 0;
     2233      UChar bFirstSeg = ucSegment;
     2234
     2235      rpSegMeans[ucSegment] = ptmpOrig[0];
     2236      for ( Int y = 0; y < uiSize; y++ )
     2237      {
     2238        for ( Int x = 0; x < uiSize; x++ )
     2239        {
     2240          ucSegment = ptmpMask[x];
     2241          assert( ucSegment < uiNumSegments );
     2242
     2243          if( bFirstSeg != ucSegment )
     2244          {
     2245            rpSegMeans[ucSegment] = ptmpOrig[x];
     2246            bBreak = true;
     2247            break;
     2248          }
     2249        }
     2250
     2251        if( bBreak )
     2252        {
     2253          break;
     2254        }
     2255
     2256        ptmpOrig  += uiStride;
     2257        ptmpMask  += uiMaskStride;
     2258      }
     2259    }
     2260    else
     2261#else
    22012262    else if (uiIntraMode == PLANAR_IDX)
     2263#endif
    22022264    {
    22032265      Pel* pLeftTop = pOrig;
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComPrediction.h

    r773 r781  
    167167#if H_3D_DIM
    168168  // Depth intra
    169   Void predIntraLumaDepth         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false );
     169  Void predIntraLumaDepth         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false
     170#if QC_GENERIC_SDC_G0122
     171    , TComWedgelet* dmm4Segmentation = NULL
     172#endif
     173    );
    170174#if H_3D_DIM_SDC
    171175  Void analyzeSegmentsSDC         ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h

    r773 r781  
    235235#define H_3D_DELTA_DLT                    1
    236236#endif
     237#define QC_GENERIC_SDC_G0122              1  // Generalize SDC to all depth intra modes
    237238
    238239#define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
Note: See TracChangeset for help on using the changeset viewer.