Newer
Older

Karsten Suehring
committed
PU::fillMvpCand(pu, REF_PIC_LIST_0, pu.refIdx[0], amvpInfo);
pu.mvpNum[0] = amvpInfo.numCand;
mvPred = amvpInfo.mvCand[pu.mvpIdx[0]];
mv.roundToAmvrSignalPrecision(MV_PRECISION_QUARTER, cu.imv);

Karsten Suehring
committed
pu.mv[0] = mv;
Mv mvDiff = mv - mvPred;
pu.mvd[0] = mvDiff;
}
if( pu.interDir != 1 /* PRED_L0 */ )
{
Mv mv = pu.mv[1];
Mv mvPred;
AMVPInfo amvpInfo;
PU::fillMvpCand(pu, REF_PIC_LIST_1, pu.refIdx[1], amvpInfo);
pu.mvpNum[1] = amvpInfo.numCand;
mvPred = amvpInfo.mvCand[pu.mvpIdx[1]];
mv.roundToAmvrSignalPrecision(MV_PRECISION_QUARTER, cu.imv);

Karsten Suehring
committed
Mv mvDiff = mv - mvPred;
if( pu.cu->cs->slice->getMvdL1ZeroFlag() && pu.interDir == 3 /* PRED_BI */ )
{
pu.mvd[1] = Mv();
mv = mvPred;
}
else
{
pu.mvd[1] = mvDiff;
}
pu.mv[1] = mv;
}
}
else
{
PU::getInterMergeCandidates ( pu, mrgCtx

Karsten Suehring
committed
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
mrgCtx.setMergeInfo( pu, pu.mergeIdx );
}
PU::spanMotionInfo( pu, mrgCtx );
}
}
bool CU::hasSubCUNonZeroMVd( const CodingUnit& cu )
{
bool bNonZeroMvd = false;
for( const auto &pu : CU::traversePUs( cu ) )
{
if( ( !pu.mergeFlag ) && ( !cu.skip ) )
{
if( pu.interDir != 2 /* PRED_L1 */ )
{
bNonZeroMvd |= pu.mvd[REF_PIC_LIST_0].getHor() != 0;
bNonZeroMvd |= pu.mvd[REF_PIC_LIST_0].getVer() != 0;
}
if( pu.interDir != 1 /* PRED_L0 */ )
{
if( !pu.cu->cs->slice->getMvdL1ZeroFlag() || pu.interDir != 3 /* PRED_BI */ )
{
bNonZeroMvd |= pu.mvd[REF_PIC_LIST_1].getHor() != 0;
bNonZeroMvd |= pu.mvd[REF_PIC_LIST_1].getVer() != 0;
}
}
}
}
return bNonZeroMvd;
}
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
bool CU::hasSubCUNonZeroAffineMVd( const CodingUnit& cu )
{
bool nonZeroAffineMvd = false;
if ( !cu.affine || cu.firstPU->mergeFlag )
{
return false;
}
for ( const auto &pu : CU::traversePUs( cu ) )
{
if ( ( !pu.mergeFlag ) && ( !cu.skip ) )
{
if ( pu.interDir != 2 /* PRED_L1 */ )
{
for ( int i = 0; i < ( cu.affineType == AFFINEMODEL_6PARAM ? 3 : 2 ); i++ )
{
nonZeroAffineMvd |= pu.mvdAffi[REF_PIC_LIST_0][i].getHor() != 0;
nonZeroAffineMvd |= pu.mvdAffi[REF_PIC_LIST_0][i].getVer() != 0;
}
}
if ( pu.interDir != 1 /* PRED_L0 */ )
{
if ( !pu.cu->cs->slice->getMvdL1ZeroFlag() || pu.interDir != 3 /* PRED_BI */ )
{
for ( int i = 0; i < ( cu.affineType == AFFINEMODEL_6PARAM ? 3 : 2 ); i++ )
{
nonZeroAffineMvd |= pu.mvdAffi[REF_PIC_LIST_1][i].getHor() != 0;
nonZeroAffineMvd |= pu.mvdAffi[REF_PIC_LIST_1][i].getVer() != 0;
}
}
}
}
}
return nonZeroAffineMvd;
}

