[x265] sao: silence warning

2016-06-02 Thread Mateusz
# HG changeset patch
# User Ma0 
# Date 1464927637 -7200
#  Fri Jun 03 06:20:37 2016 +0200
# Node ID bd6f1daf85852177c0e2893d5edab182335ffb0e
# Parent  6098ba3e0cf16b110cff3b2519ce2d997ecac396
sao: silence warning

diff -r 6098ba3e0cf1 -r bd6f1daf8585 source/encoder/sao.cpp
--- a/source/encoder/sao.cppTue May 31 14:06:55 2016 +0100
+++ b/source/encoder/sao.cppFri Jun 03 06:20:37 2016 +0200
@@ -1433,8 +1433,7 @@
 m_entropyCoder.resetBits();
 m_entropyCoder.codeSaoType(0);
 
-uint32_t rate = m_entropyCoder.getNumberOfWrittenBits();
-int64_t costPartBest = calcSaoRdoCost(0, rate, lambda[0]);
+int64_t costPartBest = calcSaoRdoCost(0, 
m_entropyCoder.getNumberOfWrittenBits(), lambda[0]);
 
 //EO distortion calculation
 for (int typeIdx = 0; typeIdx < MAX_NUM_SAO_TYPE - 1; typeIdx++)
@@ -1456,8 +1455,7 @@
 m_entropyCoder.resetBits();
 m_entropyCoder.codeSaoOffsetEO(m_offset[0][typeIdx] + 1, typeIdx, 0);
 
-uint32_t rate = m_entropyCoder.getNumberOfWrittenBits();
-int64_t cost = calcSaoRdoCost(estDist, rate, lambda[0]);
+int64_t cost = calcSaoRdoCost(estDist, 
m_entropyCoder.getNumberOfWrittenBits(), lambda[0]);
 
 if (cost < costPartBest)
 {
@@ -1512,8 +1510,7 @@
 m_entropyCoder.resetBits();
 m_entropyCoder.codeSaoOffsetBO(m_offset[0][SAO_BO] + bestClassBO, 
bestClassBO, 0);
 
-uint32_t estRate = m_entropyCoder.getNumberOfWrittenBits();
-int64_t cost = calcSaoRdoCost(estDist, estRate, lambda[0]);
+int64_t cost = calcSaoRdoCost(estDist, 
m_entropyCoder.getNumberOfWrittenBits(), lambda[0]);
 
 if (cost < costPartBest)
 {
@@ -1534,8 +1531,7 @@
 
 if (m_param->internalCsp == X265_CSP_I400)
 {
-uint32_t rate = m_entropyCoder.getNumberOfWrittenBits();
-bestCost = rateDist + rate;
+bestCost = rateDist + m_entropyCoder.getNumberOfWrittenBits();
 }
 }
 

___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


[x265] level: fix bug in level and tier determination (#refs 278)

2016-06-02 Thread Deepthi Nandakumar
# HG changeset patch
# User Deepthi Nandakumar 
# Date 1464874032 -19800
#  Thu Jun 02 18:57:12 2016 +0530
# Node ID 64cf1830b03410048070641fb0ac6da6f41a42b1
# Parent  6098ba3e0cf16b110cff3b2519ce2d997ecac396
level: fix bug in level and tier determination (#refs 278)

This patch changes the behaviour of tier determination (and sometimes level
as
a side-effect), and hence bumping up build number to warn users. High-tier
is
"allowed" by default, and --no-high-tier tells the encoder to never choose
high
tier.

diff -r 6098ba3e0cf1 -r 64cf1830b034 doc/reST/cli.rst
--- a/doc/reST/cli.rst Tue May 31 14:06:55 2016 +0100
+++ b/doc/reST/cli.rst Thu Jun 02 18:57:12 2016 +0530
@@ -522,16 +522,14 @@

 .. option:: --high-tier, --no-high-tier

- If :option:`--level-idc` has been specified, the option adds the
- intention to support the High tier of that level. If your specified
- level does not support a High tier, a warning is issued and this
- modifier flag is ignored. If :option:`--level-idc` has been specified,
- but not --high-tier, then the encoder will attempt to encode at the
- specified level, main tier first, turning on high tier only if
- necessary and available at that level.
+ If :option:`--level-idc` has been specified, --high-tier allows the
+ support of high tier at that level. The encoder will first attempt to
encode
+ at the specified level, main tier first, turning on high tier only if
+ necessary and available at that level.If your requested level does not
+ support a High tier, high tier will not be supported. If --no-high-tier
+ has been specified, then the encoder will attempt to encode only at the
main tier.

- If :option:`--level-idc` has not been specified, this argument is
- ignored.
+ Default: enabled

 .. option:: --ref <1..16>

diff -r 6098ba3e0cf1 -r 64cf1830b034 source/CMakeLists.txt
--- a/source/CMakeLists.txt Tue May 31 14:06:55 2016 +0100
+++ b/source/CMakeLists.txt Thu Jun 02 18:57:12 2016 +0530
@@ -30,7 +30,7 @@
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)

 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 84)
+set(X265_BUILD 85)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
"${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r 6098ba3e0cf1 -r 64cf1830b034 source/common/param.cpp
--- a/source/common/param.cpp Tue May 31 14:06:55 2016 +0100
+++ b/source/common/param.cpp Thu Jun 02 18:57:12 2016 +0530
@@ -121,9 +121,9 @@
 /* Source specifications */
 param->internalBitDepth = X265_DEPTH;
 param->internalCsp = X265_CSP_I420;
-param->levelIdc = 0;
+param->levelIdc = 0; //Auto-detect level
 param->uhdBluray = 0;
-param->bHighTier = 0;
+param->bHighTier = 1; //Allow high tier by default
 param->interlaceMode = 0;
 param->bAnnexB = 1;
 param->bRepeatHeaders = 0;
diff -r 6098ba3e0cf1 -r 64cf1830b034 source/encoder/level.cpp
--- a/source/encoder/level.cpp Tue May 31 14:06:55 2016 +0100
+++ b/source/encoder/level.cpp Thu Jun 02 18:57:12 2016 +0530
@@ -198,7 +198,7 @@
 CHECK_RANGE((uint32_t)param.rc.vbvBufferSize,
levels[i].maxCpbSizeMain, levels[i].maxCpbSizeHigh))
 {
 /* The bitrate or buffer size are out of range for Main tier,
but in
- * range for High tier. If the user requested High tier then
give
+ * range for High tier. If the user allowed High tier then give
  * them High tier at this level.  Otherwise allow the loop to
  * progress to the Main tier of the next level */
 if (param.bHighTier)
@@ -209,8 +209,9 @@
 else
 vps.ptl.tierFlag = Level::MAIN;
 #undef CHECK_RANGE
-if (param.uhdBluray || param.bHighTier)
+if (param.uhdBluray)
 vps.ptl.tierFlag = Level::HIGH;
+
 vps.ptl.levelIdc = levels[i].levelEnum;
 vps.ptl.minCrForLevel = levels[i].minCompressionRatio;
 vps.ptl.maxLumaSrForLevel = levels[i].maxLumaSamplesPerSecond;
@@ -306,12 +307,9 @@
 }

 LevelSpec& l = levels[level];
-bool highTier = !!param.bHighTier;
-if (highTier && l.maxBitrateHigh == MAX_UINT)
-{
-highTier = false;
-x265_log(, X265_LOG_WARNING, "Level %s has no High tier,
using Main tier\n", l.name);
-}
+
+//highTier is allowed for this level and has not been explicitly
disabled. This does not mean it is the final chosen tier
+bool allowHighTier = l.maxBitrateHigh < MAX_UINT && param.bHighTier;

 uint32_t lumaSamples = param.sourceWidth * param.sourceHeight;
 uint32_t samplesPerSec = (uint32_t)(lumaSamples *
((double)param.fpsNum / param.fpsDenom));
@@ -333,23 +331,27 @@
 return false;
 }

-if ((uint32_t)param.rc.vbvMaxBitrate > (highTier ? l.maxBitrateHigh :
l.maxBitrateMain))
+/* Adjustments of Bitrate, VBV buffer size, refs will be triggered
only if specified params do not fit
+ * 

[x265] [PATCH] Fix: SSIM calculation

2016-06-02 Thread ramya
# HG changeset patch
# User Ramya Sriraman 
# Date 1464784734 -19800
#  Wed Jun 01 18:08:54 2016 +0530
# Node ID 4c189bdc74e13ed38a9bc1f6868b45ba4bc6b135
# Parent  6d3849d648f0be5a8e334f1d75a2f7cf93c86cb3
Fix: SSIM calculation

diff -r 6d3849d648f0 -r 4c189bdc74e1 source/encoder/framefilter.cpp
--- a/source/encoder/framefilter.cppSun May 29 21:50:25 2016 +0800
+++ b/source/encoder/framefilter.cppWed Jun 01 18:08:54 2016 +0530
@@ -553,10 +553,10 @@
 pixel *fenc = m_frame->m_fencPic->m_picOrg[0];
 intptr_t stride1 = reconPic->m_stride;
 intptr_t stride2 = m_frame->m_fencPic->m_stride;
-uint32_t bEnd = ((row + 1) == (this->m_numRows - 1));
+uint32_t bEnd = ((row) == (this->m_numRows - 1));
 uint32_t bStart = (row == 0);
 uint32_t minPixY = row * g_maxCUSize - 4 * !bStart;
-uint32_t maxPixY = (row + 1) * g_maxCUSize - 4 * !bEnd;
+uint32_t maxPixY = X265_MIN((row + 1) * g_maxCUSize - 4 * !bEnd, 
(uint32_t)m_param->sourceHeight);
 uint32_t ssim_cnt;
 x265_emms();
 
@@ -726,7 +726,7 @@
 {
 std::swap(sum0, sum1);
 for (uint32_t x = 0; x < width; x += 2)
-primitives.ssim_4x4x2_core([(4 * x + (z * stride1))], 
stride1, [(4 * x + (z * stride2))], stride2, [x]);
+primitives.ssim_4x4x2_core([4 * (x + (z * stride1))], 
stride1, [4 * (x + (z * stride2))], stride2, [x]);
 }
 
 for (uint32_t x = 0; x < width - 1; x += 4)
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


[x265] shadow declaration of 'rate' in sao.cpp

2016-06-02 Thread Mario *LigH* Rohkrämer
h:/MSYS-GCC530/home/Entwicklung/x265/source/encoder/sao.cpp:1459:18:  
warning: declaration of 'rate' shadows a previous local [-Wshadow]

 uint32_t rate = m_entropyCoder.getNumberOfWrittenBits();
  ^
h:/MSYS-GCC530/home/Entwicklung/x265/source/encoder/sao.cpp:1436:14: note:  
shadowed declaration is here

 uint32_t rate = m_entropyCoder.getNumberOfWrittenBits();
  ^
h:/MSYS-GCC530/home/Entwicklung/x265/source/encoder/sao.cpp:1537:18:  
warning: declaration of 'rate' shadows a previous local [-Wshadow]

 uint32_t rate = m_entropyCoder.getNumberOfWrittenBits();
  ^
h:/MSYS-GCC530/home/Entwicklung/x265/source/encoder/sao.cpp:1436:14: note:  
shadowed declaration is here

 uint32_t rate = m_entropyCoder.getNumberOfWrittenBits();
  ^


--

Fun and success!
Mario *LigH* Rohkrämer
mailto:cont...@ligh.de

___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel