Commit 0bbacce1 authored by Karl Sharman's avatar Karl Sharman
Browse files

Add hooks for 360degree library

parent 72c4d084
......@@ -56,6 +56,16 @@ DYN_RELEASE_PREREQS = $(LIB_DIR)/libTLibEncoder$(HBD).a $(LIB_DIR)/libTLibCommon
STAT_RELEASE_LIBS = -lTLibEncoder$(HBD)Static -lTLibCommon$(HBD)Static -lTLibVideoIO$(HBD)Static -lTAppCommon$(HBD)Static
STAT_RELEASE_PREREQS = $(LIB_DIR)/libTLibEncoder$(HBD)Static.a $(LIB_DIR)/libTLibCommon$(HBD)Static.a $(LIB_DIR)/libTLibVideoIO$(HBD)Static.a $(LIB_DIR)/libTAppCommon$(HBD)Static.a
ifeq ($(EXTENSION_360_VIDEO), 1)
DYN_DEBUG_LIBS += -lTAppEncHelper360$(HBD)d -lTLib360$(HBD)d
DYN_DEBUG_PREREQS += $(LIB_DIR)/libTAppEncHelper360$(HBD)d.a $(LIB_DIR)/libTLib360$(HBD)d.a
STAT_DEBUG_LIBS += -lTAppEncHelper360$(HBD)Staticd -lTLib360$(HBD)Staticd
STAT_DEBUG_PREREQS += $(LIB_DIR)/libTAppEncHelper360$(HBD)Staticd.a $(LIB_DIR)/libTLib360$(HBD)Staticd.a
DYN_RELEASE_LIBS += -lTAppEncHelper360$(HBD) -lTLib360$(HBD)
DYN_RELEASE_PREREQS += $(LIB_DIR)/libTAppEncHelper360$(HBD).a $(LIB_DIR)/libTLib360$(HBD).a
STAT_RELEASE_LIBS += -lTAppEncHelper360$(HBD)Static -lTLib360$(HBD)Static
STAT_RELEASE_PREREQS+= $(LIB_DIR)/libTAppEncHelper360$(HBD)Static.a $(LIB_DIR)/libTLib360$(HBD)Static.a
endif
# name of the base makefile
MAKE_FILE_NAME = ../../common/makefile.base
......
......@@ -62,6 +62,12 @@ ifeq ($(HIGHBITDEPTH), 1)
CPPFLAGS+="-DRExt__HIGH_BIT_DEPTH_SUPPORT=1"
endif
ifeq ($(EXTENSION_360_VIDEO), 1)
CPPFLAGS+=-DEXTENSION_360_VIDEO=1
else
CPPFLAGS+=-DEXTENSION_360_VIDEO=0
endif
#
# debug cpp flags
DEBUG_CPPFLAGS = -g -D_DEBUG
......
......@@ -3,100 +3,139 @@ M32?= 0
export M32
EXTENSION_360_VIDEO?=0
export EXTENSION_360_VIDEO
all:
$(MAKE) -C lib/TLibVideoIO MM32=$(M32)
$(MAKE) -C lib/TLibCommon MM32=$(M32)
$(MAKE) -C lib/TLibDecoder MM32=$(M32)
$(MAKE) -C lib/TLibEncoder MM32=$(M32)
$(MAKE) -C lib/TAppCommon MM32=$(M32)
$(MAKE) -C app/TAppDecoder MM32=$(M32)
$(MAKE) -C app/TAppEncoder MM32=$(M32)
$(MAKE) -C utils/annexBbytecount MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser MM32=$(M32)
$(MAKE) -C lib/TLibVideoIO MM32=$(M32)
$(MAKE) -C lib/TLibCommon MM32=$(M32)
$(MAKE) -C lib/TLibDecoder MM32=$(M32)
$(MAKE) -C lib/TLibEncoder MM32=$(M32)
$(MAKE) -C lib/TAppCommon MM32=$(M32)
@if [ $(EXTENSION_360_VIDEO) -eq 1 ] ; then \
$(MAKE) -C lib/TLib360 MM32=$(M32) ; \
$(MAKE) -C lib/TAppEncHelper360 MM32=$(M32) ; \
$(MAKE) -C app/TApp360Convert MM32=$(M32) ; \
fi
$(MAKE) -C app/TAppDecoder MM32=$(M32)
$(MAKE) -C app/TAppEncoder MM32=$(M32)
$(MAKE) -C utils/annexBbytecount MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser MM32=$(M32)
$(MAKE) -C app/TAppDecoderAnalyser MM32=$(M32)
debug:
$(MAKE) -C lib/TLibVideoIO debug MM32=$(M32)
$(MAKE) -C lib/TLibCommon debug MM32=$(M32)
$(MAKE) -C lib/TLibDecoder debug MM32=$(M32)
$(MAKE) -C lib/TLibEncoder debug MM32=$(M32)
$(MAKE) -C lib/TAppCommon debug MM32=$(M32)
$(MAKE) -C app/TAppDecoder debug MM32=$(M32)
$(MAKE) -C app/TAppEncoder debug MM32=$(M32)
$(MAKE) -C utils/annexBbytecount debug MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr debug MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser debug MM32=$(M32)
$(MAKE) -C lib/TLibVideoIO debug MM32=$(M32)
$(MAKE) -C lib/TLibCommon debug MM32=$(M32)
$(MAKE) -C lib/TLibDecoder debug MM32=$(M32)
$(MAKE) -C lib/TLibEncoder debug MM32=$(M32)
$(MAKE) -C lib/TAppCommon debug MM32=$(M32)
@if [ $(EXTENSION_360_VIDEO) -eq 1 ] ; then \
$(MAKE) -C lib/TLib360 debug MM32=$(M32) ; \
$(MAKE) -C lib/TAppEncHelper360 debug MM32=$(M32) ; \
$(MAKE) -C app/TApp360Convert debug MM32=$(M32) ; \
fi
$(MAKE) -C app/TAppDecoder debug MM32=$(M32)
$(MAKE) -C app/TAppEncoder debug MM32=$(M32)
$(MAKE) -C utils/annexBbytecount debug MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr debug MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser debug MM32=$(M32)
$(MAKE) -C app/TAppDecoderAnalyser debug MM32=$(M32)
release:
$(MAKE) -C lib/TLibVideoIO release MM32=$(M32)
$(MAKE) -C lib/TLibCommon release MM32=$(M32)
$(MAKE) -C lib/TLibDecoder release MM32=$(M32)
$(MAKE) -C lib/TLibEncoder release MM32=$(M32)
$(MAKE) -C lib/TAppCommon release MM32=$(M32)
$(MAKE) -C app/TAppDecoder release MM32=$(M32)
$(MAKE) -C app/TAppEncoder release MM32=$(M32)
$(MAKE) -C utils/annexBbytecount release MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr release MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser release MM32=$(M32)
$(MAKE) -C lib/TLibVideoIO release MM32=$(M32)
$(MAKE) -C lib/TLibCommon release MM32=$(M32)
$(MAKE) -C lib/TLibDecoder release MM32=$(M32)
$(MAKE) -C lib/TLibEncoder release MM32=$(M32)
$(MAKE) -C lib/TAppCommon release MM32=$(M32)
@if [ $(EXTENSION_360_VIDEO) -eq 1 ] ; then \
$(MAKE) -C lib/TLib360 release MM32=$(M32) ; \
$(MAKE) -C lib/TAppEncHelper360 release MM32=$(M32) ; \
$(MAKE) -C app/TApp360Convert release MM32=$(M32) ; \
fi
$(MAKE) -C app/TAppDecoder release MM32=$(M32)
$(MAKE) -C app/TAppEncoder release MM32=$(M32)
$(MAKE) -C utils/annexBbytecount release MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr release MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser release MM32=$(M32)
$(MAKE) -C app/TAppDecoderAnalyser release MM32=$(M32)
clean: clean_highbitdepth
$(MAKE) -C lib/TLibVideoIO clean MM32=$(M32)
$(MAKE) -C lib/TLibCommon clean MM32=$(M32)
$(MAKE) -C lib/TLibDecoder clean MM32=$(M32)
$(MAKE) -C lib/TLibEncoder clean MM32=$(M32)
$(MAKE) -C lib/TAppCommon clean MM32=$(M32)
$(MAKE) -C app/TAppDecoder clean MM32=$(M32)
$(MAKE) -C app/TAppEncoder clean MM32=$(M32)
$(MAKE) -C utils/annexBbytecount clean MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr clean MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser clean MM32=$(M32)
$(MAKE) -C lib/TLibVideoIO clean MM32=$(M32)
$(MAKE) -C lib/TLibCommon clean MM32=$(M32)
$(MAKE) -C lib/TLibDecoder clean MM32=$(M32)
$(MAKE) -C lib/TLibEncoder clean MM32=$(M32)
$(MAKE) -C lib/TAppCommon clean MM32=$(M32)
$(MAKE) -C lib/TLib360 clean MM32=$(M32)
$(MAKE) -C lib/TAppEncHelper360 clean MM32=$(M32)
$(MAKE) -C app/TApp360Convert clean MM32=$(M32)
$(MAKE) -C app/TAppDecoder clean MM32=$(M32)
$(MAKE) -C app/TAppEncoder clean MM32=$(M32)
$(MAKE) -C utils/annexBbytecount clean MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr clean MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser clean MM32=$(M32)
$(MAKE) -C app/TAppDecoderAnalyser clean MM32=$(M32)
all_highbitdepth:
$(MAKE) -C lib/TLibVideoIO MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibVideoIO MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon MM32=$(M32) HIGHBITDEPTH=1
@if [ $(EXTENSION_360_VIDEO) -eq 1 ] ; then \
$(MAKE) -C lib/TLib360 MM32=$(M32) HIGHBITDEPTH=1 ; \
$(MAKE) -C lib/TAppEncHelper360 MM32=$(M32) HIGHBITDEPTH=1 ; \
$(MAKE) -C app/TApp360Convert MM32=$(M32) HIGHBITDEPTH=1 ; \
fi
$(MAKE) -C app/TAppDecoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser MM32=$(M32) HIGHBITDEPTH=1
debug_highbitdepth:
$(MAKE) -C lib/TLibVideoIO debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibVideoIO debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon debug MM32=$(M32) HIGHBITDEPTH=1
@if [ $(EXTENSION_360_VIDEO) -eq 1 ] ; then \
$(MAKE) -C lib/TLib360 debug MM32=$(M32) HIGHBITDEPTH=1 ; \
$(MAKE) -C lib/TAppEncHelper360 debug MM32=$(M32) HIGHBITDEPTH=1 ; \
$(MAKE) -C app/TApp360Convert debug MM32=$(M32) HIGHBITDEPTH=1 ; \
fi
$(MAKE) -C app/TAppDecoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser debug MM32=$(M32) HIGHBITDEPTH=1
release_highbitdepth:
$(MAKE) -C lib/TLibVideoIO release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibVideoIO release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon release MM32=$(M32) HIGHBITDEPTH=1
@if [ $(EXTENSION_360_VIDEO) -eq 1 ] ; then \
$(MAKE) -C lib/TLib360 release MM32=$(M32) HIGHBITDEPTH=1 ; \
$(MAKE) -C lib/TAppEncHelper360 release MM32=$(M32) HIGHBITDEPTH=1 ; \
$(MAKE) -C app/TApp360Convert release MM32=$(M32) HIGHBITDEPTH=1 ; \
fi
$(MAKE) -C app/TAppDecoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser release MM32=$(M32) HIGHBITDEPTH=1
clean_highbitdepth:
$(MAKE) -C lib/TLibVideoIO clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibVideoIO clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibCommon clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibEncoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppCommon clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLib360 clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TAppEncHelper360 clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TApp360Convert clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser clean MM32=$(M32) HIGHBITDEPTH=1
everything: all all_highbitdepth
......@@ -105,6 +105,9 @@ TAppEncCfg::TAppEncCfg()
: m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
, m_snrInternalColourSpace(false)
, m_outputInternalColourSpace(false)
#if EXTENSION_360_VIDEO
, m_ext360(*this)
#endif
{
m_aidQP = NULL;
m_startOfCodedInterval = NULL;
......@@ -1062,6 +1065,11 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
("SEIXSDMetricType", m_xsdMetricType, 0u, "Value for the xsd_metric_type indicates the type of the objective quality metric. PSNR is the only type currently supported")
;
#if EXTENSION_360_VIDEO
TExt360AppEncCfg::TExt360AppEncCfgContext ext360CfgContext;
m_ext360.addOptions(opts, ext360CfgContext);
#endif
for(Int i=1; i<MAX_GOP+1; i++)
{
std::ostringstream cOSS;
......@@ -1096,6 +1104,8 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
/*
* Set any derived parameters
*/
m_inputFileWidth = m_iSourceWidth;
m_inputFileHeight = m_iSourceHeight;
m_framesToBeEncoded = ( m_framesToBeEncoded + m_temporalSubsampleRatio - 1 ) / m_temporalSubsampleRatio;
m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values;
......@@ -1194,6 +1204,10 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat);
m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));
#if EXTENSION_360_VIDEO
m_ext360.processOptions(ext360CfgContext);
#endif
assert(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION);
if (!(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION))
{
......@@ -2368,6 +2382,10 @@ Void TAppEncCfg::xCheckParameter()
xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255.");
#if EXTENSION_360_VIDEO
check_failed |= m_ext360.verifyParameters();
#endif
#undef xConfirmPara
if (check_failed)
{
......@@ -2572,6 +2590,10 @@ Void TAppEncCfg::xPrintParameter()
printf(" SignBitHidingFlag:%d ", m_signDataHidingEnabledFlag);
printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
#if EXTENSION_360_VIDEO
m_ext360.outputConfigurationSummary();
#endif
printf("\n\n");
fflush(stdout);
......
......@@ -41,6 +41,9 @@
#include "TLibCommon/CommonDef.h"
#include "TLibEncoder/TEncCfg.h"
#if EXTENSION_360_VIDEO
#include "TAppEncHelper360/TExt360AppEncCfg.h"
#endif
#include <sstream>
#include <vector>
//! \ingroup TAppEncoder
......@@ -70,6 +73,8 @@ protected:
UInt m_temporalSubsampleRatio; ///< temporal subsample ratio, 2 means code every two frames
Int m_iSourceWidth; ///< source width in pixel
Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height)
Int m_inputFileWidth; ///< width of image in input file (this is equivalent to sourceWidth, if sourceWidth is not subsequently altered due to padding)
Int m_inputFileHeight; ///< height of image in input file (this is equivalent to sourceHeight, if sourceHeight is not subsequently altered due to padding)
Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height)
......@@ -396,6 +401,12 @@ protected:
std::string m_summaryPicFilenameBase; ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended.
UInt m_summaryVerboseness; ///< Specifies the level of the verboseness of the text output.
#if EXTENSION_360_VIDEO
TExt360AppEncCfg m_ext360;
friend class TExt360AppEncCfg;
friend class TExt360AppEncTop;
#endif
// internal member functions
Void xCheckParameter (); ///< check validity of configuration values
Void xPrintParameter (); ///< print configuration values
......
......@@ -46,6 +46,10 @@
#include "TAppEncTop.h"
#include "TLibEncoder/AnnexBwrite.h"
#if EXTENSION_360_VIDEO
#include "TAppEncHelper360/TExt360AppEncTop.h"
#endif
using namespace std;
//! \ingroup TAppEncoder
......@@ -429,7 +433,7 @@ Void TAppEncTop::xCreateLib()
{
// Video I/O
m_cTVideoIOYuvInputFile.open( m_inputFileName, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode
m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC);
m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_inputFileWidth, m_inputFileHeight, m_InputChromaFormatIDC);
if (!m_reconFileName.empty())
{
......@@ -509,13 +513,28 @@ Void TAppEncTop::encode()
cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
}
#if EXTENSION_360_VIDEO
TExt360AppEncTop ext360(*this, m_cTEncTop.getGOPEncoder()->getExt360Data(), *(m_cTEncTop.getGOPEncoder()), *pcPicYuvOrg);
#endif
while ( !bEos )
{
// get buffers
xGetBuffer(pcPicYuvRec);
// read input YUV file
#if EXTENSION_360_VIDEO
if (ext360.isEnabled())
{
ext360.read(m_cTVideoIOYuvInputFile, *pcPicYuvOrg, cPicYuvTrueOrg, ipCSC);
}
else
{
m_cTVideoIOYuvInputFile.read( pcPicYuvOrg, &cPicYuvTrueOrg, ipCSC, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range );
}
#else
m_cTVideoIOYuvInputFile.read( pcPicYuvOrg, &cPicYuvTrueOrg, ipCSC, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range );
#endif
// increase number of received frames
m_iFrameRcvd++;
......@@ -551,7 +570,7 @@ Void TAppEncTop::encode()
// temporally skip frames
if( m_temporalSubsampleRatio > 1 )
{
m_cTVideoIOYuvInputFile.skipFrames(m_temporalSubsampleRatio-1, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC);
m_cTVideoIOYuvInputFile.skipFrames(m_temporalSubsampleRatio-1, m_inputFileWidth, m_inputFileHeight, m_InputChromaFormatIDC);
}
}
......
......@@ -84,6 +84,10 @@
// To use this capability enable config parameter LambdaFromQpEnable
#define JCTVC_Y0038_PARAMS 1
#ifndef EXTENSION_360_VIDEO
#define EXTENSION_360_VIDEO 0 ///< extension for 360/spherical video coding support; this macro should be controlled by makefile, as it would be used to control whether the library is built and linked
#endif
// ====================================================================================================================
// Tool Switches
// ====================================================================================================================
......
......@@ -48,6 +48,9 @@
#include "TLibCommon/CommonDef.h"
#include "TLibCommon/TComChromaFormat.h"
#include "math.h"
#if EXTENSION_360_VIDEO
#include "TAppEncHelper360/TExt360EncAnalyze.h"
#endif
//! \ingroup TLibEncoder
//! \{
......@@ -66,6 +69,10 @@ private:
Double m_dFrmRate; //--CFG_KDY
Double m_MSEyuvframe[MAX_NUM_COMPONENT]; // sum of MSEs
#if EXTENSION_360_VIDEO
TExt360EncAnalyze ext360;
#endif
public:
virtual ~TEncAnalyze() {}
TEncAnalyze() { clear(); }
......@@ -86,6 +93,9 @@ public:
Double getBits() const { return m_dAddBits; }
Void setBits(Double numBits) { m_dAddBits=numBits; }
UInt getNumPic() const { return m_uiNumPic; }
#if EXTENSION_360_VIDEO
TExt360EncAnalyze& getExt360Info() { return ext360; }
#endif
Void setFrmRate (Double dFrameRate) { m_dFrmRate = dFrameRate; } //--CFG_KDY
Void clear()
......@@ -97,6 +107,9 @@ public:
m_MSEyuvframe[i] = 0;
}
m_uiNumPic = 0;
#if EXTENSION_360_VIDEO
ext360.clear();
#endif
}
......@@ -284,6 +297,10 @@ public:
{
printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR " "YUV-PSNR " );
#if EXTENSION_360_VIDEO
ext360.printHeader();
#endif
if (printSequenceMSE)
{
printf( " Y-MSE " "U-MSE " "V-MSE " "YUV-MSE \n" );
......@@ -302,6 +319,10 @@ public:
getPsnr(COMPONENT_Cr) / (Double)getNumPic(),
PSNRyuv );
#if EXTENSION_360_VIDEO
ext360.printPSNRs(getNumPic());
#endif
if (printSequenceMSE)
{
printf( " %8.4lf " "%8.4lf " "%8.4lf " "%8.4lf\n",
......
......@@ -2175,6 +2175,9 @@ Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const Acces
dPSNR[ch] = ( uiSSDtemp ? 10.0 * log10( fRefValue / (Double)uiSSDtemp ) : 999.99 );
MSEyuvframe[ch] = (Double)uiSSDtemp/(iSize);
}
#if EXTENSION_360_VIDEO
m_ext360.calculatePSNRs(pcPic);
#endif
/* calculate the size of the access unit, excluding:
......@@ -2200,20 +2203,33 @@ Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const Acces
//===== add PSNR =====
m_gcAnalyzeAll.addResult (dPSNR, (Double)uibits, MSEyuvframe);
#if EXTENSION_360_VIDEO
m_ext360.addResult(m_gcAnalyzeAll);
#endif
TComSlice* pcSlice = pcPic->getSlice(0);
if (pcSlice->isIntra())
{
m_gcAnalyzeI.addResult (dPSNR, (Double)uibits, MSEyuvframe);
#if EXTENSION_360_VIDEO
m_ext360.addResult(m_gcAnalyzeI);
#endif
*PSNR_Y = dPSNR[COMPONENT_Y];
}
if (pcSlice->isInterP())
{
m_gcAnalyzeP.addResult (dPSNR, (Double)uibits, MSEyuvframe);
#if EXTENSION_360_VIDEO
m_ext360.addResult(m_gcAnalyzeP);
#endif
*PSNR_Y = dPSNR[COMPONENT_Y];
}
if (pcSlice->isInterB())
{
m_gcAnalyzeB.addResult (dPSNR, (Double)uibits, MSEyuvframe);
#if EXTENSION_360_VIDEO
m_ext360.addResult(m_gcAnalyzeB);
#endif
*PSNR_Y = dPSNR[COMPONENT_Y];
}
......@@ -2245,6 +2261,9 @@ Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const Acces
{
printf(" [Y MSE %6.4lf U MSE %6.4lf V MSE %6.4lf]", MSEyuvframe[COMPONENT_Y], MSEyuvframe[COMPONENT_Cb], MSEyuvframe[COMPONENT_Cr] );
}
#if EXTENSION_360_VIDEO
m_ext360.printPerPOCInfo();
#endif
printf(" [ET %5.0f ]", dEncTime );
// printf(" [WP %d]", pcSlice->getUseWeightedPrediction());
......
......@@ -54,6 +54,9 @@
#include "TEncSbac.h"
#include "SEIwrite.h"
#include "SEIEncoder.h"
#if EXTENSION_360_VIDEO
#include "TAppEncHelper360/TExt360EncGop.h"
#endif
#include "TEncAnalyze.h"
#include "TEncRateCtrl.h"
......@@ -89,6 +92,14 @@ private:
TEncAnalyze m_gcAnalyzeB;
TEncAnalyze m_gcAnalyzeAll_in;
#if EXTENSION_360_VIDEO
TExt360EncGop m_ext360;
public:
TExt360EncGop &getExt360Data() { return m_ext360; }
private:
#endif
// Data
Bool m_bLongtermTestPictureHasBeenCoded;
Bool m_bLongtermTestPictureHasBeenCoded2;
......@@ -159,6 +170,11 @@ public:
NalUnitType getNalUnitType( Int pocCurr, Int lastIdr, Bool isField );
Void arrangeLongtermPicturesInRPS(TComSlice *, TComList<TComPic*>& );
TEncAnalyze& getAnalyzeAllData() { return m_gcAnalyzeAll; }
TEncAnalyze& getAnalyzeIData() { return m_gcAnalyzeI; }
TEncAnalyze& getAnalyzePData() { return m_gcAnalyzeP; }
TEncAnalyze& getAnalyzeBData() { return m_gcAnalyzeB; }
protected:
TEncRateCtrl* getRateCtrl() { return m_pcRateCtrl; }
......
......@@ -185,9 +185,9 @@ Bool TVideoIOYuv::isFail()
* This function correctly handles cases where the input file is not
* seekable, by consuming bytes.
*/
Void TVideoIOYuv::skipFrames(UInt numFrames, UInt width, UInt height, ChromaFormat format)
Void TVideoIOYuv::skipFrames(Int numFrames, UInt width, UInt height, ChromaFormat format)
{
if (!numFrames)
if (numFrames==0)
{
return;
}
......@@ -731,7 +731,10 @@ Bool TVideoIOYuv::read ( TComPicYuv* pPicYuvUser, TComPicYuv* pPicYuvTrueOrg, c
}
}
ColourSpaceConvert(*pPicYuvTrueOrg, *pPicYuvUser, ipcsc, true);
if(pPicYuvUser)
{
ColourSpaceConvert(*pPicYuvTrueOrg, *pPicYuvUser, ipcsc, true);
}
return true;
}
......
......@@ -66,7 +66,7 @@ public:
Void open ( const std::string &fileName, Bool bWriteMode, const Int fileBitDepth[MAX_NUM_CHANNEL_TYPE], const Int MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE], const Int internalBitDepth[MAX_NUM_CHANNEL_TYPE] ); ///< open or create file
Void close (); ///< close file
Void skipFrames(UInt numFrames, UInt width, UInt height, ChromaFormat format);
Void skipFrames(Int numFrames, UInt width, UInt height, ChromaFormat format);
// if fileFormat<NUM_CHROMA_FORMAT, the format of the file is that format specified, else it is the format of the TComPicYuv.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment