[x265] [PATCH] Removed tuQTMaxLog2Size and tuQTMinLog2Size parametr from CLI option

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Fri Jun 28 14:24:40 CEST 2013


# HG changeset patch
# User sumalatha
# Date 1372422226 -19800
# Node ID e26c2285e44dcd74dc3517c68ae0786cee1bbabe
# Parent  b2a3aba00d81b2f15aa0cb1fffa295a3b628c387
Removed tuQTMaxLog2Size and tuQTMinLog2Size parametr from CLI option

diff -r b2a3aba00d81 -r e26c2285e44d source/common/common.cpp
--- a/source/common/common.cpp	Fri Jun 28 14:45:36 2013 +0530
+++ b/source/common/common.cpp	Fri Jun 28 17:53:46 2013 +0530
@@ -88,8 +88,6 @@
     param->bipredSearchRange = 4;
     param->internalBitDepth = 8;
     param->maxCUSize = 64;
-    param->tuQTMaxLog2Size = 5;
-    param->tuQTMinLog2Size = 2;
     param->tuQTMaxInterDepth = 3;
     param->tuQTMaxIntraDepth = 3;
     param->bEnableAMP = 0;
@@ -151,13 +149,15 @@
     return 1;
 }
 
-static inline uint32_t getMaxCuDepth(uint32_t maxCuSize)
+uint32_t getMaxCuDepth(uint32_t maxCuSize)
 {   
     return (uint32_t)(log(maxCuSize)/log(2)) - 2;
 }
 int x265_check_params(x265_param_t *param)
 {
     uint32_t maxCUDepth = getMaxCuDepth(param->maxCUSize);
+    uint32_t tuQTMaxLog2Size = maxCUDepth + 2 - 1;
+    uint32_t tuQTMinLog2Size = 2; //log2(4)
 #define CONFIRM(expr, msg) check_failed |= _confirm(param, expr, msg)
     int check_failed = 0; /* abort if there is a fatal configuration problem */
 
@@ -200,30 +200,18 @@
     CONFIRM((param->sourceHeight % (param->maxCUSize >> (maxCUDepth - 1))) != 0,
             "Resulting coded frame height must be a multiple of the minimum CU size");
 
-    CONFIRM(param->tuQTMinLog2Size < 2,
-            "QuadtreeTULog2MinSize must be 2 or greater.");
-    CONFIRM(param->tuQTMaxLog2Size > 5,
-            "QuadtreeTULog2MaxSize must be 5 or smaller.");
-    CONFIRM((1u << param->tuQTMaxLog2Size) > param->maxCUSize,
+    
+    CONFIRM((1u << tuQTMaxLog2Size) > param->maxCUSize,
             "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");
 
-    CONFIRM(param->tuQTMaxLog2Size < param->tuQTMinLog2Size,
-            "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");
-    CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> (maxCUDepth - 1)),
-            "QuadtreeTULog2MinSize must not be greater than minimum CU size"); // HS
-    CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> (maxCUDepth - 1)),
-            "QuadtreeTULog2MinSize must not be greater than minimum CU size"); // HS
-    CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> maxCUDepth),
-            "Minimum CU width must be greater than minimum transform size.");
-    CONFIRM((1u << param->tuQTMinLog2Size) > (param->maxCUSize >> maxCUDepth),
-            "Minimum CU height must be greater than minimum transform size.");
+   
     CONFIRM(param->tuQTMaxInterDepth < 1,
             "QuadtreeTUMaxDepthInter must be greater than or equal to 1");
