<div dir="ltr">Analysis load/save is being fully refactored. The earlier 2 patches have been queued, but I'll wait on this one.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 11, 2014 at 12:38 PM, <span dir="ltr"><<a href="mailto:gopu@multicorewareinc.com" target="_blank">gopu@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Gopu Govindaswamy <<a href="mailto:gopu@multicorewareinc.com">gopu@multicorewareinc.com</a>><br>
# Date 1415689681 -19800<br>
# Tue Nov 11 12:38:01 2014 +0530<br>
# Node ID d98278d6bef3c35af876e6713e526ddace141e2f<br>
# Parent 64b80aa95091ddcc95df1790dc72a4786d68e125<br>
cli: add numPredMode into analysis structure and keep configurable based on param<br>
<br>
diff -r 64b80aa95091 -r d98278d6bef3 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Tue Nov 11 11:51:24 2014 +0530<br>
+++ b/source/CMakeLists.txt Tue Nov 11 12:38:01 2014 +0530<br>
@@ -21,7 +21,7 @@<br>
include(CheckCXXCompilerFlag)<br>
<br>
# X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 36)<br>
+set(X265_BUILD 37)<br>
configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265.def.in" target="_blank">x265.def.in</a>"<br>
"${PROJECT_BINARY_DIR}/x265.def")<br>
configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265_config.h.in" target="_blank">x265_config.h.in</a>"<br>
diff -r 64b80aa95091 -r d98278d6bef3 source/common/cudata.h<br>
--- a/source/common/cudata.h Tue Nov 11 11:51:24 2014 +0530<br>
+++ b/source/common/cudata.h Tue Nov 11 12:38:01 2014 +0530<br>
@@ -79,6 +79,7 @@<br>
<br>
// (1 + 4 + 16 + 64) = 85.<br>
enum { MAX_GEOMS = 85 };<br>
+ enum { MAX_NUMPART_PER_PRED_UNIT = 2 };<br>
<br>
uint32_t log2CUSize; // Log of the CU size.<br>
uint32_t childOffset; // offset of the first child CU from current CU<br>
diff -r 64b80aa95091 -r d98278d6bef3 source/encoder/analysis.cpp<br>
--- a/source/encoder/analysis.cpp Tue Nov 11 11:51:24 2014 +0530<br>
+++ b/source/encoder/analysis.cpp Tue Nov 11 12:38:01 2014 +0530<br>
@@ -148,7 +148,10 @@<br>
else<br>
{<br>
if (m_param->analysisMode)<br>
- m_interAnalysisData = m_frame->m_interData + (ctu.m_cuAddr * (CUGeom::MAX_GEOMS * NUM_SIZES));<br>
+ {<br>
+ uint32_t PredMode = (m_param->bEnableAMP && m_param->bEnableRectInter) ? 8 : (m_param->bEnableAMP || m_param->bEnableRectInter ? 4 : 2);<br>
+ m_interAnalysisData = m_frame->m_interData + (ctu.m_cuAddr * (CUGeom::MAX_GEOMS * PredMode * CUGeom::MAX_NUMPART_PER_PRED_UNIT));<br>
+ }<br>
<br>
if (!m_param->rdLevel)<br>
{<br>
diff -r 64b80aa95091 -r d98278d6bef3 source/encoder/api.cpp<br>
--- a/source/encoder/api.cpp Tue Nov 11 11:51:24 2014 +0530<br>
+++ b/source/encoder/api.cpp Tue Nov 11 12:38:01 2014 +0530<br>
@@ -205,6 +205,7 @@<br>
uint32_t numCUsInFrame = widthInCU * heightInCU;<br>
pic->analysisData.numCUsInFrame = numCUsInFrame;<br>
pic->analysisData.numPartitions = numPartitions;<br>
+ pic->analysisData.numPredMode = (param->bEnableAMP && param->bEnableRectInter) ? 8 : (param->bEnableAMP || param->bEnableRectInter ? 4 : 2);<br>
}<br>
}<br>
<br>
@@ -216,7 +217,7 @@<br>
<br>
int x265_alloc_analysis_data(x265_picture* pic)<br>
{<br>
- CHECKED_MALLOC(pic->analysisData.interData, x265_inter_data, pic->analysisData.numCUsInFrame * X265_MAX_PRED_MODE_PER_CU);<br>
+ CHECKED_MALLOC(pic->analysisData.interData, x265_inter_data, pic->analysisData.numCUsInFrame * (X265_MAX_PRED_MODE_PER_CU * pic->analysisData.numPredMode));<br>
CHECKED_MALLOC(pic->analysisData.intraData, x265_intra_data, 1);<br>
pic->analysisData.intraData->depth = NULL;<br>
pic->analysisData.intraData->modes = NULL;<br>
diff -r 64b80aa95091 -r d98278d6bef3 source/x265.cpp<br>
--- a/source/x265.cpp Tue Nov 11 11:51:24 2014 +0530<br>
+++ b/source/x265.cpp Tue Nov 11 12:38:01 2014 +0530<br>
@@ -891,7 +891,7 @@<br>
sizeof(uint8_t), pic->analysisData.numPartitions * pic->analysisData.numCUsInFrame, this->analysisFile);<br>
fread(pic->analysisData.intraData->partSizes,<br>
sizeof(char), pic->analysisData.numPartitions * pic->analysisData.numCUsInFrame, this->analysisFile);<br>
- fread(pic->analysisData.interData, sizeof(x265_inter_data), pic->analysisData.numCUsInFrame * (X265_MAX_PRED_MODE_PER_CU), this->analysisFile);<br>
+ fread(pic->analysisData.interData, sizeof(x265_inter_data), pic->analysisData.numCUsInFrame * (X265_MAX_PRED_MODE_PER_CU * pic->analysisData.numPredMode), this->analysisFile);<br>
}<br>
<br>
void CLIOptions::writeAnalysisFile(x265_picture* pic, x265_param *p)<br>
@@ -911,7 +911,7 @@<br>
sizeof(uint8_t), pic->analysisData.numPartitions * pic->analysisData.numCUsInFrame, this->analysisFile);<br>
fwrite(pic->analysisData.intraData->partSizes,<br>
sizeof(char), pic->analysisData.numPartitions * pic->analysisData.numCUsInFrame, this->analysisFile);<br>
- fwrite(pic->analysisData.interData, sizeof(x265_inter_data), pic->analysisData.numCUsInFrame * X265_MAX_PRED_MODE_PER_CU, this->analysisFile);<br>
+ fwrite(pic->analysisData.interData, sizeof(x265_inter_data), pic->analysisData.numCUsInFrame * (X265_MAX_PRED_MODE_PER_CU * pic->analysisData.numPredMode), this->analysisFile);<br>
}<br>
<br>
bool CLIOptions::parseQPFile(x265_picture &pic_org)<br>
@@ -1013,6 +1013,7 @@<br>
}<br>
if (param->analysisMode)<br>
{<br>
+ pic_recon->analysisData.numPredMode = pic_in->analysisData.numPredMode;<br>
if (param->analysisMode == X265_ANALYSIS_SAVE)<br>
{<br>
char *p = x265_param2string(param);<br>
@@ -1024,7 +1025,7 @@<br>
uint32_t numCU = pic_in->analysisData.numCUsInFrame;<br>
uint32_t numPart = pic_in->analysisData.numPartitions;<br>
<br>
- cliopt.analysisRecordSize = ((sizeof(int) * 4 + sizeof(uint32_t) * 2) + sizeof(x265_inter_data) * numCU * X265_MAX_PRED_MODE_PER_CU +<br>
+ cliopt.analysisRecordSize = ((sizeof(int) * 4 + sizeof(uint32_t) * 2) + sizeof(x265_inter_data) * numCU * (X265_MAX_PRED_MODE_PER_CU * pic_in->analysisData.numPredMode) +<br>
sizeof(uint8_t) * 2 * numPart * numCU + sizeof(char) * numPart * numCU);<br>
<br>
fprintf(cliopt.analysisFile, "#options: %s\n", p);<br>
diff -r 64b80aa95091 -r d98278d6bef3 source/x265.h<br>
--- a/source/x265.h Tue Nov 11 11:51:24 2014 +0530<br>
+++ b/source/x265.h Tue Nov 11 12:38:01 2014 +0530<br>
@@ -114,6 +114,7 @@<br>
x265_intra_data* intraData;<br>
uint32_t numCUsInFrame;<br>
uint32_t numPartitions;<br>
+ uint32_t numPredMode;<br>
} x265_analysis_data;<br>
<br>
/* Used to pass pictures into the encoder, and to get picture data back out of<br>
@@ -286,7 +287,7 @@<br>
#define X265_ANALYSIS_OFF 0<br>
#define X265_ANALYSIS_SAVE 1<br>
#define X265_ANALYSIS_LOAD 2<br>
-#define X265_MAX_PRED_MODE_PER_CU (85 * 8 * 2) /* max-recursive-percu * max-predmode * numberofpart */<br>
+#define X265_MAX_PRED_MODE_PER_CU (85 * 2) /* max-recursive-percu * numberofpart */<br>
<br>
typedef struct<br>
{<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div>