Skip to content

Commit

Permalink
Update readme, minor improvements (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjw24 authored Nov 7, 2023
1 parent 40dadd1 commit 2217e10
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 69 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Fraunhofer Versatile Video Encoder (VVenC)
# VVenC

The Fraunhofer Versatile Video Encoder (VVenC) is a fast and efficient H.266/VVC encoder implementation with the following main features:
![VVenC Logo](https://github.com/fraunhoferhhi/vvenc/wiki/img/VVenC_RGB_small.png)

VVenC, the Fraunhofer Versatile Video Encoder, is a fast and efficient software H.266/VVC encoder implementation with the following main features:
- Easy to use encoder implementation with five predefined quality/speed presets;
- Perceptual optimization to improve subjective video quality, based on the XPSNR visual model;
- Extensive frame-level and task-based parallelization with very good scaling;
Expand Down Expand Up @@ -83,3 +85,5 @@ For more information, please contact: [email protected]
**Copyright (c) 2019-2023, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors.**

**All rights reserved.**

**VVenC® is a registered trademark of the Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.**
2 changes: 2 additions & 0 deletions source/Lib/CommonLib/CodingStructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ void CodingStructure::destroyTempBuffers()

// swap the contents of the vector so that memory released
std::vector<Mv>().swap( m_dmvrMvCache );
std::vector<CodingUnit*>().swap( cus );
std::vector<TransformUnit*>().swap( tus );
}

void CodingStructure::addMiToLut( static_vector<HPMVInfo, MAX_NUM_HMVP_CANDS>& lut, const HPMVInfo& mi )
Expand Down
28 changes: 14 additions & 14 deletions source/Lib/CommonLib/DepQuant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,26 @@ namespace DQIntern
};


enum ScanPosType { SCAN_ISCSBB = 0, SCAN_SOCSBB = 1, SCAN_EOCSBB = 2 };
enum ScanPosType : int8_t { SCAN_ISCSBB = 0, SCAN_SOCSBB = 1, SCAN_EOCSBB = 2 };

struct ScanInfo
{
ScanInfo() {}
int sbbSize;
int numSbb;
int scanIdx;
int rasterPos;
int sbbPos;
int insidePos;
short numSbb;
short scanIdx;
short rasterPos;
short sbbPos; // byte
short nextSbbRight;
short nextSbbBelow;
int8_t sbbSize;
int8_t insidePos;
int8_t nextInsidePos;
ScanPosType spt;
unsigned sigCtxOffsetNext;
unsigned gtxCtxOffsetNext;
int nextInsidePos;
int8_t posX;
int8_t posY;
int8_t sigCtxOffsetNext;
int8_t gtxCtxOffsetNext;
NbInfoSbb currNbInfoSbb;
int nextSbbRight;
int nextSbbBelow;
int posX;
int posY;
};

class Rom;
Expand Down
10 changes: 5 additions & 5 deletions source/Lib/CommonLib/MCTF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ const int16_t MCTF::m_interpolationFilter4[16][4] =
{ 0, 4, 62, -2 }, //15-->-->
};

const double MCTF::m_refStrengths[2][4] =
const double MCTF::m_refStrengths[2][6] = // min(..., {3 or 5} / (1 + 2 * |POC offset|))
{ // abs(POC offset)
// 1, 2 3 4
{0.85, 0.57, 0.41, 0.33}, // RA
{1.13, 0.97, 0.81, 0.57 } // LD
// 1 2 3 4 5 6
{ 0.84375, 0.6, 0.4286, 0.3333, 0.2727, 0.2308 }, // RA
{ 1.12500, 1.0, 0.7143, 0.5556, 0.4545, 0.3846 } // LD
};

