38 #ifndef __TENCANALYZE__
39 #define __TENCANALYZE__
43 #endif // _MSC_VER > 1000
51 #if EXTENSION_360_VIDEO
52 #include "TAppEncHelper360/TExt360EncAnalyze.h"
75 #if EXTENSION_360_VIDEO
76 TExt360EncAnalyze m_ext360;
102 #if JVET_F0064_MSSSIM
108 #if EXTENSION_360_VIDEO
109 TExt360EncAnalyze& getExt360Info() {
return m_ext360; }
120 #if JVET_F0064_MSSSIM
125 #if EXTENSION_360_VIDEO
139 if (bitDepths.
recon[channelTypeIndex] > maximumBitDepth)
141 maximumBitDepth = bitDepths.
recon[channelTypeIndex];
145 const UInt maxval = 255 << (maximumBitDepth - 8);
148 for (
UInt comp=0; comp<numberValidComponents; comp++)
153 const Int scaleChan = (4>>(csx+csy));
159 MSEyuv += scaleChan * channelMSE;
163 PSNRyuv = (MSEyuv==0 ? 999.99 : 10*log10((maxval*maxval)/MSEyuv));
167 #if JVET_F0064_MSSSIM
177 if (printMSEBasedSNR)
185 MSEBasedSNR[compID] = 0 * dScale;
193 MSEBasedSNR[compID] = (MSE == 0) ? 999.99 : (10 * log10((maxval * maxval) / (MSE / (
Double)
getNumPic())));
201 if (printMSEBasedSNR)
203 printf(
" \tTotal Frames | " "Bitrate " "Y-PSNR" );
205 #if JVET_F0064_MSSSIM
208 printf(
" Y-MS-SSIM");
211 if (printSequenceMSE)
213 printf(
" Y-MSE\n" );
221 printf(
"Average: \t %8d %c " "%12.4lf " "%8.4lf",
226 #if JVET_F0064_MSSSIM
233 if (printSequenceMSE)
242 printf(
"From MSE:\t %8d %c " "%12.4lf " "%8.4lf\n",
249 printf(
"\tTotal Frames | " "Bitrate " "Y-PSNR" );
251 #if JVET_F0064_MSSSIM
254 printf(
"Y-MS-SSIM");
258 if (printSequenceMSE)
260 printf(
" Y-MSE\n" );
268 printf(
"\t %8d %c " "%12.4lf " "%8.4lf",
273 #if JVET_F0064_MSSSIM
279 if (printSequenceMSE)
298 if (printMSEBasedSNR)
300 printf(
" \tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR " "YUV-PSNR " );
302 #if JVET_F0064_MSSSIM
305 printf(
" Y-MS-SSIM " "U-MS-SSIM " "V-MS-SSIM ");
308 if (printSequenceMSE)
310 printf(
" Y-MSE " "U-MSE " "V-MSE " "YUV-MSE \n" );
318 printf(
"Average: \t %8d %c " "%12.4lf " "%8.4lf " "%8.4lf " "%8.4lf " "%8.4lf",
326 #if JVET_F0064_MSSSIM
329 printf(
" %8.6lf " "%8.6lf " "%8.6lf ",
335 if (printSequenceMSE)
337 printf(
" %8.4lf " "%8.4lf " "%8.4lf " "%8.4lf\n",
348 printf(
"From MSE:\t %8d %c " "%12.4lf " "%8.4lf " "%8.4lf " "%8.4lf " "%8.4lf\n",
358 printf(
"\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR " "YUV-PSNR " );
360 #if JVET_F0064_MSSSIM
363 printf(
" Y-MS-SSIM " "U-MS-SSIM " "V-MS-SSIM ");
367 #if EXTENSION_360_VIDEO
368 m_ext360.printHeader();
371 if (printSequenceMSE)
373 printf(
" Y-MSE " "U-MSE " "V-MSE " "YUV-MSE \n" );
381 printf(
"\t %8d %c " "%12.4lf " "%8.4lf " "%8.4lf " "%8.4lf " "%8.4lf",
389 #if JVET_F0064_MSSSIM
392 printf(
" %8.6lf " "%8.6lf " "%8.6lf ",
399 #if EXTENSION_360_VIDEO
403 if (printSequenceMSE)
405 printf(
" %8.4lf " "%8.4lf " "%8.4lf " "%8.4lf\n",
419 fprintf(stderr,
"Unknown format during print out\n");
428 FILE* pFile = fopen (sFilename.c_str(),
"at");
435 fprintf(pFile,
"%f\t %f\n",
448 fprintf(pFile,
"%f\t %f\t %f\t %f\t %f",
455 if (printSequenceMSE)
457 fprintf(pFile,
"\t %f\t %f\t %f\t %f\n",
465 fprintf(pFile,
"\n");
472 fprintf(stderr,
"Unknown format during print out\n");
490 #endif // !defined(AFX_TENCANALYZE_H__C79BCAA2_6AC8_4175_A0FE_CF02F5829233__INCLUDED_)
Double getPsnr(ComponentID compID) const
Void setFrmRate(Double dFrameRate)
Defines version information, constants and small in-line functions.
Double m_dPSNRSum[MAX_NUM_COMPONENT]
Void printOut(TChar cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const Bool printMSSSIM, const BitDepths &bitDepths)
Void addResult(Double psnr[MAX_NUM_COMPONENT], Double bits, const Double MSEyuvframe[MAX_NUM_COMPONENT], const Double MSSSIM[MAX_NUM_COMPONENT])
Int recon[MAX_NUM_CHANNEL_TYPE]
the bit depth as indicated in the SPS
Double m_MSSSIM[MAX_NUM_COMPONENT]
TEncAnalyze m_gcAnalyzeAll_in
TEncAnalyze m_gcAnalyzeAll
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
Void printSummary(const ChromaFormat chFmt, const Bool printSequenceMSE, const BitDepths &bitDepths, const std::string &sFilename)
Void calculateCombinedValues(const ChromaFormat chFmt, Double &PSNRyuv, Double &MSEyuv, const BitDepths &bitDepths)
static const Double MAX_DOUBLE
max. value of Double-type value
Double getMsssim(ComponentID compID) const
Void setBits(Double numBits)
Double m_MSEyuvframe[MAX_NUM_COMPONENT]