[x265] [PATCH] tenccfg : move Tool list config params from tenccfg to x265_param structure
Gopu Govindaswamy
gopu at multicorewareinc.com
Mon Oct 28 11:07:58 CET 2013
# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1382954866 -19800
# Node ID ebca77b70ffdbd76b1c853a29e2b6536d1160ce6
# Parent 68042ac00ad6af0d9d7d85654e8c9968809ce8ce
tenccfg : move Tool list config params from tenccfg to x265_param structure
diff -r 68042ac00ad6 -r ebca77b70ffd source/Lib/TLibEncoder/TEncCfg.h
--- a/source/Lib/TLibEncoder/TEncCfg.h Mon Oct 28 15:08:49 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncCfg.h Mon Oct 28 15:37:46 2013 +0530
@@ -89,25 +89,6 @@
//====== Quality control ========
int m_maxCuDQPDepth; // Max. depth for a minimum CuDQP (0:default)
- //====== Tool list ========
- bool m_bUseASR;
- bool m_usePCM;
- UInt m_pcmLog2MaxSize;
- UInt m_pcmLog2MinSize;
-
- bool m_bPCMInputBitDepthFlag;
- UInt m_pcmBitDepthLuma;
- UInt m_pcmBitDepthChroma;
- bool m_bPCMFilterDisableFlag;
- bool m_loopFilterAcrossTilesEnabledFlag;
-
- int m_bufferingPeriodSEIEnabled;
- int m_pictureTimingSEIEnabled;
- int m_recoveryPointSEIEnabled;
- int m_displayOrientationSEIAngle;
- int m_gradualDecodingRefreshInfoEnabled;
- int m_decodingUnitInfoSEIEnabled;
-
//====== Weighted Prediction ========
UInt m_log2ParallelMergeLevelMinus2; ///< Parallel merge estimation region
@@ -183,33 +164,6 @@
//====== Lossless ========
bool getUseLossless() { return m_useLossless; }
- //==== Tool list ========
- bool getUseASR() { return m_bUseASR; }
-
- bool getPCMInputBitDepthFlag() { return m_bPCMInputBitDepthFlag; }
-
- bool getPCMFilterDisableFlag() { return m_bPCMFilterDisableFlag; }
-
- bool getUsePCM() { return m_usePCM; }
-
- UInt getPCMLog2MaxSize() { return m_pcmLog2MaxSize; }
-
- UInt getPCMLog2MinSize() { return m_pcmLog2MinSize; }
-
- bool getLFCrossTileBoundaryFlag() { return m_loopFilterAcrossTilesEnabledFlag; }
-
- int getBufferingPeriodSEIEnabled() { return m_bufferingPeriodSEIEnabled; }
-
- int getPictureTimingSEIEnabled() { return m_pictureTimingSEIEnabled; }
-
- int getRecoveryPointSEIEnabled() { return m_recoveryPointSEIEnabled; }
-
- int getDisplayOrientationSEIAngle() { return m_displayOrientationSEIAngle; }
-
- int getGradualDecodingRefreshInfoEnabled() { return m_gradualDecodingRefreshInfoEnabled; }
-
- int getDecodingUnitInfoSEIEnabled() { return m_decodingUnitInfoSEIEnabled; }
-
UInt getLog2ParallelMergeLevelMinus2() { return m_log2ParallelMergeLevelMinus2; }
int getUseScalingListId() { return m_useScalingListId; }
diff -r 68042ac00ad6 -r ebca77b70ffd source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Mon Oct 28 15:08:49 2013 +0530
+++ b/source/encoder/encoder.cpp Mon Oct 28 15:37:46 2013 +0530
@@ -712,9 +712,9 @@
sps->setLog2MinCodingBlockSize(log2MinCUSize);
sps->setLog2DiffMaxMinCodingBlockSize(sps->getMaxCUDepth() - g_addCUDepth);
- sps->setPCMLog2MinSize(m_pcmLog2MinSize);
- sps->setUsePCM(m_usePCM);
- sps->setPCMLog2MaxSize(m_pcmLog2MaxSize);
+ sps->setPCMLog2MinSize(param.pcmLog2MinSize);
+ sps->setUsePCM(param.busePCM);
+ sps->setPCMLog2MaxSize(param.pcmLog2MaxSize);
sps->setQuadtreeTULog2MaxSize(m_quadtreeTULog2MaxSize);
sps->setQuadtreeTULog2MinSize(m_quadtreeTULog2MinSize);
@@ -759,7 +759,7 @@
sps->setPCMBitDepthLuma(X265_DEPTH);
sps->setPCMBitDepthChroma(X265_DEPTH);
- sps->setPCMFilterDisableFlag(m_bPCMFilterDisableFlag);
+ sps->setPCMFilterDisableFlag(param.bPCMFilterDisableFlag);
sps->setScalingListFlag((m_useScalingListId == 0) ? 0 : 1);
@@ -857,7 +857,7 @@
pps->setTransquantBypassEnableFlag(getTransquantBypassEnableFlag());
pps->setUseTransformSkip(param.bEnableTransformSkip);
- pps->setLoopFilterAcrossTilesEnabledFlag(m_loopFilterAcrossTilesEnabledFlag);
+ pps->setLoopFilterAcrossTilesEnabledFlag(param.bloopFilterAcrossTilesEnabledFlag);
}
void Encoder::determineLevelAndProfile(x265_param *_param)
@@ -1060,7 +1060,7 @@
param.loopFilterOffsetInPPS = 0;
param.loopFilterBetaOffsetDiv2 = 0;
param.loopFilterTcOffsetDiv2 = 0;
- m_loopFilterAcrossTilesEnabledFlag = 1;
+ param.bloopFilterAcrossTilesEnabledFlag = 1;
//====== HM Settings not exposed for configuration ======
TComVPS vps;
@@ -1122,13 +1122,13 @@
m_interlacedSourceFlag = false;
m_nonPackedConstraintFlag = false;
m_frameOnlyConstraintFlag = false;
- m_bUseASR = false; // adapt search range based on temporal distances
- m_recoveryPointSEIEnabled = 0;
- m_bufferingPeriodSEIEnabled = 0;
- m_pictureTimingSEIEnabled = 0;
- m_displayOrientationSEIAngle = 0;
- m_gradualDecodingRefreshInfoEnabled = 0;
- m_decodingUnitInfoSEIEnabled = 0;
+ param.bUseASR = false; // adapt search range based on temporal distances
+ param.recoveryPointSEIEnabled = 0;
+ param.bufferingPeriodSEIEnabled = 0;
+ param.pictureTimingSEIEnabled = 0;
+ param.displayOrientationSEIAngle = 0;
+ param.gradualDecodingRefreshInfoEnabled = 0;
+ param.decodingUnitInfoSEIEnabled = 0;
m_useScalingListId = 0;
m_activeParameterSetsSEIEnabled = 0;
m_vuiParametersPresentFlag = false;
@@ -1158,11 +1158,11 @@
m_maxBitsPerMinCuDenom = 1;
m_log2MaxMvLengthHorizontal = 15;
m_log2MaxMvLengthVertical = 15;
- m_usePCM = 0;
- m_pcmLog2MinSize = 3;
- m_pcmLog2MaxSize = 5;
- m_bPCMInputBitDepthFlag = true;
- m_bPCMFilterDisableFlag = false;
+ param.busePCM = 0;
+ param.pcmLog2MinSize = 3;
+ param.pcmLog2MaxSize = 5;
+ param.bPCMInputBitDepthFlag = true;
+ param.bPCMFilterDisableFlag = false;
m_useLossless = false; // x264 configures this via --qp=0
m_TransquantBypassEnableFlag = false;
diff -r 68042ac00ad6 -r ebca77b70ffd source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Mon Oct 28 15:08:49 2013 +0530
+++ b/source/encoder/frameencoder.cpp Mon Oct 28 15:37:46 2013 +0530
@@ -136,11 +136,11 @@
top->initPPS(&m_pps);
m_sps.setNumLongTermRefPicSPS(0);
- if (m_cfg->getPictureTimingSEIEnabled() || m_cfg->getDecodingUnitInfoSEIEnabled())
+ if (m_cfg->param.pictureTimingSEIEnabled || m_cfg->param.decodingUnitInfoSEIEnabled)
{
m_sps.setHrdParameters(m_cfg->param.frameRate, 0, m_cfg->param.rc.bitrate, m_cfg->param.bframes > 0);
}
- if (m_cfg->getBufferingPeriodSEIEnabled() || m_cfg->getPictureTimingSEIEnabled() || m_cfg->getDecodingUnitInfoSEIEnabled())
+ if (m_cfg->param.bufferingPeriodSEIEnabled || m_cfg->param.pictureTimingSEIEnabled || m_cfg->param.decodingUnitInfoSEIEnabled)
{
m_sps.getVuiParameters()->setHrdParametersPresentFlag(true);
}
@@ -228,13 +228,13 @@
count++;
}
- if (m_cfg->getDisplayOrientationSEIAngle())
+ if (m_cfg->param.displayOrientationSEIAngle)
{
SEIDisplayOrientation sei;
sei.cancelFlag = false;
sei.horFlip = false;
sei.verFlip = false;
- sei.anticlockwiseRotation = m_cfg->getDisplayOrientationSEIAngle();
+ sei.anticlockwiseRotation = m_cfg->param.displayOrientationSEIAngle;
nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
entropyCoder->setBitstream(&nalu.m_Bitstream);
@@ -372,7 +372,7 @@
TComOutputBitstream* bitstreamRedirect = new TComOutputBitstream;
TComOutputBitstream* outStreams = new TComOutputBitstream[numSubstreams];
- if (m_cfg->getUseASR() && !slice->isIntra())
+ if (m_cfg->param.bUseASR && !slice->isIntra())
{
int pocCurr = slice->getPOC();
int maxSR = m_cfg->param.searchRange;
@@ -491,9 +491,9 @@
}
m_wp.xRestoreWPparam(slice);
- if ((m_cfg->getRecoveryPointSEIEnabled()) && (slice->getSliceType() == I_SLICE))
+ if ((m_cfg->param.recoveryPointSEIEnabled) && (slice->getSliceType() == I_SLICE))
{
- if (m_cfg->getGradualDecodingRefreshInfoEnabled() && !slice->getRapPicFlag())
+ if (m_cfg->param.gradualDecodingRefreshInfoEnabled && !slice->getRapPicFlag())
{
// Gradual decoding refresh SEI
OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
diff -r 68042ac00ad6 -r ebca77b70ffd source/x265.h
--- a/source/x265.h Mon Oct 28 15:08:49 2013 +0530
+++ b/source/x265.h Mon Oct 28 15:37:46 2013 +0530
@@ -340,6 +340,25 @@
int loopFilterTcOffsetDiv2;
int maxNumOffsetsPerPic;
+ //====== Tool list ==================
+ bool bUseASR;
+ bool busePCM;
+ uint32_t pcmLog2MaxSize;
+ uint32_t pcmLog2MinSize;
+
+ bool bPCMInputBitDepthFlag;
+ uint32_t pcmBitDepthLuma;
+ uint32_t pcmBitDepthChroma;
+ bool bPCMFilterDisableFlag;
+ bool bloopFilterAcrossTilesEnabledFlag;
+
+ int bufferingPeriodSEIEnabled;
+ int pictureTimingSEIEnabled;
+ int recoveryPointSEIEnabled;
+ int displayOrientationSEIAngle;
+ int gradualDecodingRefreshInfoEnabled;
+ int decodingUnitInfoSEIEnabled;
+
} x265_param;
/***
More information about the x265-devel
mailing list