Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jvet/HM
  • ksuehring/HM
  • lzz8246/HM
  • vlad/HM
  • tlu/HM
  • s.iwamura/HM
  • Palanivel/HM
  • Zhu/HM
  • bross/HM
  • chollmann/HM
  • Kenneth/HM
  • pj/HM
  • Guangjie_Ren/HM
  • Fangjun.Pu/HM
  • XiangLi/HM
  • jvet-ahg-fgt/HM
  • JINGYING/HM
17 results
Show changes
Showing
with 2492 additions and 55 deletions
......@@ -126,6 +126,10 @@ private:
TComMv m_mvPredictor;
Double m_motionLambda;
Int m_iCostScale;
TComMv m_mvPredictors[2];
Bool m_bRGBformat;
Bool m_useColourTrans;
Bool m_useLL;
public:
TComRdCost();
......@@ -161,6 +165,69 @@ public:
{
m_mvPredictor = rcMv;
}
Void setPredictors( TComMv* pcMv )
{
for(Int i=0; i<2; i++)
{
m_mvPredictors[i] = pcMv[i];
}
}
__inline Distortion getCostMultiplePreds( Int x, Int y )
{
return Distortion((m_motionLambda * getBitsMultiplePreds(x, y)) / 65536.0);
}
UInt getBitsMultiplePreds( Int x, Int y )
{
Int rmvH[2];
Int rmvV[2];
rmvH[0] = x - m_mvPredictors[0].getHor();
rmvH[1] = x - m_mvPredictors[1].getHor();
rmvV[0] = y - m_mvPredictors[0].getVer();
rmvV[1] = y - m_mvPredictors[1].getVer();
Int absCand[2];
absCand[0] = abs(rmvH[0])+abs(rmvV[0]);
absCand[1] = abs(rmvH[1])+abs(rmvV[1]);
if(absCand[0] < absCand[1] )
{
return getIComponentBits(rmvH[0]) + getIComponentBits(rmvV[0]);
}
else
{
return getIComponentBits(rmvH[1]) + getIComponentBits(rmvV[1]);
}
}
UInt getIComponentBits( Int iVal )
{
if( !iVal ) return 1;
UInt length = 1;
UInt temp = ( iVal <= 0) ? (-iVal<<1)+1: (iVal<<1);
while ( 1 != temp )
{
temp >>= 1;
length += 2;
}
return length;
}
Bool getRGBFormatFlag () const { return m_bRGBformat; }
Void setRGBFormatFlag (const Bool value) { m_bRGBformat = value; }
Bool getUseColourTrans () const { return m_useColourTrans;}
Void setUseColourTrans (const Bool value) { m_useColourTrans= value;}
Bool getUseLossless () const { return m_useLL; }
Void setUseLossless (const Bool value) { m_useLL= value; }
Void adjustLambdaForColourTrans (Int delta_QP, const BitDepths &bitDepths);
Void setCostScale( Int iCostScale ) { m_iCostScale = iCostScale; }
Distortion getCost( UInt b ) { return Distortion(( m_motionLambda * b ) / 65536.0); }
Distortion getCostOfVectorWithPredictor( const Int x, const Int y )
......
......@@ -163,6 +163,37 @@ public:
//------------------------------------------------
case SCAN_TRAV:
{
if (m_line%2==0)
{
if (m_column == (m_blockWidth - 1))
{
m_line++;
m_column = m_blockWidth - 1;
}
else
{
m_column++;
}
}
else
{
if (m_column == 0)
{
m_line++;
m_column = 0;
}
else
{
m_column--;
}
}
}
break;
//------------------------------------------------
default:
{
std::cerr << "ERROR: Unknown scan type \"" << m_scanType << "\"in ScanGenerator::GetNextIndex" << std::endl;
......@@ -175,6 +206,31 @@ public:
}
};
UChar g_ucMsbP1Idx[256];
static Void g_initMsbP1IdxLut()
{
g_ucMsbP1Idx[0] = 0; g_ucMsbP1Idx[1] = 1;
UInt val = 2;
for (UInt idx = 2; idx <= 8; idx++)
{
for (Int i = val - 1; i >= 0; i--)
{
g_ucMsbP1Idx[val++] = idx;
}
}
}
UChar g_getMsbP1Idx(UInt uiVal)
{
UChar idx = 0;
while(uiVal > 255)
{
uiVal >>= 8;
idx += 8;
}
return idx+g_ucMsbP1Idx[uiVal];
}
// initialize ROM variables
Void initROM()
{
......@@ -190,9 +246,9 @@ Void initROM()
}
// initialise scan orders
for(UInt log2BlockHeight = 0; log2BlockHeight < MAX_CU_DEPTH; log2BlockHeight++)
for(UInt log2BlockHeight = 0; log2BlockHeight < MAX_CU_DEPTH + 1; log2BlockHeight++)
{
for(UInt log2BlockWidth = 0; log2BlockWidth < MAX_CU_DEPTH; log2BlockWidth++)
for(UInt log2BlockWidth = 0; log2BlockWidth < MAX_CU_DEPTH + 1; log2BlockWidth++)
{
const UInt blockWidth = 1 << log2BlockWidth;
const UInt blockHeight = 1 << log2BlockHeight;
......@@ -258,6 +314,7 @@ Void initROM()
//--------------------------------------------------------------------------------------------------
}
}
g_initMsbP1IdxLut();
}
Void destroyROM()
......@@ -266,9 +323,9 @@ Void destroyROM()
{
for (UInt scanOrderIndex = 0; scanOrderIndex < SCAN_NUMBER_OF_TYPES; scanOrderIndex++)
{
for (UInt log2BlockWidth = 0; log2BlockWidth < MAX_CU_DEPTH; log2BlockWidth++)
for (UInt log2BlockWidth = 0; log2BlockWidth < MAX_CU_DEPTH + 1; log2BlockWidth++)
{
for (UInt log2BlockHeight = 0; log2BlockHeight < MAX_CU_DEPTH; log2BlockHeight++)
for (UInt log2BlockHeight = 0; log2BlockHeight < MAX_CU_DEPTH + 1; log2BlockHeight++)
{
delete [] g_scanOrder[groupTypeIndex][scanOrderIndex][log2BlockWidth][log2BlockHeight];
}
......@@ -566,6 +623,17 @@ const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE] =
{ 0, 1, 2, 2, 2, 2, 3, 5, 7, 8, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31, DM_CHROMA_IDX};
// ====================================================================================================================
const UChar g_uhPaletteTBC[257] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8};
// Misc.
// ====================================================================================================================
......@@ -584,7 +652,7 @@ UInt64 g_nSymbolCounter = 0;
// ====================================================================================================================
// scanning order table
UInt* g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][ MAX_CU_DEPTH ][ MAX_CU_DEPTH ];
UInt* g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][ MAX_CU_DEPTH + 1 ][ MAX_CU_DEPTH + 1 ];
const UInt ctxIndMap4x4[4*4] =
{
......
......@@ -60,7 +60,7 @@ Void destroyROM();
// flexible conversion from relative to absolute index
extern UInt g_auiZscanToRaster[ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ];
extern UInt g_auiRasterToZscan[ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ];
extern UInt* g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][ MAX_CU_DEPTH ][ MAX_CU_DEPTH ];
extern UInt* g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][ MAX_CU_DEPTH + 1 ][ MAX_CU_DEPTH + 1 ];
Void initZscanToRaster ( Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt*& rpuiCurrIdx );
Void initRasterToZscan ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth );
......@@ -115,6 +115,8 @@ extern const UChar g_aucIntraModeNumFast_NotUseMPM[MAX_CU_DEPTH];
extern const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE];
// ====================================================================================================================
extern const UChar g_uhPaletteTBC[257];
// Mode-Dependent DST Matrices
// ====================================================================================================================
......@@ -169,6 +171,9 @@ extern const Int g_quantInterDefault8x8[8*8];
extern const UInt g_scalingListSize [SCALING_LIST_SIZE_NUM];
extern const UInt g_scalingListSizeX[SCALING_LIST_SIZE_NUM];
extern UChar g_ucMsbP1Idx[256];
extern UChar g_getMsbP1Idx(UInt uiVal);
//! \}
#endif //__TCOMROM__
......
......@@ -107,6 +107,10 @@ TComSlice::TComSlice()
, m_LFCrossSliceBoundaryFlag ( false )
, m_enableTMVPFlag ( true )
, m_encCABACTableIdx (I_SLICE)
, m_useIntegerMv ( false )
, m_pcLastEncPic ( NULL )
, m_pcCurPicLongTerm ( NULL )
, m_pcTwoVersionsOfCurrDecPicFlag ( false )
{
for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
{
......@@ -117,6 +121,7 @@ TComSlice::TComSlice()
{
m_lambdas [component] = 0.0;
m_iSliceChromaQpDelta[component] = 0;
m_iSliceACTQpDelta [component] = 0;
}
initEqualRef();
......@@ -165,6 +170,7 @@ Void TComSlice::initSlice()
for (UInt component = 0; component < MAX_NUM_COMPONENT; component++)
{
m_iSliceChromaQpDelta[component] = 0;
m_iSliceACTQpDelta [component] = 0;
}
m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
......@@ -325,10 +331,29 @@ Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTo
if (!checkNumPocTotalCurr)
{
if( m_pRPS->getNumberOfPictures() == 0 )
{
TComPic *pPrevPic = xGetRefPic(rcListPic, max(0, getPOC()-1));
if ( pPrevPic->getSlice( 0 )->getPOC() != max( 0, getPOC()-1 ) )
{
pPrevPic = xGetRefPic( rcListPic, getPOC() );
}
setLastEncPic(pPrevPic);
}
return;
}
}
if ( !checkNumPocTotalCurr && m_pRPS->getNumberOfPictures() == 0 )
{
TComPic *pPrevPic = xGetRefPic( rcListPic, max( 0, getPOC() - 1 ) );
if ( pPrevPic->getSlice( 0 )->getPOC() != max( 0, getPOC() - 1 ) )
{
pPrevPic = xGetRefPic( rcListPic, getPOC() );
}
setLastEncPic( pPrevPic );
}
TComPic* pcRefPic= NULL;
static const UInt MAX_NUM_NEGATIVE_PICTURES=16;
TComPic* RefPicSetStCurr0[MAX_NUM_NEGATIVE_PICTURES];
......@@ -387,6 +412,11 @@ Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTo
TComPic* rpsCurrList1[MAX_NUM_REF+1];
Int numPicTotalCurr = NumPicStCurr0 + NumPicStCurr1 + NumPicLtCurr;
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
numPicTotalCurr++;
}
if (checkNumPocTotalCurr)
{
// The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
......@@ -394,7 +424,14 @@ Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTo
// - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
if (getRapPicFlag())
{
assert(numPicTotalCurr == 0);
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
assert(numPicTotalCurr == 1);
}
else
{
assert(numPicTotalCurr == 0);
}
}
if (m_eSliceType == I_SLICE)
......@@ -420,6 +457,10 @@ Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTo
{
rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
}
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
rpsCurrList0[cIdx++] = getCurPicLongTerm();
}
assert(cIdx == numPicTotalCurr);
if (m_eSliceType==B_SLICE)
......@@ -437,6 +478,10 @@ Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTo
{
rpsCurrList1[cIdx] = RefPicSetLtCurr[i];
}
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
rpsCurrList1[cIdx++] = getCurPicLongTerm();
}
assert(cIdx == numPicTotalCurr);
}
......@@ -449,6 +494,14 @@ Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTo
m_apcRefPicList[REF_PIC_LIST_0][rIdx] = rpsCurrList0[ cIdx ];
m_bIsUsedAsLongTerm[REF_PIC_LIST_0][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
}
if( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() &&
!m_RefPicListModification.getRefPicListModificationFlagL0() && numPicTotalCurr > m_aiNumRefIdx[REF_PIC_LIST_0] )
{
m_apcRefPicList[REF_PIC_LIST_0][m_aiNumRefIdx[REF_PIC_LIST_0] - 1] = getCurPicLongTerm();
m_bIsUsedAsLongTerm[REF_PIC_LIST_0][m_aiNumRefIdx[REF_PIC_LIST_0] - 1] = true;
}
if ( m_eSliceType != B_SLICE )
{
m_aiNumRefIdx[REF_PIC_LIST_1] = 0;
......@@ -466,6 +519,167 @@ Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTo
}
}
Bool TComSlice::isOnlyCurrentPictureAsReference()
{
if ( m_eSliceType == I_SLICE )
{
return true;
}
for ( Int i=0; i < getNumRefIdx( REF_PIC_LIST_0 ); i++ )
{
if ( getRefPic( REF_PIC_LIST_0, i )->getPOC() != getPOC() )
{
return false;
}
}
for ( Int i=0; i < getNumRefIdx( REF_PIC_LIST_1 ); i++ )
{
if ( getRefPic( REF_PIC_LIST_1, i )->getPOC() != getPOC() )
{
return false;
}
}
return true;
}
Void TComSlice::setRefPOCListSliceHeader()
{
assert(m_eSliceType != I_SLICE);
static const UInt MAX_NUM_NEGATIVE_PICTURES = 16;
Int RefPicPOCSetStCurr0[MAX_NUM_NEGATIVE_PICTURES];
Int RefPicPOCSetStCurr1[MAX_NUM_NEGATIVE_PICTURES];
Int RefPicPOCSetLtCurr[MAX_NUM_NEGATIVE_PICTURES];
UInt NumPicStCurr0 = 0;
UInt NumPicStCurr1 = 0;
UInt NumPicLtCurr = 0;
Int i;
for(i=0; i < m_pRPS->getNumberOfNegativePictures(); i++)
{
if(m_pRPS->getUsed(i))
{
RefPicPOCSetStCurr0[NumPicStCurr0] = getPOC() + m_pRPS->getDeltaPOC(i);
NumPicStCurr0++;
}
}
for(; i < m_pRPS->getNumberOfNegativePictures() + m_pRPS->getNumberOfPositivePictures(); i++)
{
if(m_pRPS->getUsed(i))
{
RefPicPOCSetStCurr1[NumPicStCurr1] = getPOC() + m_pRPS->getDeltaPOC(i);
NumPicStCurr1++;
}
}
for(i = m_pRPS->getNumberOfNegativePictures() + m_pRPS->getNumberOfPositivePictures() + m_pRPS->getNumberOfLongtermPictures()-1; i > m_pRPS->getNumberOfNegativePictures() + m_pRPS->getNumberOfPositivePictures() - 1; i--)
{
if(m_pRPS->getUsed(i))
{
RefPicPOCSetLtCurr[NumPicLtCurr] = m_pRPS->getPOC(i);
NumPicLtCurr++;
}
}
// ref_pic_list_init
Int rpsPOCCurrList0[MAX_NUM_REF+1];
Int rpsPOCCurrList1[MAX_NUM_REF+1];
Int numPicTotalCurr = NumPicStCurr0 + NumPicStCurr1 + NumPicLtCurr;
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
numPicTotalCurr++;
}
if (getRapPicFlag())
{
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
assert( numPicTotalCurr == 1 );
}
else
{
assert( numPicTotalCurr == 0 );
}
}
assert(numPicTotalCurr > 0);
assert(numPicTotalCurr <= 8);
m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
Int cIdx = 0;
for ( i = 0; i < NumPicStCurr0; i++, cIdx++)
{
rpsPOCCurrList0[cIdx] = RefPicPOCSetStCurr0[i];
}
for ( i = 0; i < NumPicStCurr1; i++, cIdx++)
{
rpsPOCCurrList0[cIdx] = RefPicPOCSetStCurr1[i];
}
for ( i=0; i < NumPicLtCurr; i++, cIdx++)
{
rpsPOCCurrList0[cIdx] = RefPicPOCSetLtCurr[i];
}
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
rpsPOCCurrList0[cIdx++] = getPOC();
}
assert(cIdx == numPicTotalCurr);
if (m_eSliceType==B_SLICE)
{
cIdx = 0;
for ( i = 0; i < NumPicStCurr1; i++, cIdx++)
{
rpsPOCCurrList1[cIdx] = RefPicPOCSetStCurr1[i];
}
for ( i = 0; i < NumPicStCurr0; i++, cIdx++)
{
rpsPOCCurrList1[cIdx] = RefPicPOCSetStCurr0[i];
}
for ( i = 0; i < NumPicLtCurr; i++, cIdx++)
{
rpsPOCCurrList1[cIdx] = RefPicPOCSetLtCurr[i];
}
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
rpsPOCCurrList1[cIdx++] = getPOC();
}
assert(cIdx == numPicTotalCurr);
}
for (Int rIdx = 0; rIdx < m_aiNumRefIdx[REF_PIC_LIST_0]; rIdx ++)
{
cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPicTotalCurr;
assert(cIdx >= 0 && cIdx < numPicTotalCurr);
m_aiRefPOCList[REF_PIC_LIST_0][rIdx] = rpsPOCCurrList0[cIdx];
}
if ( m_eSliceType != B_SLICE )
{
m_aiNumRefIdx[REF_PIC_LIST_1] = 0;
}
else
{
for (Int rIdx = 0; rIdx < m_aiNumRefIdx[REF_PIC_LIST_1]; rIdx ++)
{
cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPicTotalCurr;
assert(cIdx >= 0 && cIdx < numPicTotalCurr);
m_aiRefPOCList[REF_PIC_LIST_1][rIdx] = rpsPOCCurrList1[cIdx];
}
}
if (getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() &&
!m_RefPicListModification.getRefPicListModificationFlagL0() && numPicTotalCurr > m_aiNumRefIdx[REF_PIC_LIST_0])
{
m_aiRefPOCList[REF_PIC_LIST_0][m_aiNumRefIdx[REF_PIC_LIST_0] - 1] = getPOC();
}
}
Int TComSlice::getNumRpsCurrTempList() const
{
Int numRpsCurrTempList = 0;
......@@ -481,6 +695,11 @@ Int TComSlice::getNumRpsCurrTempList() const
numRpsCurrTempList++;
}
}
if ( getPPS()->getPpsScreenExtension().getUseIntraBlockCopy() )
{
numRpsCurrTempList++;
}
return numRpsCurrTempList;
}
......@@ -604,6 +823,7 @@ Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComL
if (rpcPic->getPOC() != pocCurr)
{
rpcPic->getSlice(0)->setReferenced(false);
rpcPic->getHashMap()->clearAll();
}
iterPic++;
}
......@@ -631,6 +851,7 @@ Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComL
if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != m_iLastIDR)
{
rpcPic->getSlice(0)->setReferenced(false);
rpcPic->getHashMap()->clearAll();
}
iterPic++;
}
......@@ -648,6 +869,7 @@ Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComL
if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA)
{
rpcPic->getSlice(0)->setReferenced(false);
rpcPic->getHashMap()->clearAll();
}
iterPic++;
}
......@@ -769,6 +991,7 @@ Void TComSlice::copySliceInfo(TComSlice *pSrc)
m_enableTMVPFlag = pSrc->m_enableTMVPFlag;
m_maxNumMergeCand = pSrc->m_maxNumMergeCand;
m_encCABACTableIdx = pSrc->m_encCABACTableIdx;
m_RefPicListModification = pSrc->m_RefPicListModification;
}
......@@ -1051,6 +1274,7 @@ Void TComSlice::applyReferencePictureSet( TComList<TComPic*>& rcListPic, const T
if(rpcPic->getPicSym()->getSlice(0)->getPOC() != this->getPOC() && isReference == 0)
{
rpcPic->getSlice( 0 )->setReferenced( false );
rpcPic->getHashMap()->clearAll();
rpcPic->setUsedByCurr(0);
rpcPic->setIsLongTerm(0);
}
......@@ -1504,6 +1728,16 @@ TComSPSRExt::TComSPSRExt()
}
}
TComSPSSCC::TComSPSSCC()
: m_useIntraBlockCopy (false)
, m_usePaletteMode (false)
, m_paletteMaxSize (31)
, m_paletteMaxPredSize (64)
, m_motionVectorResolutionControlIdc(0)
, m_disableIntraBoundaryFilter(false)
, m_numPalettePred (0)
{}
TComSPS::TComSPS()
: m_SPSId ( 0)
, m_VPSId ( 0)
......@@ -1589,6 +1823,22 @@ TComPPSRExt::TComPPSRExt()
}
}
TComPPSSCC::TComPPSSCC()
: m_useColourTrans (false)
, m_useSliceACTOffset (false)
, m_actYQpOffset (-5)
, m_actCbQpOffset (-5)
, m_actCrQpOffset (-3)
, m_numPalettePred (0) // Implies palette pred in PPS deactivated
, m_usePalettePredictor (false)
, m_useIntraBlockCopyPps (false)
{
for(Int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
{
m_palettePredictorBitDepth[ch] = 8;
}
}
TComPPS::TComPPS()
: m_PPSId (0)
, m_SPSId (0)
......
......@@ -774,6 +774,56 @@ public:
Void setCabacBypassAlignmentEnabledFlag(const Bool value) { m_cabacBypassAlignmentEnabledFlag = value; }
};
/// SPS SCC class
class TComSPSSCC
{
private:
Bool m_useIntraBlockCopy;
Bool m_usePaletteMode;
UInt m_paletteMaxSize;
UInt m_paletteMaxPredSize;
Int m_motionVectorResolutionControlIdc;
Bool m_disableIntraBoundaryFilter;
Bool m_usePalettePredictor;
UInt m_numPalettePred;
Pel m_aiPalette[MAX_NUM_COMPONENT][MAX_PALETTE_PRED_SIZE];
public:
TComSPSSCC();
Bool settingsDifferFromDefaults() const
{
return getUseIntraBlockCopy()
|| getUsePaletteMode()
|| getNumPalettePred() > 0
|| getMotionVectorResolutionControlIdc() != 0
|| getDisableIntraBoundaryFilter();
}
Bool getUseIntraBlockCopy() const { return m_useIntraBlockCopy; }
Void setUseIntraBlockCopy(Bool value) { m_useIntraBlockCopy = value; }
Bool getUsePaletteMode() const { return m_usePaletteMode; }
Void setUsePaletteMode(const Bool value) { m_usePaletteMode = value; }
UInt getPaletteMaxSize() const { return m_paletteMaxSize; }
Void setPaletteMaxSize(const UInt value) { m_paletteMaxSize = value; }
UInt getPaletteMaxPredSize() const { return m_paletteMaxPredSize; }
Void setPaletteMaxPredSize(const UInt value) { m_paletteMaxPredSize = value; }
Int getMotionVectorResolutionControlIdc() const { return m_motionVectorResolutionControlIdc; }
Void setMotionVectorResolutionControlIdc( Int idc ) { m_motionVectorResolutionControlIdc = idc; }
Void setDisableIntraBoundaryFilter( Bool b) { m_disableIntraBoundaryFilter = b; }
Bool getDisableIntraBoundaryFilter() const { return m_disableIntraBoundaryFilter; }
Bool getUsePalettePredictor() const { return m_usePalettePredictor; }
Void setUsePalettePredictor(Bool num) { m_usePalettePredictor = num; }
UInt getNumPalettePred() const { return m_numPalettePred; }
Void setNumPalettePred(UInt num) { m_numPalettePred = num; }
Pel* getPalettePred(UInt ch) const { return const_cast<Pel*>(m_aiPalette[ch]); }
};
/// SPS class
class TComSPS
{
......@@ -840,6 +890,7 @@ private:
TComVUI m_vuiParameters;
TComSPSRExt m_spsRangeExtension;
TComSPSSCC m_spsScreenExtension;
static const Int m_winUnitX[NUM_CHROMA_FORMAT];
static const Int m_winUnitY[NUM_CHROMA_FORMAT];
......@@ -978,6 +1029,8 @@ public:
const TComSPSRExt& getSpsRangeExtension() const { return m_spsRangeExtension; }
TComSPSRExt& getSpsRangeExtension() { return m_spsRangeExtension; }
const TComSPSSCC& getSpsScreenExtension() const { return m_spsScreenExtension; }
TComSPSSCC& getSpsScreenExtension() { return m_spsScreenExtension; }
};
......@@ -1067,6 +1120,50 @@ public:
};
class TComPPSSCC
{
private:
Bool m_useColourTrans;
Bool m_useSliceACTOffset;
Int m_actYQpOffset;
Int m_actCbQpOffset;
Int m_actCrQpOffset;
UInt m_numPalettePred;
Pel m_aiPalette[MAX_NUM_COMPONENT][MAX_PALETTE_PRED_SIZE];
Int m_palettePredictorBitDepth[MAX_NUM_CHANNEL_TYPE];
Bool m_monochromePaletteFlag;
Bool m_usePalettePredictor;
Bool m_useIntraBlockCopyPps;
public:
TComPPSSCC();
Bool settingsDifferFromDefaults() const
{
return getUseColourTrans()
|| getUseIntraBlockCopy()
|| getNumPalettePred() > 0;
}
Bool getUseColourTrans() const { return m_useColourTrans;}
Void setUseColourTrans(const Bool value) { m_useColourTrans= value;}
Bool getUseSliceACTOffset() const { return m_useSliceACTOffset;}
Void setUseSliceACTOffset(const Bool value) { m_useSliceACTOffset= value;}
Void setActQpOffset(ComponentID compID, Int i ) { if (compID==COMPONENT_Y) m_actYQpOffset = i; else if (compID==COMPONENT_Cb) m_actCbQpOffset = i; else if (compID==COMPONENT_Cr) m_actCrQpOffset= i; else assert(0); }
Int getActQpOffset(ComponentID compID) const { return (compID==COMPONENT_Y) ? m_actYQpOffset : (compID==COMPONENT_Cb ? m_actCbQpOffset : m_actCrQpOffset ); }
UInt getNumPalettePred() const { return m_numPalettePred; }
Void setNumPalettePred(UInt num) { m_numPalettePred = num; }
Pel* getPalettePred(UInt ch) const { return const_cast<Pel*>(m_aiPalette[ch]); }
Int getPalettePredictorBitDepth(ChannelType type) const { return m_palettePredictorBitDepth[type]; }
Void setPalettePredictorBitDepth(ChannelType type, Int u ) { m_palettePredictorBitDepth[type] = u; }
Bool getUsePalettePredictor() const { return m_usePalettePredictor; }
Void setUsePalettePredictor(Bool num) { m_usePalettePredictor = num; }
Bool getMonochromePaletteFlag() const { return m_monochromePaletteFlag; }
Void setMonochromePaletteFlag( Bool b ) { m_monochromePaletteFlag = b; }
Bool getUseIntraBlockCopy() const { return m_useIntraBlockCopyPps; }
Void setUseIntraBlockCopy(Bool value) { m_useIntraBlockCopyPps = value; }
};
/// PPS class
class TComPPS
......@@ -1122,6 +1219,7 @@ private:
Int m_numExtraSliceHeaderBits;
TComPPSRExt m_ppsRangeExtension;
TComPPSSCC m_ppsScreenExtension;
public:
TComPPS();
......@@ -1234,6 +1332,8 @@ public:
const TComPPSRExt& getPpsRangeExtension() const { return m_ppsRangeExtension; }
TComPPSRExt& getPpsRangeExtension() { return m_ppsRangeExtension; }
const TComPPSSCC& getPpsScreenExtension() const { return m_ppsScreenExtension; }
TComPPSSCC& getPpsScreenExtension() { return m_ppsScreenExtension; }
};
struct WPScalingParam
......@@ -1356,6 +1456,12 @@ private:
SliceType m_encCABACTableIdx; // Used to transmit table selection across slices.
Bool m_useIntegerMv;
TComPic* m_pcLastEncPic;
TComPic* m_pcCurPicLongTerm;
Bool m_pcTwoVersionsOfCurrDecPicFlag;
Int m_iSliceACTQpDelta[MAX_NUM_COMPONENT];
public:
TComSlice();
virtual ~TComSlice();
......@@ -1576,6 +1682,19 @@ public:
Void setEncCABACTableIdx( SliceType idx ) { m_encCABACTableIdx = idx; }
SliceType getEncCABACTableIdx() const { return m_encCABACTableIdx; }
Int getSliceActQpDelta(ComponentID compID) const { return m_iSliceACTQpDelta[compID]; }
Void setSliceActQpDelta( ComponentID compID, Int i ) { m_iSliceACTQpDelta[compID] = i; }
Bool isOnlyCurrentPictureAsReference();
Void setRefPOCListSliceHeader();
Void setUseIntegerMv( Bool b ) { m_useIntegerMv = b; }
Bool getUseIntegerMv() const { return m_useIntegerMv; }
TComPic* getLastEncPic() { return m_pcLastEncPic; }
Void setLastEncPic(TComPic *pcPic) { m_pcLastEncPic=pcPic; }
TComPic* getCurPicLongTerm() { return m_pcCurPicLongTerm; }
Void setCurPicLongTerm( TComPic* p ) { m_pcCurPicLongTerm = p; }
Bool getTwoVersionsOfCurrDecPicFlag() { return m_pcTwoVersionsOfCurrDecPicFlag; }
Void setTwoVersionsOfCurrDecPicFlag(Bool b) { m_pcTwoVersionsOfCurrDecPicFlag = b; }
protected:
TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, Int poc);
TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -203,7 +203,8 @@ public:
UInt getNumberValidComponents () const { return ::getNumberValidComponents(m_chromaFormatIDC); }
UInt getComponentScaleX (const ComponentID id) const { return ::getComponentScaleX(id, m_chromaFormatIDC); }
UInt getComponentScaleY (const ComponentID id) const { return ::getComponentScaleY(id, m_chromaFormatIDC); }
Void convert (const Bool extendedPrecision, const UInt pixX, const UInt pixY, const UInt width, Bool bForwardConversion, const BitDepths& bitDepths, Bool bLossless = false, TComYuv* pcYuvNoCorrResi= NULL);
Void DefaultConvertPix(const UInt pixX, const UInt pixY, const UInt width, const BitDepths& bitDepths);
};// END CLASS DEFINITION TComYuv
//! \}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.