<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 28, 2013 at 1:48 AM, <span dir="ltr"><<a href="mailto:sumalatha@multicorewareinc.com" target="_blank">sumalatha@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User sumalatha<br>
# Date 1372402128 -19800<br>
# Node ID f2cf6222811960215ddd67a1b3789613fff5d180<br>
# Parent 02cb4e55ad54c789ee3c1b19a4e32db839b8ba96<br>
Removed maxCUDepth parameter from CLI option<br></blockquote><div><br></div><div style>Looks good, but a few comments.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
diff -r 02cb4e55ad54 -r f2cf62228119 source/common/common.cpp<br>
--- a/source/common/common.cpp Fri Jun 28 12:11:14 2013 +0530<br>
+++ b/source/common/common.cpp Fri Jun 28 12:18:48 2013 +0530<br>
@@ -39,6 +39,7 @@<br>
#include <sys/time.h><br>
#endif<br>
#include <time.h><br>
+#include <cmath><br></blockquote><div><br></div><div style>Better to include math.h here and use log() below</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
#if HIGH_BIT_DEPTH<br>
const int x265_bit_depth = 10;<br>
@@ -88,7 +89,6 @@<br>
param->bipredSearchRange = 4;<br>
param->internalBitDepth = 8;<br>
param->maxCUSize = 64;<br>
- param->maxCUDepth = 4;<br>
param->tuQTMaxLog2Size = 5;<br>
param->tuQTMinLog2Size = 2;<br>
param->tuQTMaxInterDepth = 3;<br>
@@ -152,6 +152,11 @@<br>
return 1;<br>
}<br>
<br>
+uint32_t getMaxCuDepth(uint32_t maxCuSize)<br>
+{<br>
+ return (uint32_t)(log10(maxCuSize)/log10(2)) - 2;<br>
+}<br>
+<br>
int x265_check_params(x265_param_t *param)<br>
{<br>
#define CONFIRM(expr, msg) check_failed |= _confirm(param, expr, msg)<br>
@@ -177,7 +182,7 @@<br></blockquote><div><br></div><div style>it would be better to declare: uint32_t maxCUDepth = getMaxCuDepth();</div><div style>then re-use that variable for all these checks</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
"Search Range must be more than 0");<br>
CONFIRM(param->keyframeInterval < -1,<br>
"Keyframe interval must be -1 (open-GOP) 0 (auto) 1 (intra-only) or greater than 1");<br>
- CONFIRM(param->maxCUdQPDepth > param->maxCUDepth - 1,<br>
+ CONFIRM(param->maxCUdQPDepth > getMaxCuDepth(param->maxCUSize) - 1,<br>
"Absolute depth for a minimum CuDQP exceeds maximum coding unit depth");<br>
<br>
CONFIRM(param->cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12");<br>
@@ -187,13 +192,11 @@<br>
<br>
CONFIRM(param->qpAdaptionRange <= 0,<br>
"QP Adaptation Range must be more than 0");<br>
- CONFIRM((param->maxCUSize >> param->maxCUDepth) < 4,<br>
- "Minimum partition width size should be larger than or equal to 8");<br>
CONFIRM(param->maxCUSize < 16,<br>
"Maximum partition width size should be larger than or equal to 16");<br>
- CONFIRM((param->sourceWidth % (param->maxCUSize >> (param->maxCUDepth - 1))) != 0,<br>
+ CONFIRM((param->sourceWidth % (param->maxCUSize >> (getMaxCuDepth(param->maxCUSize) - 1))) != 0,<br>
"Resulting coded frame width must be a multiple of the minimum CU size");<br>
- CONFIRM((param->sourceHeight % (param->maxCUSize >> (param->maxCUDepth - 1))) != 0,<br>
+ CONFIRM((param->sourceHeight % (param->maxCUSize >> (getMaxCuDepth(param->maxCUSize) - 1))) != 0,<br>
"Resulting coded frame height must be a multiple of the minimum CU size");<br>
<br>
CONFIRM(param->tuQTMinLog2Size < 2,<br>
@@ -205,13 +208,13 @@<br>
<br>
CONFIRM(param->tuQTMaxLog2Size < param->tuQTMinLog2Size,<br>
"QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");<br>
- CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> (param->maxCUDepth - 1)),<br>
+ CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> (getMaxCuDepth(param->maxCUSize) - 1)),<br>
"QuadtreeTULog2MinSize must not be greater than minimum CU size"); // HS<br>
- CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> (param->maxCUDepth - 1)),<br>
+ CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> (getMaxCuDepth(param->maxCUSize) - 1)),<br>
"QuadtreeTULog2MinSize must not be greater than minimum CU size"); // HS<br>
- CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> param->maxCUDepth),<br>
+ CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> getMaxCuDepth(param->maxCUSize)),<br>
"Minimum CU width must be greater than minimum transform size.");<br>
- CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> param->maxCUDepth),<br>
+ CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> getMaxCuDepth(param->maxCUSize)),<br>
"Minimum CU height must be greater than minimum transform size.");<br>
CONFIRM(param->tuQTMaxInterDepth < 1,<br>
"QuadtreeTUMaxDepthInter must be greater than or equal to 1");<br>
@@ -264,14 +267,15 @@<br>
<br>
// compute actual CU depth with respect to config depth and max transform size<br>
g_uiAddCUDepth = 0;<br>
- while ((param->maxCUSize >> param->maxCUDepth) > (1u << (param->tuQTMinLog2Size + g_uiAddCUDepth)))<br>
+ while ((param->maxCUSize >> getMaxCuDepth(param->maxCUSize)) > (1u << (param->tuQTMinLog2Size + g_uiAddCUDepth)))<br>
{<br>
g_uiAddCUDepth++;<br>
}<br>
<br>
- param->maxCUDepth += g_uiAddCUDepth;<br>
+ uint32_t cuDepth = getMaxCuDepth(param->maxCUSize);<br>
+ cuDepth += g_uiAddCUDepth;<br>
g_uiAddCUDepth++;<br>
- g_uiMaxCUDepth = param->maxCUDepth;<br>
+ g_uiMaxCUDepth = cuDepth;<br>
<br>
// set internal bit-depth and constants<br>
#if HIGH_BIT_DEPTH<br>
@@ -293,7 +297,7 @@<br>
#if HIGH_BIT_DEPTH<br>
x265_log(param, X265_LOG_INFO, "Internal bit depth : %d\n", param->internalBitDepth);<br>
#endif<br>
- x265_log(param, X265_LOG_INFO, "CU size / depth : %d / %d\n", param->maxCUSize, param->maxCUDepth);<br>
+ x265_log(param, X265_LOG_INFO, "CU size : %d / %d\n", param->maxCUSize);<br></blockquote><div><br></div><div style>You forgot to remove the second %d</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
x265_log(param, X265_LOG_INFO, "RQT trans. size (min / max) : %d / %d\n", 1 << param->tuQTMinLog2Size, 1 << param->tuQTMaxLog2Size);<br>
x265_log(param, X265_LOG_INFO, "Max RQT depth inter / intra : %d / %d\n", param->tuQTMaxInterDepth, param->tuQTMaxIntraDepth);<br>
<br>
diff -r 02cb4e55ad54 -r f2cf62228119 source/common/common.h<br>
--- a/source/common/common.h Fri Jun 28 12:11:14 2013 +0530<br>
+++ b/source/common/common.h Fri Jun 28 12:18:48 2013 +0530<br>
@@ -119,7 +119,7 @@<br>
void x265_set_globals(x265_param_t *param, uint32_t inputBitDepth);<br>
int64_t x265_mdate(void);<br>
int dumpBuffer(void * pbuf, size_t bufsize, const char * filename);<br>
-<br>
+uint32_t getMaxCuDepth(uint32_t maxCuSize);<br></blockquote><div><br></div><div style>This doesn't need to be defined here, it can be a file-static routine in common.cpp</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
/* defined in primitives.cpp */<br>
void x265_setup_primitives(x265_param_t *param, int cpuid = 0);<br>
<br>
diff -r 02cb4e55ad54 -r f2cf62228119 source/x265.h<br>
--- a/source/x265.h Fri Jun 28 12:11:14 2013 +0530<br>
+++ b/source/x265.h Fri Jun 28 12:18:48 2013 +0530<br>
@@ -171,7 +171,7 @@<br>
<br>
// coding unit (CU) definition<br>
uint32_t maxCUSize; ///< max. CU width and height in pixels<br>
- uint32_t maxCUDepth; ///< max. CU recursion/split depth<br>
+<br>
<br>
// transform unit (TU) definition<br>
uint32_t tuQTMaxLog2Size;<br>
diff -r 02cb4e55ad54 -r f2cf62228119 source/x265opts.h<br>
--- a/source/x265opts.h Fri Jun 28 12:11:14 2013 +0530<br>
+++ b/source/x265opts.h Fri Jun 28 12:18:48 2013 +0530<br>
@@ -28,7 +28,6 @@<br>
OPT("wpp", param->bEnableWavefront, no_argument, 0, "Enable Wavefront Parallel Processing")<br>
OPT("no-wpp", param->bEnableWavefront, no_argument, 0, "Disable Wavefront Parallel Processing")<br>
OPT("ctu", param->maxCUSize, required_argument, 's', "Maximum CU size (default: 64x64)")<br>
-OPT("cu-depth", param->maxCUDepth, required_argument, 'd', "Maximum CU recursion depth (default: 4)")<br>
OPT("tu-maxlog2", param->tuQTMaxLog2Size, required_argument, 0, "Maximum TU size in logarithm base 2")<br>
OPT("tu-minlog2", param->tuQTMinLog2Size, required_argument, 0, "Minimum TU size in logarithm base 2")<br>
OPT("tu-intra-depth", param->tuQTMaxIntraDepth, required_argument, 0, "Max TU recursive depth for intra CUs")<br>
<br>_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="http://mailman.videolan.org/listinfo/x265-devel" target="_blank">http://mailman.videolan.org/listinfo/x265-devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>