Karsten Suehring
committed
int CU::getMaxNeighboriMVCandNum( const CodingStructure& cs, const Position& pos )
{
const int numDefault = 0;
int maxImvNumCand = 0;
// Get BCBP of left PU
const CodingUnit *cuLeft = cs.getCURestricted( pos.offset( -1, 0 ), cs.slice->getIndependentSliceIdx(), cs.picture->tileMap->getTileIdxMap( pos ), CH_L );
maxImvNumCand = ( cuLeft ) ? cuLeft->imvNumCand : numDefault;
// Get BCBP of above PU
const CodingUnit *cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), cs.slice->getIndependentSliceIdx(), cs.picture->tileMap->getTileIdxMap( pos ), CH_L );
maxImvNumCand = std::max( maxImvNumCand, ( cuAbove ) ? cuAbove->imvNumCand : numDefault );
return maxImvNumCand;
}
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
uint8_t CU::getSbtInfo( uint8_t idx, uint8_t pos )
{
return ( pos << 4 ) + ( idx << 0 );
}
uint8_t CU::getSbtIdx( const uint8_t sbtInfo )
{
return ( sbtInfo >> 0 ) & 0xf;
}
uint8_t CU::getSbtPos( const uint8_t sbtInfo )
{
return ( sbtInfo >> 4 ) & 0x3;
}
uint8_t CU::getSbtMode( uint8_t sbtIdx, uint8_t sbtPos )
{
uint8_t sbtMode = 0;
switch( sbtIdx )
{
case SBT_VER_HALF: sbtMode = sbtPos + SBT_VER_H0; break;
case SBT_HOR_HALF: sbtMode = sbtPos + SBT_HOR_H0; break;
case SBT_VER_QUAD: sbtMode = sbtPos + SBT_VER_Q0; break;
case SBT_HOR_QUAD: sbtMode = sbtPos + SBT_HOR_Q0; break;
default: assert( 0 );
}
assert( sbtMode < NUMBER_SBT_MODE );
return sbtMode;
}
uint8_t CU::getSbtIdxFromSbtMode( uint8_t sbtMode )
{
if( sbtMode <= SBT_VER_H1 )
return SBT_VER_HALF;
else if( sbtMode <= SBT_HOR_H1 )
return SBT_HOR_HALF;
else if( sbtMode <= SBT_VER_Q1 )
return SBT_VER_QUAD;
else if( sbtMode <= SBT_HOR_Q1 )
return SBT_HOR_QUAD;
else
{
assert( 0 );
return 0;
}
}
uint8_t CU::getSbtPosFromSbtMode( uint8_t sbtMode )
{
if( sbtMode <= SBT_VER_H1 )
return sbtMode - SBT_VER_H0;
else if( sbtMode <= SBT_HOR_H1 )
return sbtMode - SBT_HOR_H0;
else if( sbtMode <= SBT_VER_Q1 )
return sbtMode - SBT_VER_Q0;
else if( sbtMode <= SBT_HOR_Q1 )
return sbtMode - SBT_HOR_Q0;
else
{
assert( 0 );
return 0;
}
}
uint8_t CU::targetSbtAllowed( uint8_t sbtIdx, uint8_t sbtAllowed )
{
uint8_t val = 0;
switch( sbtIdx )
{
case SBT_VER_HALF: val = ( ( sbtAllowed >> SBT_VER_HALF ) & 0x1 ); break;
case SBT_HOR_HALF: val = ( ( sbtAllowed >> SBT_HOR_HALF ) & 0x1 ); break;
case SBT_VER_QUAD: val = ( ( sbtAllowed >> SBT_VER_QUAD ) & 0x1 ); break;
case SBT_HOR_QUAD: val = ( ( sbtAllowed >> SBT_HOR_QUAD ) & 0x1 ); break;
default: CHECK( 1, "unknown SBT type" );
}
return val;
}
uint8_t CU::numSbtModeRdo( uint8_t sbtAllowed )
{
uint8_t num = 0;
uint8_t sum = 0;
num = targetSbtAllowed( SBT_VER_HALF, sbtAllowed ) + targetSbtAllowed( SBT_HOR_HALF, sbtAllowed );
sum += std::min( SBT_NUM_RDO, ( num << 1 ) );
num = targetSbtAllowed( SBT_VER_QUAD, sbtAllowed ) + targetSbtAllowed( SBT_HOR_QUAD, sbtAllowed );
sum += std::min( SBT_NUM_RDO, ( num << 1 ) );
return sum;
}
bool CU::isMtsMode( const uint8_t sbtInfo )
{
return getSbtIdx( sbtInfo ) == SBT_OFF_MTS;
}
bool CU::isSbtMode( const uint8_t sbtInfo )
{
uint8_t sbtIdx = getSbtIdx( sbtInfo );
return sbtIdx >= SBT_VER_HALF && sbtIdx <= SBT_HOR_QUAD;
}
bool CU::isSameSbtSize( const uint8_t sbtInfo1, const uint8_t sbtInfo2 )
{
uint8_t sbtIdx1 = getSbtIdxFromSbtMode( sbtInfo1 );
uint8_t sbtIdx2 = getSbtIdxFromSbtMode( sbtInfo2 );
if( sbtIdx1 == SBT_HOR_HALF || sbtIdx1 == SBT_VER_HALF )
return sbtIdx2 == SBT_HOR_HALF || sbtIdx2 == SBT_VER_HALF;
else if( sbtIdx1 == SBT_HOR_QUAD || sbtIdx1 == SBT_VER_QUAD )
return sbtIdx2 == SBT_HOR_QUAD || sbtIdx2 == SBT_VER_QUAD;
else
return false;
}
bool CU::isGBiIdxCoded( const CodingUnit &cu )
{
if( cu.cs->sps->getUseGBi() == false )
{
CHECK(cu.GBiIdx != GBI_DEFAULT, "Error: cu.GBiIdx != GBI_DEFAULT");
return false;
}
if (cu.predMode == MODE_IBC)
{
return false;
}
if( cu.predMode == MODE_INTRA || cu.cs->slice->isInterP() )
{
return false;
}

Karsten Suehring
committed
if( cu.lwidth() * cu.lheight() < GBI_SIZE_CONSTRAINT )
{
return false;
}

Karsten Suehring
committed
if( !cu.firstPU->mergeFlag )
if( cu.firstPU->interDir == 3 )
{
WPScalingParam *wp0;
WPScalingParam *wp1;
int refIdx0 = cu.firstPU->refIdx[REF_PIC_LIST_0];
int refIdx1 = cu.firstPU->refIdx[REF_PIC_LIST_1];
cu.cs->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0);
cu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
if ((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag
|| wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag)
)
{
return false;
}

Karsten Suehring
committed
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
return false;
}
uint8_t CU::getValidGbiIdx( const CodingUnit &cu )
{
if( cu.firstPU->interDir == 3 && !cu.firstPU->mergeFlag )
{
return cu.GBiIdx;
}
else if( cu.firstPU->interDir == 3 && cu.firstPU->mergeFlag && cu.firstPU->mergeType == MRG_TYPE_DEFAULT_N )
{
// This is intended to do nothing here.
}
else if( cu.firstPU->mergeFlag && cu.firstPU->mergeType == MRG_TYPE_SUBPU_ATMVP )
{
CHECK(cu.GBiIdx != GBI_DEFAULT, " cu.GBiIdx != GBI_DEFAULT ");
}
else
{
CHECK(cu.GBiIdx != GBI_DEFAULT, " cu.GBiIdx != GBI_DEFAULT ");
}
return GBI_DEFAULT;
}
void CU::setGbiIdx( CodingUnit &cu, uint8_t uh )
{
int8_t uhCnt = 0;
if( cu.firstPU->interDir == 3 && !cu.firstPU->mergeFlag )
{
cu.GBiIdx = uh;
++uhCnt;
}
else if( cu.firstPU->interDir == 3 && cu.firstPU->mergeFlag && cu.firstPU->mergeType == MRG_TYPE_DEFAULT_N )
{
// This is intended to do nothing here.
}
else if( cu.firstPU->mergeFlag && cu.firstPU->mergeType == MRG_TYPE_SUBPU_ATMVP )
{
cu.GBiIdx = GBI_DEFAULT;
}
else
{
cu.GBiIdx = GBI_DEFAULT;
}
CHECK(uhCnt <= 0, " uhCnt <= 0 ");
}
uint8_t CU::deriveGbiIdx( uint8_t gbiLO, uint8_t gbiL1 )
{
if( gbiLO == gbiL1 )
{
return gbiLO;
}
const int8_t w0 = getGbiWeight(gbiLO, REF_PIC_LIST_0);
const int8_t w1 = getGbiWeight(gbiL1, REF_PIC_LIST_1);
const int8_t th = g_GbiWeightBase >> 1;
const int8_t off = 1;
if( w0 == w1 || (w0 < (th - off) && w1 < (th - off)) || (w0 >(th + off) && w1 >(th + off)) )
{
return GBI_DEFAULT;
}
else
{
if( w0 > w1 )
{
return ( w0 >= th ? gbiLO : gbiL1 );
}
else
{
return ( w1 >= th ? gbiL1 : gbiLO );
}
}
}

Karsten Suehring
committed
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
// TU tools
bool TU::isNonTransformedResidualRotated(const TransformUnit &tu, const ComponentID &compID)
{
return tu.cs->sps->getSpsRangeExtension().getTransformSkipRotationEnabledFlag() && tu.blocks[compID].width == 4 && tu.cu->predMode == MODE_INTRA;
}
bool TU::getCbf( const TransformUnit &tu, const ComponentID &compID )
{
return getCbfAtDepth( tu, compID, tu.depth );
}
bool TU::getCbfAtDepth(const TransformUnit &tu, const ComponentID &compID, const unsigned &depth)
{
return ((tu.cbf[compID] >> depth) & 1) == 1;
}
void TU::setCbfAtDepth(TransformUnit &tu, const ComponentID &compID, const unsigned &depth, const bool &cbf)
{
// first clear the CBF at the depth
tu.cbf[compID] &= ~(1 << depth);
// then set the CBF
tu.cbf[compID] |= ((cbf ? 1 : 0) << depth);
}
bool TU::isTSAllowed(const TransformUnit &tu, const ComponentID compID)
{
bool tsAllowed = compID == COMPONENT_Y;
const int maxSize = tu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize();
tsAllowed &= tu.cs->pps->getUseTransformSkip();
tsAllowed &= !tu.cu->transQuantBypass;
tsAllowed &= ( !tu.cu->ispMode || !isLuma(compID) );
SizeType transformSkipMaxSize = 1 << maxSize;
tsAllowed &= tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize;
tsAllowed &= !tu.cu->sbtInfo;
return tsAllowed;
}
bool TU::isMTSAllowed(const TransformUnit &tu, const ComponentID compID)
{
bool mtsAllowed = compID == COMPONENT_Y;
const int maxSize = CU::isIntra( *tu.cu ) ? MTS_INTRA_MAX_CU_SIZE : MTS_INTER_MAX_CU_SIZE;
mtsAllowed &= CU::isIntra( *tu.cu ) ? tu.cs->sps->getUseIntraMTS() : tu.cs->sps->getUseInterMTS() && CU::isInter( *tu.cu );
mtsAllowed &= ( tu.lwidth() <= maxSize && tu.lheight() <= maxSize );
mtsAllowed &= !tu.cu->ispMode;
mtsAllowed &= !tu.cu->sbtInfo;

Karsten Suehring
committed
uint32_t TU::getGolombRiceStatisticsIndex(const TransformUnit &tu, const ComponentID &compID)
{

Karsten Suehring
committed
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
const bool transquantBypass = tu.cu->transQuantBypass;
//--------
const uint32_t channelTypeOffset = isChroma(compID) ? 2 : 0;
const uint32_t nonTransformedOffset = (transformSkip || transquantBypass) ? 1 : 0;
//--------
const uint32_t selectedIndex = channelTypeOffset + nonTransformedOffset;
CHECK( selectedIndex >= RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS, "Invalid golomb rice adaptation statistics set" );
return selectedIndex;
}
#if HEVC_USE_MDCS
uint32_t TU::getCoefScanIdx(const TransformUnit &tu, const ComponentID &compID)
{
//------------------------------------------------
//this mechanism is available for intra only
if( !CU::isIntra( *tu.cu ) )
{
return SCAN_DIAG;
}
//------------------------------------------------
//check that MDCS can be used for this TU
const CompArea &area = tu.blocks[compID];
const SPS &sps = *tu.cs->sps;
const ChromaFormat format = sps.getChromaFormatIdc();
const uint32_t maximumWidth = MDCS_MAXIMUM_WIDTH >> getComponentScaleX(compID, format);
const uint32_t maximumHeight = MDCS_MAXIMUM_HEIGHT >> getComponentScaleY(compID, format);
if ((area.width > maximumWidth) || (area.height > maximumHeight))
{
return SCAN_DIAG;
}
//------------------------------------------------
//otherwise, select the appropriate mode
const PredictionUnit &pu = *tu.cs->getPU( area.pos(), toChannelType( compID ) );
uint32_t uiDirMode = PU::getFinalIntraMode(pu, toChannelType(compID));
//------------------
if (abs((int) uiDirMode - VER_IDX) <= MDCS_ANGLE_LIMIT)
{
return SCAN_HOR;
}
else if (abs((int) uiDirMode - HOR_IDX) <= MDCS_ANGLE_LIMIT)
{
return SCAN_VER;
}
else
{
return SCAN_DIAG;
}
}
#endif
bool TU::hasCrossCompPredInfo( const TransformUnit &tu, const ComponentID &compID )
{
return (isChroma(compID) && tu.cs->pps->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && TU::getCbf(tu, COMPONENT_Y) &&
(!CU::isIntra(*tu.cu) || PU::isChromaIntraModeCrossCheckMode(*tu.cs->getPU(tu.blocks[compID].pos(), toChannelType(compID)))));

Karsten Suehring
committed
}
uint32_t TU::getNumNonZeroCoeffsNonTS( const TransformUnit& tu, const bool bLuma, const bool bChroma )
{
uint32_t count = 0;
for( uint32_t i = 0; i < ::getNumberValidTBlocks( *tu.cs->pcv ); i++ )
{
if( tu.blocks[i].valid() && ( isLuma(ComponentID(i)) ? tu.mtsIdx !=1 : true ) && TU::getCbf( tu, ComponentID( i ) ) )

Karsten Suehring
committed
{
if( isLuma ( tu.blocks[i].compID ) && !bLuma ) continue;
if( isChroma( tu.blocks[i].compID ) && !bChroma ) continue;
uint32_t area = tu.blocks[i].area();
const TCoeff* coeff = tu.getCoeffs( ComponentID( i ) ).buf;
for( uint32_t j = 0; j < area; j++ )
{
count += coeff[j] != 0;
}
}
}
return count;
}
bool TU::needsSqrt2Scale( const TransformUnit &tu, const ComponentID &compID )
{
const Size &size=tu.blocks[compID];
const bool isTransformSkip = tu.mtsIdx==1 && isLuma(compID);
return (!isTransformSkip) && (((g_aucLog2[size.width] + g_aucLog2[size.height]) & 1) == 1);

Karsten Suehring
committed
#if HM_QTBT_AS_IN_JEM_QUANT
bool TU::needsBlockSizeTrafoScale( const TransformUnit &tu, const ComponentID &compID )
{
return needsSqrt2Scale( tu, compID ) || isNonLog2BlockSize( tu.blocks[compID] );
}
#else

Karsten Suehring
committed
bool TU::needsQP3Offset(const TransformUnit &tu, const ComponentID &compID)
{

Karsten Suehring
committed
{
return ( ( ( g_aucLog2[tu.blocks[compID].width] + g_aucLog2[tu.blocks[compID].height] ) & 1 ) == 1 );
}
return false;
}
#endif
TransformUnit* TU::getPrevTU( const TransformUnit &tu, const ComponentID compID )
{
TransformUnit* prevTU = tu.prev;

Karsten Suehring
committed
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
if( prevTU != nullptr && ( prevTU->cu != tu.cu || !prevTU->blocks[compID].valid() ) )
{
prevTU = nullptr;
}
return prevTU;
}
bool TU::getPrevTuCbfAtDepth( const TransformUnit ¤tTu, const ComponentID compID, const int trDepth )
{
const TransformUnit* prevTU = getPrevTU( currentTu, compID );
return ( prevTU != nullptr ) ? TU::getCbfAtDepth( *prevTU, compID, trDepth ) : false;
}
void TU::getTransformTypeISP( const TransformUnit &tu, const ComponentID compID, int &typeH, int &typeV )
{
typeH = DCT2, typeV = DCT2;
const int uiChFinalMode = PU::getFinalIntraMode( *tu.cu->firstPU, toChannelType( compID ) );
bool intraModeIsEven = uiChFinalMode % 2 == 0;
if( uiChFinalMode == DC_IDX || uiChFinalMode == 33 || uiChFinalMode == 35 )
{
typeH = DCT2;
typeV = typeH;
}
else if( uiChFinalMode == PLANAR_IDX || ( uiChFinalMode >= 31 && uiChFinalMode <= 37 ) )
{
typeH = DST7;
typeV = typeH;
}
else if( ( intraModeIsEven && uiChFinalMode >= 2 && uiChFinalMode <= 30 ) || ( !intraModeIsEven && uiChFinalMode >= 39 && uiChFinalMode <= 65 ) )
{
typeH = DST7;
typeV = DCT2;
}
else if( ( !intraModeIsEven && uiChFinalMode >= 3 && uiChFinalMode <= 29 ) || ( intraModeIsEven && uiChFinalMode >= 38 && uiChFinalMode <= 66 ) )
{
typeH = DCT2;
typeV = DST7;
}
//Size restriction for non-DCT-II transforms
Area tuArea = tu.blocks[compID];
typeH = tuArea.width <= 2 || tuArea.width >= 32 ? DCT2 : typeH;
typeV = tuArea.height <= 2 || tuArea.height >= 32 ? DCT2 : typeV;
}

Karsten Suehring
committed
// other tools
uint32_t getCtuAddr( const Position& pos, const PreCalcValues& pcv )
{
return ( pos.x >> pcv.maxCUWidthLog2 ) + ( pos.y >> pcv.maxCUHeightLog2 ) * pcv.widthInCtus;
}