[x265] [PATCH] add condition to handle i400
bhavna at multicorewareinc.com
bhavna at multicorewareinc.com
Mon May 22 08:38:27 CEST 2017
# HG changeset patch
# User Bhavna Hariharan <bhavna at multicorewareinc.com>
# Date 1495434924 -19800
# Mon May 22 12:05:24 2017 +0530
# Node ID 355cf3582263acc9bbcb8faa24f1dfa009f41de3
# Parent b4149e898b508ae540f1d90bc3c56132a94e3e8f
add condition to handle i400
diff -r b4149e898b50 -r 355cf3582263 doc/reST/cli.rst
--- a/doc/reST/cli.rst Fri May 19 17:50:52 2017 +0530
+++ b/doc/reST/cli.rst Mon May 22 12:05:24 2017 +0530
@@ -93,7 +93,7 @@
**Distortion** Average luma and chroma distortion. Calculated as
SSE is done on fenc and recon(after quantization).
- **Psy Energy ** Average psy energy calculated as the sum of absolute
+ **Psy Energy** Average psy energy calculated as the sum of absolute
difference between source and recon energy. Energy is measured by sa8d
minus SAD.
diff -r b4149e898b50 -r 355cf3582263 source/common/picyuv.cpp
--- a/source/common/picyuv.cpp Fri May 19 17:50:52 2017 +0530
+++ b/source/common/picyuv.cpp Mon May 22 12:05:24 2017 +0530
@@ -354,24 +354,27 @@
}
m_avgLumaLevel = (double)lumaSum / (m_picHeight * m_picWidth);
- for (int r = 0; r < height >> m_vChromaShift; r++)
+ if (param.internalCsp != X265_CSP_I400)
{
- for (int c = 0; c < width >> m_hChromaShift; c++)
+ for (int r = 0; r < height >> m_vChromaShift; r++)
{
- m_maxChromaULevel = X265_MAX(uPic[c], m_maxChromaULevel);
- m_minChromaULevel = X265_MIN(uPic[c], m_minChromaULevel);
- cbSum += uPic[c];
+ for (int c = 0; c < width >> m_hChromaShift; c++)
+ {
+ m_maxChromaULevel = X265_MAX(uPic[c], m_maxChromaULevel);
+ m_minChromaULevel = X265_MIN(uPic[c], m_minChromaULevel);
+ cbSum += uPic[c];
- m_maxChromaVLevel = X265_MAX(vPic[c], m_maxChromaVLevel);
- m_minChromaVLevel = X265_MIN(vPic[c], m_minChromaVLevel);
- crSum += vPic[c];
+ m_maxChromaVLevel = X265_MAX(vPic[c], m_maxChromaVLevel);
+ m_minChromaVLevel = X265_MIN(vPic[c], m_minChromaVLevel);
+ crSum += vPic[c];
+ }
+
+ uPic += m_strideC;
+ vPic += m_strideC;
}
-
- uPic += m_strideC;
- vPic += m_strideC;
+ m_avgChromaULevel = (double)cbSum / ((height >> m_vChromaShift) * (width >> m_hChromaShift));
+ m_avgChromaVLevel = (double)crSum / ((height >> m_vChromaShift) * (width >> m_hChromaShift));
}
- m_avgChromaULevel = (double)cbSum / ((height >> m_vChromaShift) * (width >> m_hChromaShift));
- m_avgChromaVLevel = (double)crSum / ((height >> m_vChromaShift) * (width >> m_hChromaShift));
}
#if HIGH_BIT_DEPTH
diff -r b4149e898b50 -r 355cf3582263 source/x265-extras.cpp
--- a/source/x265-extras.cpp Fri May 19 17:50:52 2017 +0530
+++ b/source/x265-extras.cpp Mon May 22 12:05:24 2017 +0530
@@ -112,7 +112,9 @@
}
fprintf(csvfp, ", Avg Luma Distortion, Avg Chroma Distortion, Avg psyEnergy, Avg Residual Energy,"
" Min Luma Level, Max Luma Level, Avg Luma Level");
- fprintf(csvfp, ", Min Cb Level, Max Cb Level, Avg Cb Level, Min Cr Level, Max Cr Level, Avg Cr Level");
+
+ if (param.internalCsp != X265_CSP_I400)
+ fprintf(csvfp, ", Min Cb Level, Max Cb Level, Avg Cb Level, Min Cr Level, Max Cr Level, Avg Cr Level");
if (level >= 2)
{
@@ -215,8 +217,12 @@
frameStats->avgResEnergy);
fprintf(csvfp, ", %d, %d, %.2lf", frameStats->minLumaLevel, frameStats->maxLumaLevel, frameStats->avgLumaLevel);
- fprintf(csvfp, ", %d, %d, %.2lf", frameStats->minChromaULevel, frameStats->maxChromaULevel, frameStats->avgChromaULevel);
- fprintf(csvfp, ", %d, %d, %.2lf", frameStats->minChromaVLevel, frameStats->maxChromaVLevel, frameStats->avgChromaVLevel);
+
+ if (param.internalCsp != X265_CSP_I400)
+ {
+ fprintf(csvfp, ", %d, %d, %.2lf", frameStats->minChromaULevel, frameStats->maxChromaULevel, frameStats->avgChromaULevel);
+ fprintf(csvfp, ", %d, %d, %.2lf", frameStats->minChromaVLevel, frameStats->maxChromaVLevel, frameStats->avgChromaVLevel);
+ }
if (level >= 2)
{
More information about the x265-devel
mailing list