-    CONFIRM(param->maxCUSize < (1u << (param->tuQTMinLog2Size + param->tuQTMaxInterDepth - 1)),
+    CONFIRM(param->maxCUSize < (1u << (tuQTMinLog2Size + param->tuQTMaxInterDepth - 1)),
             "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1");
     CONFIRM(param->tuQTMaxIntraDepth < 1,
             "QuadtreeTUMaxDepthIntra must be greater than or equal to 1");
-    CONFIRM(param->maxCUSize < (1u << (param->tuQTMinLog2Size + param->tuQTMaxIntraDepth - 1)),
+    CONFIRM(param->maxCUSize < (1u << (tuQTMinLog2Size + param->tuQTMaxIntraDepth - 1)),
             "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1");
 
     CONFIRM(param->maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater.");
@@ -263,13 +251,14 @@
 void x265_set_globals(x265_param_t *param, uint32_t inputBitDepth)
 {
     uint32_t maxCUDepth = getMaxCuDepth(param->maxCUSize);
+    uint32_t tuQTMinLog2Size = 2; //log2(4)
     // set max CU width & height
     g_uiMaxCUWidth  = param->maxCUSize;
     g_uiMaxCUHeight = param->maxCUSize;
 
     // compute actual CU depth with respect to config depth and max transform size
     g_uiAddCUDepth  = 0;
-    while ((param->maxCUSize >> maxCUDepth) > (1u << (param->tuQTMinLog2Size + g_uiAddCUDepth)))
+    while ((param->maxCUSize >> maxCUDepth) > (1u << (tuQTMinLog2Size + g_uiAddCUDepth)))
     {
         g_uiAddCUDepth++;
     }
@@ -299,7 +288,6 @@
     x265_log(param, X265_LOG_INFO, "Internal bit depth           : %d\n", param->internalBitDepth);
 #endif
     x265_log(param, X265_LOG_INFO, "CU size                       : %d \n", param->maxCUSize);
-    x265_log(param, X265_LOG_INFO, "RQT trans. size (min / max)  : %d / %d\n", 1 << param->tuQTMinLog2Size, 1 << param->tuQTMaxLog2Size);
     x265_log(param, X265_LOG_INFO, "Max RQT depth inter / intra  : %d / %d\n", param->tuQTMaxInterDepth, param->tuQTMaxIntraDepth);
 
     x265_log(param, X265_LOG_INFO, "Motion search / range        : %s / %d\n", x265_motion_est_names[param->searchMethod], param->searchRange);
diff -r b2a3aba00d81 -r e26c2285e44d source/common/common.h
--- a/source/common/common.h	Fri Jun 28 14:45:36 2013 +0530
+++ b/source/common/common.h	Fri Jun 28 17:53:46 2013 +0530
@@ -119,7 +119,7 @@
 void x265_set_globals(x265_param_t *param, uint32_t inputBitDepth);
 int64_t x265_mdate(void);
 int dumpBuffer(void * pbuf, size_t bufsize, const char * filename);
-
+uint32_t getMaxCuDepth(uint32_t maxCuSize);
 /* defined in primitives.cpp */
 void x265_setup_primitives(x265_param_t *param, int cpuid = 0);
 
diff -r b2a3aba00d81 -r e26c2285e44d source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Jun 28 14:45:36 2013 +0530
+++ b/source/encoder/encoder.cpp	Fri Jun 28 17:53:46 2013 +0530
@@ -223,8 +223,10 @@
     setUseRDOQ(param->bEnableRDOQ);
     setUseRDOQTS(param->bEnableRDOQTS);
     setRDpenalty(param->rdPenalty);
-    setQuadtreeTULog2MaxSize(param->tuQTMaxLog2Size);
-    setQuadtreeTULog2MinSize(param->tuQTMinLog2Size);
+    uint32_t tuQTMaxLog2Size = getMaxCuDepth(param->maxCUSize) + 2 - 1;
+    setQuadtreeTULog2MaxSize(tuQTMaxLog2Size);
+    uint32_t tuQTMinLog2Size = 2; //log2(4)
+    setQuadtreeTULog2MinSize(tuQTMinLog2Size);
     setQuadtreeTUMaxDepthInter(param->tuQTMaxInterDepth);
     setQuadtreeTUMaxDepthIntra(param->tuQTMaxIntraDepth);
     setUseFastDecisionForMerge(param->bEnableFastMergeDecision);
diff -r b2a3aba00d81 -r e26c2285e44d source/x265.h
--- a/source/x265.h	Fri Jun 28 14:45:36 2013 +0530
+++ b/source/x265.h	Fri Jun 28 17:53:46 2013 +0530
@@ -172,10 +172,6 @@
     // coding unit (CU) definition
     uint32_t  maxCUSize;                       ///< max. CU width and height in pixels
 
-    // transform unit (TU) definition
-    uint32_t  tuQTMaxLog2Size;
-    uint32_t  tuQTMinLog2Size;
-
     uint32_t  tuQTMaxInterDepth;               ///< amount the TU is allow to recurse beyond the inter PU depth
     uint32_t  tuQTMaxIntraDepth;               ///< amount the TU is allow to recurse beyond the intra PU depth
 
diff -r b2a3aba00d81 -r e26c2285e44d source/x265opts.h
--- a/source/x265opts.h	Fri Jun 28 14:45:36 2013 +0530
+++ b/source/x265opts.h	Fri Jun 28 17:53:46 2013 +0530
@@ -28,8 +28,6 @@
 OPT("wpp",             param->bEnableWavefront,         no_argument, 0, "Enable Wavefront Parallel Processing")
 OPT("no-wpp",          param->bEnableWavefront,         no_argument, 0, "Disable Wavefront Parallel Processing")
 OPT("ctu",             param->maxCUSize,          required_argument, 's', "Maximum CU size (default: 64x64)")
-OPT("tu-maxlog2",      param->tuQTMaxLog2Size,    required_argument, 0, "Maximum TU size in logarithm base 2")
-OPT("tu-minlog2",      param->tuQTMinLog2Size,    required_argument, 0, "Minimum TU size in logarithm base 2")
 OPT("tu-intra-depth",  param->tuQTMaxIntraDepth,  required_argument, 0, "Max TU recursive depth for intra CUs")
 OPT("tu-inter-depth",  param->tuQTMaxInterDepth,  required_argument, 0, "Max TU recursive depth for inter CUs")
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: June_28_hevc.patch
Type: text/x-patch
Size: 7930 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130628/a621ce5c/attachment-0001.bin>


More information about the x265-devel mailing list