const int MCTF::m_cuTreeThresh[4] = { 75, 60, 30, 15 };
Expand Down Expand Up @@ -667,7 +667,7 @@ void MCTF::motionEstimationMCTF(Picture* curPic, std::deque<TemporalFilterSource

srcPic.picBuffer.createFromBuf(curPic->getOrigBuf());
srcPic.mvs.allocate(wInBlks, hInBlks);
srcPic.index = std::min(3, std::abs(curPic->poc - m_filterPoc) - 1);
srcPic.index = std::min(5, std::abs(curPic->poc - m_filterPoc) - 1);


{
Expand Down
2 changes: 1 addition & 1 deletion source/Lib/CommonLib/MCTF.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class MCTF : public EncStage
static const int m_padding;
static const int16_t m_interpolationFilter4[16][4];
static const int16_t m_interpolationFilter8[16][8];
static const double m_refStrengths[2][4];
static const double m_refStrengths[2][6];
static const int m_cuTreeThresh[4];
static const double m_cuTreeCenter;

Expand Down
14 changes: 0 additions & 14 deletions source/Lib/CommonLib/TypeDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -834,20 +834,6 @@ class dynamic_cache
return ret;
}

void defragment()
{
m_cache.clear();

for( T* chunk : m_cacheChunks )
{
for( ptrdiff_t p = 0; p < DYN_CACHE_CHUNK_SIZE; p++ )
{
//m_cache.push_back( &chunk[DYN_CACHE_CHUNK_SIZE - p - 1] );
m_cache.push_back( &chunk[p] );
}
}
}

void cache( T* el )
{
m_cache.push_back( el );
Expand Down
1 change: 0 additions & 1 deletion source/Lib/EncoderLib/EncCu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,6 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
}
if (m_pcEncCfg->m_FastIntraTools)
{
m_modeCtrl.comprCUCtx->bestIntraMode = m_cIntraSearch.m_ispTestedModes[0].bestIntraMode;
if (m_cIntraSearch.m_ispTestedModes[0].intraWasTested)
{
m_modeCtrl.comprCUCtx->intraWasTested = m_cIntraSearch.m_ispTestedModes[0].intraWasTested;
Expand Down
21 changes: 8 additions & 13 deletions source/Lib/EncoderLib/EncModeCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,6 @@ void CacheBlkInfoCtrl::init( const Slice &slice )
m_pcv = slice.pps->pcv;
}

CodedCUInfo& CacheBlkInfoCtrl::getBlkInfo( const UnitArea& area )
{
unsigned idx1, idx2, idx3, idx4;
getAreaIdxNew( area.Y(), *m_pcv, idx1, idx2, idx3, idx4 );
// DTRACE( g_trace_ctx, D_TMP, "%d loc %d %d %d %d\n", g_trace_ctx->getChannelCounter(D_TMP), idx1, idx2, idx3, idx4);
return *m_codedCUInfo[idx1][idx2][idx3][idx4];
}

void CacheBlkInfoCtrl::initBlk( const UnitArea& area, int poc )
{
unsigned idx1, idx2, idx3, idx4;
Expand All @@ -168,6 +160,14 @@ void CacheBlkInfoCtrl::initBlk( const UnitArea& area, int poc )
}
}

CodedCUInfo& CacheBlkInfoCtrl::getBlkInfo( const UnitArea& area )
{
unsigned idx1, idx2, idx3, idx4;
getAreaIdxNew( area.Y(), *m_pcv, idx1, idx2, idx3, idx4 );
// DTRACE( g_trace_ctx, D_TMP, "%d loc %d %d %d %d\n", g_trace_ctx->getChannelCounter(D_TMP), idx1, idx2, idx3, idx4);
return *m_codedCUInfo[idx1][idx2][idx3][idx4];
}

void CodedCUInfo::setMv( const RefPicList refPicList, const int iRefIdx, const Mv& rMv )
{
if( iRefIdx >= MAX_STORED_CU_INFO_REFS ) return;
Expand Down Expand Up @@ -1017,7 +1017,6 @@ bool EncModeCtrl::tryMode( const EncTestMode& encTestmode, const CodingStructure
}
if (relatedCU.isIntra)
{
cuECtx.bestIntraMode = relatedCU.bestIntraMode;
cuECtx.isIntra = relatedCU.isIntra;
}
}
Expand Down Expand Up @@ -1135,10 +1134,6 @@ void EncModeCtrl::beforeSplit( Partitioner& partitioner )
relatedCU.isIntra = true;
if (m_pcEncCfg->m_FastIntraTools)
{
if (cuECtx.bestCS->cost < relatedCU.bestCost)
{
relatedCU.bestIntraMode = cuECtx.bestIntraMode;
}
if ( cuECtx.intraWasTested && (!relatedCU.relatedCuIsValid || cuECtx.bestCS->cost < relatedCU.bestCost))
{
relatedCU.bestCost = cuECtx.bestCS->cost;
Expand Down
32 changes: 14 additions & 18 deletions source/Lib/EncoderLib/EncModeCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ struct ComprCUCtx
, skipSecondMTSPass (false)
, intraWasTested (false)
, relatedCuIsValid (false)
, bestIntraMode (0)
, isIntra (false)
, nonSkipWasTested (false)
{
Expand Down Expand Up @@ -247,7 +246,6 @@ struct ComprCUCtx
bool skipSecondMTSPass;
bool intraWasTested;
bool relatedCuIsValid;
int bestIntraMode;
bool isIntra;
bool nonSkipWasTested;
};
Expand All @@ -260,22 +258,20 @@ static const int MAX_STORED_CU_INFO_REFS = 4;

struct CodedCUInfo
{
bool isInter;
bool isIntra;
bool isSkip;
bool isMMVDSkip;
int isMergeSimple;
bool isIBC;
uint8_t BcwIdx;
int ctuRsAddr, poc;
uint8_t numPuInfoStored;
bool validMv [NUM_REF_PIC_LIST_01][MAX_STORED_CU_INFO_REFS];
Mv saveMv [NUM_REF_PIC_LIST_01][MAX_STORED_CU_INFO_REFS];
uint32_t puSse[SBT_NUM_SL];
uint8_t puSbt[SBT_NUM_SL];
double bestCost;
bool relatedCuIsValid;
int bestIntraMode;
bool relatedCuIsValid;
bool isInter;
bool isIntra;
bool isSkip;
bool isMMVDSkip;
bool isIBC;
uint8_t BcwIdx;
uint8_t numPuInfoStored;
int poc, ctuRsAddr;
bool validMv[NUM_REF_PIC_LIST_01][MAX_STORED_CU_INFO_REFS];
Mv saveMv [NUM_REF_PIC_LIST_01][MAX_STORED_CU_INFO_REFS];
uint32_t puSse [SBT_NUM_SL];
uint8_t puSbt [SBT_NUM_SL];
double bestCost;

bool getMv ( const RefPicList refPicList, const int iRefIdx, Mv& rMv ) const;
void setMv ( const RefPicList refPicList, const int iRefIdx, const Mv& rMv );
Expand Down
2 changes: 1 addition & 1 deletion source/Lib/vvenc/vvencimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ std::string VVEncImpl::createEncoderInfoStr()


std::string cInfoStr;
cInfoStr = "Fraunhofer VVC Encoder ver. " VVENC_VERSION;
cInfoStr = "VVenC, the Fraunhofer H.266/VVC Encoder, version " VVENC_VERSION;
cInfoStr += " ";
cInfoStr += cssCap.str();

Expand Down

0 comments on commit 2217e10

Please sign in to comment.