Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many fixes (FGA, 16K, segment parallel encoding, MacOS installation, use static PPS) #407

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
* Gabriel Hege, , Fraunhofer HHI
* Jens Güther, , Fraunhofer HHI
* Florian Eisenreich, , Fraunhofer HHI
* Hossein Pejman, , École de technologie supérieure (ÉTS)
* Hossein Pejman, , École de technologie supérieure (ÉTS)
* Vignesh V Menon, , Fraunhofer HHI
6 changes: 3 additions & 3 deletions include/vvenc/vvencCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,9 @@ typedef struct vvenc_config
int m_colourPrimaries; // Indicates chromaticity coordinates of the source primaries
int m_transferCharacteristics; // Indicates the opto-electronic transfer characteristics of the source
int m_matrixCoefficients; // Describes the matrix coefficients used in deriving luma and chroma from RGB primaries
bool m_chromaLocInfoPresent; // Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present
int m_chromaSampleLocTypeTopField; // Specifies the location of chroma samples for top field
int m_chromaSampleLocTypeBottomField; // Specifies the location of chroma samples for bottom field
int8_t m_chromaLocInfoPresent; // Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present
int m_cfgUnused26; // TODO: remove unused memory from configuration
int m_cfgUnused27; // TODO: remove unused memory from configuration
int m_chromaSampleLocType; // Specifies the location of chroma samples for progressive content
bool m_overscanInfoPresent; // Signals whether overscan_appropriate_flag is present
bool m_overscanAppropriateFlag; // Indicates whether conformant decoded pictures are suitable for display using overscan
Expand Down
144 changes: 72 additions & 72 deletions source/Lib/CommonLib/Picture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,58 +149,56 @@ void BlkStat::setSliceMaxBT( Slice& slice )


Picture::Picture()
: cs ( nullptr )
, vps ( nullptr )
, dci ( nullptr )
, picApsMap ( MAX_NUM_APS * MAX_NUM_APS_TYPE )
, isInitDone ( false )
, isReconstructed ( false )
, isBorderExtended ( false )
, isReferenced ( false )
, isNeededForOutput ( false )
, isFinished ( false )
, isLongTerm ( false )
, isFlush ( false )
, isInProcessList ( false )
, precedingDRAP ( false )
, gopEntry ( nullptr )
, refCounter ( 0 )
, poc ( 0 )
, TLayer ( std::numeric_limits<uint32_t>::max() )
, layerId ( 0 )
: cs ( nullptr )
, vps ( nullptr )
, dci ( nullptr )
, picApsMap ( MAX_NUM_APS * MAX_NUM_APS_TYPE )
, isInitDone ( false )
, isReconstructed ( false )
, isBorderExtended ( false )
, isReferenced ( false )
, isNeededForOutput ( false )
, isFinished ( false )
, isLongTerm ( false )
, isFlush ( false )
, isInProcessList ( false )
, precedingDRAP ( false )
, gopEntry ( nullptr )
, refCounter ( 0 )
, poc ( 0 )
, TLayer ( std::numeric_limits<uint32_t>::max() )
, layerId ( 0 )
, isSubPicBorderSaved (false)
, sliceDataNumBins ( 0 )
, cts ( 0 )
, ctsValid ( false )
, isPreAnalysis ( false )
, m_picShared ( nullptr )
, gopAdaptedQP ( 0 )
, sliceDataNumBins ( 0 )
, cts ( 0 )
, ctsValid ( false )
, isPreAnalysis ( false )
, m_picShared ( nullptr )
, gopAdaptedQP ( 0 )
, isSceneCutGOP ( false )
, isSceneCutCheckAdjQP( false )
, isMeanQPLimited ( false )
, picInitialQP ( -1 )
, picInitialLambda ( -1.0 )
, picMemorySTA ( -1 )
, picVisActTL0 ( 0 )
, picVisActY ( 0 )
, picSpVisAct ( 0 )
, isSccWeak ( false )
, isSccStrong ( false )
, useME ( false )
, useMCTF ( false )
, useTS ( false )
, useBDPCM ( false )
, useIBC ( false )
, useLMCS ( false )
, useSAO ( false )
, useNumRefs ( false )
, useFastMrg ( 0 )
, useQtbttSpeedUpMode( 0 )
, actualHeadBits ( 0 )
, actualTotalBits ( 0 )
, encRCPic ( nullptr )
, picApsGlobal ( nullptr )
, refApsGlobal ( nullptr )
, isMeanQPLimited ( false )
, picInitialQP ( -1 )
, picInitialLambda ( -1.0 )
, picMemorySTA ( -1 )
, picVA ()
, isSccWeak ( false )
, isSccStrong ( false )
, useME ( false )
, useMCTF ( false )
, useTS ( false )
, useBDPCM ( false )
, useIBC ( false )
, useLMCS ( false )
, useSAO ( false )
, useNumRefs ( false )
, useFastMrg ( 0 )
, useQtbttSpeedUpMode ( 0 )
, actualHeadBits ( 0 )
, actualTotalBits ( 0 )
, encRCPic ( nullptr )
, picApsGlobal ( nullptr )
, refApsGlobal ( nullptr )
{
std::fill_n( m_sharedBufs, (int)NUM_PIC_TYPES, nullptr );
std::fill_n( m_bufsOrigPrev, NUM_QPA_PREV_FRAMES, nullptr );
Expand All @@ -221,34 +219,36 @@ void Picture::create( ChromaFormat _chromaFormat, const Size& size, unsigned _ma
void Picture::reset()
{
// reset picture
isInitDone = false;
isReconstructed = false;
isBorderExtended = false;
isReferenced = true;
isNeededForOutput = true;
isFinished = false;
isLongTerm = false;
isFlush = false;
isInProcessList = false;
isMeanQPLimited = false;
precedingDRAP = false;

gopEntry = nullptr;
refCounter = 0;
poc = -1;
TLayer = std::numeric_limits<uint32_t>::max();
gopAdaptedQP = 0;
isInitDone = false;
isReconstructed = false;
isBorderExtended = false;
isReferenced = true;
isNeededForOutput = true;
isFinished = false;
isLongTerm = false;
isFlush = false;
isInProcessList = false;
isMeanQPLimited = false;
precedingDRAP = false;

gopEntry = nullptr;
refCounter = 0;
poc = -1;
TLayer = std::numeric_limits<uint32_t>::max();
gopAdaptedQP = 0;
isSceneCutGOP = false;
isSceneCutCheckAdjQP = false;
actualHeadBits = 0;
actualTotalBits = 0;
encRCPic = nullptr;
picApsGlobal = nullptr;
refApsGlobal = nullptr;
actualHeadBits = 0;
actualTotalBits = 0;
encRCPic = nullptr;
picApsGlobal = nullptr;
refApsGlobal = nullptr;

picVA.reset();

std::fill_n( m_sharedBufs, (int)NUM_PIC_TYPES, nullptr );
std::fill_n( m_bufsOrigPrev, NUM_QPA_PREV_FRAMES, nullptr );

if( m_tileColsDone )
std::fill( m_tileColsDone->begin(), m_tileColsDone->end(), 0 );

Expand Down
20 changes: 17 additions & 3 deletions source/Lib/CommonLib/Picture.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ struct StopClock
};


struct PicVisAct
{
PicVisAct()
: spatAct { 0, 0 }
, prevTL0spatAct{ 0, 0 }
, visAct ( 0 )
, visActTL0 ( 0 )
{
}
void reset() { *this = PicVisAct(); }
uint16_t spatAct[MAX_NUM_CH];
uint16_t prevTL0spatAct[MAX_NUM_CH];
uint16_t visAct;
uint16_t visActTL0;
};

struct Picture;

class BlkStat
Expand Down Expand Up @@ -248,9 +264,7 @@ struct Picture : public UnitArea
int picInitialQP;
double picInitialLambda;
int16_t picMemorySTA;
uint16_t picVisActTL0;
uint16_t picVisActY;
uint16_t picSpVisAct;
PicVisAct picVA;
double psnr[MAX_NUM_COMP];
double mse [MAX_NUM_COMP];

Expand Down
7 changes: 7 additions & 0 deletions source/Lib/CommonLib/ProfileLevelTier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ const ProfileFeatures *ProfileFeatures::getProfileFeatures(const vvencProfile p)
return &validProfiles[i];
}

vvencLevel LevelTierFeatures::getMaxLevel(vvencProfile profile)
{
const ProfileFeatures* pf = ProfileFeatures::getProfileFeatures( profile );
vvencLevel maxLevel = ( pf && pf->canUseLevel15p5 ) ? vvencLevel::VVENC_LEVEL15_5 : vvencLevel::VVENC_LEVEL6_3;
return maxLevel;
}

vvencLevel LevelTierFeatures::getLevelForInput( uint32_t width, uint32_t height, bool tier, int temporalRate, int temporalScale, int bitrate )
{
uint64_t samplesPerSec = ((uint64_t)temporalRate*(uint64_t)width*(uint64_t)height)/temporalScale;
Expand Down
1 change: 1 addition & 0 deletions source/Lib/CommonLib/ProfileLevelTier.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct LevelTierFeatures
uint32_t getMaxPicWidthInLumaSamples() const;
uint32_t getMaxPicHeightInLumaSamples() const;

static vvencLevel getMaxLevel(vvencProfile profile);
static vvencLevel getLevelForInput( uint32_t width, uint32_t height, bool tier, int temporalRate, int temporalScale, int bitrate );
static void getMaxTileColsRowsPerLevel( vvencLevel level, uint32_t &maxCols, uint32_t &maxRows );
};
Expand Down
Loading