<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 21, 2017 at 12:22 PM, <span dir="ltr"><<a href="mailto:kavitha@multicorewareinc.com" target="_blank">kavitha@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 Kavitha Sampath <<a href="mailto:kavitha@multicorewareinc.com">kavitha@multicorewareinc.com</a>><br>
# Date 1498019633 -19800<br>
# Wed Jun 21 10:03:53 2017 +0530<br>
# Node ID edbdfb8e8eea64e74089c153b3b4ab<wbr>bb3d105de6<br>
# Parent 40dbeef1d8b59452ac0898621a75f0<wbr>2a576b0c30<br>
rename options related to analysis-mode, improve docs<br></blockquote><div><br></div><div>This name makes more sense. Thanks for the fix.</div><div>Pushed into default branch.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea doc/reST/cli.rst<br>
--- a/doc/reST/cli.rst Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/doc/reST/cli.rst Wed Jun 21 10:03:53 2017 +0530<br>
@@ -849,33 +849,31 @@<br>
<br>
Analysis re-use options, to improve performance when encoding the same<br>
sequence multiple times (presumably at varying bitrates). The encoder<br>
-will not reuse analysis if the resolution and slice type parameters do<br>
-not match.<br>
-<br>
-.. option:: --analysis-mode <string|int><br>
-<br>
- Specify whether analysis information of each frame is output by encoder<br>
- or input for reuse. By reading the analysis data writen by an<br>
- earlier encode of the same sequence, substantial redundant work may<br>
- be avoided.<br>
-<br>
- The following data may be stored and reused:<br>
- I frames - split decisions and luma intra directions of all CUs.<br>
- P/B frames - motion vectors are dumped at each depth for all CUs.<br>
+will not reuse analysis if slice type parameters do not match.<br>
+<br>
+.. option:: --analysis-reuse-mode <string|int><br>
+<br>
+ This option allows reuse of analysis information from first pass to second pass.<br>
+ :option:`--analysis-reuse-mode save` specifies that encoder outputs analysis information of each frame.<br>
+ :option:`--analysis-reuse-mode load` specifies that encoder reuses analysis information from first pass.<br>
+ There is no benefit using load mode without running encoder in save mode. Analysis data from save mode is<br>
+ written to a file specified by :option:`--analysis-reuse-<wbr>file`. The amount of analysis data stored/reused<br>
+ is determined by :option:`--analysis-reuse-<wbr>level`. By reading the analysis data writen by an earlier encode<br>
+ of the same sequence, substantial redundant work may be avoided. Requires cutree, pmode to be off. Default 0.<br>
<br>
**Values:** off(0), save(1): dump analysis data, load(2): read analysis data<br>
<br>
-.. option:: --analysis-file <filename><br>
-<br>
- Specify a filename for analysis data (see :option:`--analysis-mode`)<br>
+.. option:: --analysis-reuse-file <filename><br>
+<br>
+ Specify a filename for analysis data (see :option:`--analysis-reuse-<wbr>mode`)<br>
If no filename is specified, x265_analysis.dat is used.<br>
<br>
-.. option:: --refine-level <1..10><br>
-<br>
- Amount of information stored/reused in :option:`--analysis-mode` is distributed across levels.<br>
+.. option:: --analysis-reuse-level <1..10><br>
+<br>
+ Amount of information stored/reused in :option:`--analysis-reuse-<wbr>mode` is distributed across levels.<br>
Higher the value, higher the information stored/reused, faster the encode. Default 5.<br>
<br>
- Note that --refine-level must be paired with analysis-mode.<br>
+ Note that --analysis-reuse-level must be paired with analysis-reuse-mode.<br>
<br>
+--------+--------------------<wbr>---------------------+<br>
| Level | Description |<br>
@@ -888,10 +886,11 @@<br>
+--------+--------------------<wbr>---------------------+<br>
| 10 | Level 5 + Full CU analysis-info |<br>
+--------+--------------------<wbr>---------------------+<br>
+<br>
.. option:: --scale-factor<br>
<br>
Factor by which input video is scaled down for analysis save mode.<br>
- This option should be coupled with analysis-mode option, --refine-level 10.<br>
+ This option should be coupled with analysis-reuse-mode option, --analysis-reuse-level 10.<br>
The ctu size of load should be double the size of save. Default 0.<br>
<br>
.. option:: --refine-intra<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/CMakeLists.txt Wed Jun 21 10:03:53 2017 +0530<br>
@@ -29,7 +29,7 @@<br>
option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br>
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
# X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 127)<br>
+set(X265_BUILD 128)<br>
configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265.def.in" rel="noreferrer" target="_blank">x265.def.in</a>"<br>
"${PROJECT_BINARY_DIR}/x265.<wbr>def")<br>
configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265_config.h.in" rel="noreferrer" target="_blank">x265_config.h.in</a>"<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/common/cudata.cpp<br>
--- a/source/common/cudata.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/common/cudata.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -1622,7 +1622,7 @@<br>
dir |= (1 << list);<br>
candMvField[count][list].mv = colmv;<br>
candMvField[count][list].<wbr>refIdx = refIdx;<br>
- if (m_encData->m_param-><wbr>scaleFactor && m_encData->m_param-><wbr>analysisMode == X265_ANALYSIS_SAVE && m_log2CUSize[0] < 4)<br>
+ if (m_encData->m_param-><wbr>scaleFactor && m_encData->m_param-><wbr>analysisReuseMode == X265_ANALYSIS_SAVE && m_log2CUSize[0] < 4)<br>
{<br>
MV dist(MAX_MV, MAX_MV);<br>
candMvField[count][list].mv = dist;<br>
@@ -1787,7 +1787,7 @@<br>
int curRefPOC = m_slice->m_refPOCList[picList]<wbr>[refIdx];<br>
int curPOC = m_slice->m_poc;<br>
<br>
- if (m_encData->m_param-><wbr>scaleFactor && m_encData->m_param-><wbr>analysisMode == X265_ANALYSIS_SAVE && (m_log2CUSize[0] < 4))<br>
+ if (m_encData->m_param-><wbr>scaleFactor && m_encData->m_param-><wbr>analysisReuseMode == X265_ANALYSIS_SAVE && (m_log2CUSize[0] < 4))<br>
{<br>
MV dist(MAX_MV, MAX_MV);<br>
pmv[numMvc++] = amvpCand[num++] = dist;<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/common/param.cpp<br>
--- a/source/common/param.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/common/param.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -195,10 +195,10 @@<br>
param->rdPenalty = 0;<br>
param->psyRd = 2.0;<br>
param->psyRdoq = 0.0;<br>
- param->analysisMode = 0;<br>
+ param->analysisReuseMode = 0;<br>
param->analysisMultiPassRefine = 0;<br>
param-><wbr>analysisMultiPassDistortion = 0;<br>
- param->analysisFileName = NULL;<br>
+ param->analysisReuseFileName = NULL;<br>
param->bIntraInBFrames = 0;<br>
param->bLossless = 0;<br>
param->bCULossless = 0;<br>
@@ -272,7 +272,7 @@<br>
param->bOptCUDeltaQP = 0;<br>
param->bAQMotion = 0;<br>
param->bHDROpt = 0;<br>
- param->analysisRefineLevel = 5;<br>
+ param->analysisReuseLevel = 5;<br>
<br>
param->toneMapFile = NULL;<br>
param->bDhdr10opt = 0;<br>
@@ -836,7 +836,7 @@<br>
p->rc.bStrictCbr = atobool(value);<br>
p->rc.pbFactor = 1.0;<br>
}<br>
- OPT("analysis-mode") p->analysisMode = parseName(value, x265_analysis_names, bError);<br>
+ OPT("analysis-reuse-mode") p->analysisReuseMode = parseName(value, x265_analysis_names, bError);<br>
OPT("sar")<br>
{<br>
p->vui.aspectRatioIdc = parseName(value, x265_sar_names, bError);<br>
@@ -915,7 +915,7 @@<br>
OPT("scaling-list") p->scalingLists = strdup(value);<br>
OPT2("pools", "numa-pools") p->numaPools = strdup(value);<br>
OPT("lambda-file") p->rc.lambdaFileName = strdup(value);<br>
- OPT("analysis-file") p->analysisFileName = strdup(value);<br>
+ OPT("analysis-reuse-file") p->analysisReuseFileName = strdup(value);<br>
OPT("qg-size") p->rc.qgSize = atoi(value);<br>
OPT("master-display") p->masteringDisplayColorVolume = strdup(value);<br>
OPT("max-cll") bError |= sscanf(value, "%hu,%hu", &p->maxCLL, &p->maxFALL) != 2;<br>
@@ -948,7 +948,7 @@<br>
OPT("multi-pass-opt-<wbr>distortion") p->analysisMultiPassDistortion = atobool(value);<br>
OPT("aq-motion") p->bAQMotion = atobool(value);<br>
OPT("dynamic-rd") p->dynamicRd = atof(value);<br>
- OPT("refine-level") p->analysisRefineLevel = atoi(value);<br>
+ OPT("analysis-reuse-level") p->analysisReuseLevel = atoi(value);<br>
OPT("ssim-rd")<br>
{<br>
int bval = atobool(value);<br>
@@ -1299,9 +1299,9 @@<br>
"Constant QP is incompatible with 2pass");<br>
CHECK(param->rc.bStrictCbr && (param->rc.bitrate <= 0 || param->rc.vbvBufferSize <=0),<br>
"Strict-cbr cannot be applied without specifying target bitrate or vbv bufsize");<br>
- CHECK(param->analysisMode && (param->analysisMode < X265_ANALYSIS_OFF || param->analysisMode > X265_ANALYSIS_LOAD),<br>
+ CHECK(param->analysisReuseMode && (param->analysisReuseMode < X265_ANALYSIS_OFF || param->analysisReuseMode > X265_ANALYSIS_LOAD),<br>
"Invalid analysis mode. Analysis mode 0: OFF 1: SAVE : 2 LOAD");<br>
- CHECK(param->analysisMode && (param->analysisRefineLevel < 1 || param->analysisRefineLevel > 10),<br>
+ CHECK(param->analysisReuseMode && (param->analysisReuseLevel < 1 || param->analysisReuseLevel > 10),<br>
"Invalid analysis refine level. Value must be between 1 and 10 (inclusive)");<br>
CHECK(param->scaleFactor > 2, "Invalid scale-factor. Supports factor <= 2");<br>
CHECK(param->rc.qpMax < QP_MIN || param->rc.qpMax > QP_MAX_MAX,<br>
@@ -1558,7 +1558,7 @@<br>
s += sprintf(s, " psy-rd=%.2f", p->psyRd);<br>
s += sprintf(s, " psy-rdoq=%.2f", p->psyRdoq);<br>
BOOL(p->bEnableRdRefine, "rd-refine");<br>
- s += sprintf(s, " analysis-mode=%d", p->analysisMode);<br>
+ s += sprintf(s, " analysis-reuse-mode=%d", p->analysisReuseMode);<br>
BOOL(p->bLossless, "lossless");<br>
s += sprintf(s, " cbqpoffs=%d", p->cbQpOffset);<br>
s += sprintf(s, " crqpoffs=%d", p->crQpOffset);<br>
@@ -1653,7 +1653,7 @@<br>
BOOL(p->bEmitHDRSEI, "hdr");<br>
BOOL(p->bHDROpt, "hdr-opt");<br>
BOOL(p->bDhdr10opt, "dhdr10-opt");<br>
- s += sprintf(s, " refine-level=%d", p->analysisRefineLevel);<br>
+ s += sprintf(s, " analysis-reuse-level=%d", p->analysisReuseLevel);<br>
s += sprintf(s, " scale-factor=%d", p->scaleFactor);<br>
s += sprintf(s, " refine-intra=%d", p->intraRefine);<br>
s += sprintf(s, " refine-inter=%d", p->interRefine);<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/encoder/analysis.cpp<br>
--- a/source/encoder/analysis.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/encoder/analysis.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -203,19 +203,19 @@<br>
}<br>
}<br>
<br>
- if (m_param->analysisMode && m_slice->m_sliceType != I_SLICE && m_param->analysisRefineLevel > 1 && m_param->analysisRefineLevel < 10)<br>
+ if (m_param->analysisReuseMode && m_slice->m_sliceType != I_SLICE && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel < 10)<br>
{<br>
int numPredDir = m_slice->isInterP() ? 1 : 2;<br>
m_reuseInterDataCTU = (analysis_inter_data*)m_frame-<wbr>>m_analysisData.interData;<br>
m_reuseRef = &m_reuseInterDataCTU->ref[ctu.<wbr>m_cuAddr * X265_MAX_PRED_MODE_PER_CTU * numPredDir];<br>
m_reuseDepth = &m_reuseInterDataCTU->depth[<wbr>ctu.m_cuAddr * ctu.m_numPartitions];<br>
m_reuseModes = &m_reuseInterDataCTU->modes[<wbr>ctu.m_cuAddr * ctu.m_numPartitions];<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
{<br>
m_reusePartSize = &m_reuseInterDataCTU-><wbr>partSize[ctu.m_cuAddr * ctu.m_numPartitions];<br>
m_reuseMergeFlag = &m_reuseInterDataCTU-><wbr>mergeFlag[ctu.m_cuAddr * ctu.m_numPartitions];<br>
}<br>
- if (m_param->analysisMode == X265_ANALYSIS_SAVE)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE)<br>
for (int i = 0; i < X265_MAX_PRED_MODE_PER_CTU * numPredDir; i++)<br>
m_reuseRef[i] = -1;<br>
}<br>
@@ -224,7 +224,7 @@<br>
if (m_slice->m_sliceType == I_SLICE)<br>
{<br>
analysis_intra_data* intraDataCTU = (analysis_intra_data*)m_frame-<wbr>>m_analysisData.intraData;<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1)<br>
{<br>
memcpy(ctu.m_cuDepth, &intraDataCTU->depth[ctu.m_<wbr>cuAddr * numPartition], sizeof(uint8_t) * numPartition);<br>
memcpy(ctu.m_lumaIntraDir, &intraDataCTU->modes[ctu.m_<wbr>cuAddr * numPartition], sizeof(uint8_t) * numPartition);<br>
@@ -250,7 +250,7 @@<br>
/* generate residual for entire CTU at once and copy to reconPic */<br>
encodeResidue(ctu, cuGeom);<br>
}<br>
- else if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel == 10)<br>
+ else if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel == 10)<br>
{<br>
analysis_inter_data* interDataCTU = (analysis_inter_data*)m_frame-<wbr>>m_analysisData.interData;<br>
int posCTU = ctu.m_cuAddr * numPartition;<br>
@@ -432,7 +432,7 @@<br>
int lambdaQP = lqp;<br>
<br>
bool doQPRefine = (bDecidedDepth && depth <= m_slice->m_pps->maxCuDQPDepth) || (!bDecidedDepth && depth == m_slice->m_pps->maxCuDQPDepth)<wbr>;<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
doQPRefine = false;<br>
<br>
if (doQPRefine)<br>
@@ -604,7 +604,7 @@<br>
}<br>
<br>
/* Save Intra CUs TU depth only when analysis mode is OFF */<br>
- if ((m_limitTU & X265_TU_LIMIT_NEIGH) && cuGeom.log2CUSize >= 4 && !m_param->analysisMode)<br>
+ if ((m_limitTU & X265_TU_LIMIT_NEIGH) && cuGeom.log2CUSize >= 4 && !m_param->analysisReuseMode)<br>
{<br>
CUData* ctu = md.bestMode->cu.m_encData-><wbr>getPicCTU(parentCTU.m_cuAddr);<br>
int8_t maxTUDepth = -1;<br>
@@ -1200,7 +1200,7 @@<br>
mightSplit &= !bDecidedDepth;<br>
}<br>
}<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1 && m_param->analysisRefineLevel != 10)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)<br>
{<br>
if (mightNotSplit && depth == m_reuseDepth[cuGeom.<wbr>absPartIdx])<br>
{<br>
@@ -1214,7 +1214,7 @@<br>
if (m_param->rdLevel)<br>
skipModes = m_param->bEnableEarlySkip && md.bestMode;<br>
}<br>
- if (m_param->analysisRefineLevel > 4 && m_reusePartSize[cuGeom.<wbr>absPartIdx] == SIZE_2Nx2N)<br>
+ if (m_param->analysisReuseLevel > 4 && m_reusePartSize[cuGeom.<wbr>absPartIdx] == SIZE_2Nx2N)<br>
{<br>
if (m_reuseModes[cuGeom.<wbr>absPartIdx] != MODE_INTRA && m_reuseModes[cuGeom.<wbr>absPartIdx] != 4)<br>
{<br>
@@ -1829,7 +1829,7 @@<br>
mightSplit &= !bDecidedDepth;<br>
}<br>
}<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1 && m_param->analysisRefineLevel != 10)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)<br>
{<br>
if (mightNotSplit && depth == m_reuseDepth[cuGeom.<wbr>absPartIdx])<br>
{<br>
@@ -1847,7 +1847,7 @@<br>
if (m_param->bEnableRecursionSkip && depth && m_modeDepth[depth - 1].bestMode)<br>
skipRecursion = md.bestMode && !md.bestMode->cu.getQtRootCbf(<wbr>0);<br>
}<br>
- if (m_param->analysisRefineLevel > 4 && m_reusePartSize[cuGeom.<wbr>absPartIdx] == SIZE_2Nx2N)<br>
+ if (m_param->analysisReuseLevel > 4 && m_reusePartSize[cuGeom.<wbr>absPartIdx] == SIZE_2Nx2N)<br>
skipRectAmp = true && !!md.bestMode;<br>
}<br>
}<br>
@@ -2261,7 +2261,7 @@<br>
for (uint32_t part = 0; part < numPU; part++)<br>
{<br>
PredictionUnit pu(<a href="http://mode.cu" rel="noreferrer" target="_blank">mode.cu</a>, cuGeom, part);<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
analysis_inter_data* interDataCTU = (analysis_inter_data*)m_frame-<wbr>>m_analysisData.interData;<br>
int cuIdx = (mode.cu.m_cuAddr * parentCTU.m_numPartitions) + cuGeom.absPartIdx;<br>
@@ -2363,7 +2363,7 @@<br>
if (m_slice->m_pps->bUseDQP && nextDepth <= m_slice->m_pps->maxCuDQPDepth)<br>
nextQP = setLambdaFromQP(parentCTU, calculateQpforCuSize(<wbr>parentCTU, childGeom));<br>
<br>
- int lamdaQP = m_param->analysisRefineLevel == 10 ? nextQP : lqp;<br>
+ int lamdaQP = m_param->analysisReuseLevel == 10 ? nextQP : lqp;<br>
<br>
if (split)<br>
m_param->rdLevel > 4 ? compressInterCU_rd5_6(<wbr>parentCTU, childGeom, nextQP) : compressInterCU_rd0_4(<wbr>parentCTU, childGeom, nextQP);<br>
@@ -2686,7 +2686,7 @@<br>
interMode.cu.<wbr>setPredModeSubParts(MODE_<wbr>INTER);<br>
int numPredDir = m_slice->isInterP() ? 1 : 2;<br>
<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1 && m_param->analysisRefineLevel != 10)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)<br>
{<br>
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;<br>
int index = 0;<br>
@@ -2728,7 +2728,7 @@<br>
}<br>
interMode.sa8dCost = m_rdCost.calcRdSADCost((<wbr>uint32_t)interMode.distortion, interMode.sa8dBits);<br>
<br>
- if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU && m_param->analysisReuseLevel > 1)<br>
{<br>
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;<br>
int index = 0;<br>
@@ -2750,7 +2750,7 @@<br>
interMode.cu.<wbr>setPredModeSubParts(MODE_<wbr>INTER);<br>
int numPredDir = m_slice->isInterP() ? 1 : 2;<br>
<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1 && m_param->analysisRefineLevel != 10)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)<br>
{<br>
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;<br>
int index = 0;<br>
@@ -2784,7 +2784,7 @@<br>
/* predInterSearch sets interMode.sa8dBits, but this is ignored */<br>
encodeResAndCalcRdInterCU(<wbr>interMode, cuGeom);<br>
<br>
- if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU && m_param->analysisReuseLevel > 1)<br>
{<br>
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;<br>
int index = 0;<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/encoder/api.cpp<br>
--- a/source/encoder/api.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/encoder/api.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -351,7 +351,7 @@<br>
pic->userSEI.payloads = NULL;<br>
pic->userSEI.numPayloads = 0;<br>
<br>
- if (param->analysisMode)<br>
+ if (param->analysisReuseMode)<br>
{<br>
uint32_t widthInCU = (param->sourceWidth + param->maxCUSize - 1) >> param->maxLog2CUSize;<br>
uint32_t heightInCU = (param->sourceHeight + param->maxCUSize - 1) >> param->maxLog2CUSize;<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/encoder/encoder.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -347,12 +347,12 @@<br>
<br>
initRefIdx();<br>
<br>
- if (m_param->analysisMode)<br>
+ if (m_param->analysisReuseMode)<br>
{<br>
- const char* name = m_param->analysisFileName;<br>
+ const char* name = m_param-><wbr>analysisReuseFileName;<br>
if (!name)<br>
name = defaultAnalysisFileName;<br>
- const char* mode = m_param->analysisMode == X265_ANALYSIS_LOAD ? "rb" : "wb";<br>
+ const char* mode = m_param->analysisReuseMode == X265_ANALYSIS_LOAD ? "rb" : "wb";<br>
m_analysisFile = x265_fopen(name, mode);<br>
if (!m_analysisFile)<br>
{<br>
@@ -363,7 +363,7 @@<br>
<br>
if (m_param-><wbr>analysisMultiPassRefine || m_param-><wbr>analysisMultiPassDistortion)<br>
{<br>
- const char* name = m_param->analysisFileName;<br>
+ const char* name = m_param-><wbr>analysisReuseFileName;<br>
if (!name)<br>
name = defaultAnalysisFileName;<br>
if (m_param->rc.bStatWrite)<br>
@@ -486,7 +486,7 @@<br>
{<br>
int bError = 1;<br>
fclose(m_analysisFileOut);<br>
- const char* name = m_param->analysisFileName;<br>
+ const char* name = m_param-><wbr>analysisReuseFileName;<br>
if (!name)<br>
name = defaultAnalysisFileName;<br>
char* temp = strcatFilename(name, ".temp");<br>
@@ -506,7 +506,7 @@<br>
/* release string arguments that were strdup'd */<br>
free((char*)m_param->rc.<wbr>lambdaFileName);<br>
free((char*)m_param->rc.<wbr>statFileName);<br>
- free((char*)m_param-><wbr>analysisFileName);<br>
+ free((char*)m_param-><wbr>analysisReuseFileName);<br>
free((char*)m_param-><wbr>scalingLists);<br>
free((char*)m_param->csvfn);<br>
free((char*)m_param-><wbr>numaPools);<br>
@@ -598,7 +598,7 @@<br>
<br>
if (m_exportedPic)<br>
{<br>
- if (!m_param->bUseAnalysisFile && m_param->analysisMode == X265_ANALYSIS_SAVE)<br>
+ if (!m_param->bUseAnalysisFile && m_param->analysisReuseMode == X265_ANALYSIS_SAVE)<br>
freeAnalysis(&m_exportedPic-><wbr>m_analysisData);<br>
ATOMIC_DEC(&m_exportedPic->m_<wbr>countRefEncoders);<br>
m_exportedPic = NULL;<br>
@@ -766,7 +766,7 @@<br>
<br>
/* In analysisSave mode, x265_analysis_data is allocated in pic_in and inFrame points to this */<br>
/* Load analysis data before lookahead->addPicture, since sliceType has been decided */<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD)<br>
{<br>
/* readAnalysisFile reads analysis data for the frame and allocates memory based on slicetype */<br>
readAnalysisFile(&inFrame->m_<wbr>analysisData, inFrame->m_poc, pic_in);<br>
@@ -833,7 +833,7 @@<br>
x265_frame_stats* frameData = NULL;<br>
<br>
/* Free up pic_in->analysisData since it has already been used */<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD)<br>
freeAnalysis(&outFrame->m_<wbr>analysisData);<br>
<br>
if (pic_out)<br>
@@ -859,7 +859,7 @@<br>
}<br>
<br>
/* Dump analysis data from pic_out to file in save mode and free */<br>
- if (m_param->analysisMode == X265_ANALYSIS_SAVE)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE)<br>
{<br>
pic_out->analysisData.poc = pic_out->poc;<br>
pic_out->analysisData.<wbr>sliceType = pic_out->sliceType;<br>
@@ -1097,7 +1097,7 @@<br>
frameEnc->m_dts = frameEnc->m_reorderedPts;<br>
<br>
/* Allocate analysis data before encode in save mode. This is allocated in frameEnc */<br>
- if (m_param->analysisMode == X265_ANALYSIS_SAVE)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE)<br>
{<br>
x265_analysis_data* analysis = &frameEnc->m_analysisData;<br>
analysis->poc = frameEnc->m_poc;<br>
@@ -2242,23 +2242,23 @@<br>
p->rc.rfConstantMin = 0;<br>
}<br>
<br>
- if (p->analysisMode && (p->bDistributeModeAnalysis || p-><wbr>bDistributeMotionEstimation))<br>
+ if (p->analysisReuseMode && (p->bDistributeModeAnalysis || p-><wbr>bDistributeMotionEstimation))<br>
{<br>
x265_log(p, X265_LOG_WARNING, "Analysis load/save options incompatible with pmode/pme, Disabling pmode/pme\n");<br>
p->bDistributeMotionEstimation = p->bDistributeModeAnalysis = 0;<br>
}<br>
<br>
- if (p->analysisMode && p->rc.cuTree)<br>
+ if (p->analysisReuseMode && p->rc.cuTree)<br>
{<br>
x265_log(p, X265_LOG_WARNING, "Analysis load/save options works only with cu-tree off, Disabling cu-tree\n");<br>
p->rc.cuTree = 0;<br>
}<br>
<br>
- if (p->analysisMode && (p->analysisMultiPassRefine || p-><wbr>analysisMultiPassDistortion))<br>
+ if (p->analysisReuseMode && (p->analysisMultiPassRefine || p-><wbr>analysisMultiPassDistortion))<br>
{<br>
x265_log(p, X265_LOG_WARNING, "Cannot use Analysis load/save option and multi-pass-opt-analysis/multi-<wbr>pass-opt-distortion together,"<br>
"Disabling Analysis load/save and multi-pass-opt-analysis/multi-<wbr>pass-opt-distortion\n");<br>
- p->analysisMode = p->analysisMultiPassRefine = p->analysisMultiPassDistortion = 0;<br>
+ p->analysisReuseMode = p->analysisMultiPassRefine = p->analysisMultiPassDistortion = 0;<br>
}<br>
if (p->scaleFactor)<br>
{<br>
@@ -2266,27 +2266,27 @@<br>
{<br>
p->scaleFactor = 0;<br>
}<br>
- else if (!p->analysisMode || p->analysisRefineLevel < 10)<br>
+ else if (!p->analysisReuseMode || p->analysisReuseLevel < 10)<br>
{<br>
- x265_log(p, X265_LOG_WARNING, "Input scaling works with analysis-mode, refine-level 10. Disabling scale-factor.\n");<br>
+ x265_log(p, X265_LOG_WARNING, "Input scaling works with analysis-reuse-mode, analysis-reuse-level 10. Disabling scale-factor.\n");<br>
p->scaleFactor = 0;<br>
}<br>
}<br>
<br>
if (p->intraRefine)<br>
{<br>
- if (p->analysisMode!= X265_ANALYSIS_LOAD || p->analysisRefineLevel < 10 || !p->scaleFactor)<br>
+ if (p->analysisReuseMode!= X265_ANALYSIS_LOAD || p->analysisReuseLevel < 10 || !p->scaleFactor)<br>
{<br>
- x265_log(p, X265_LOG_WARNING, "Intra refinement requires analysis load, refine-level 10, scale factor. Disabling intra refine.\n");<br>
+ x265_log(p, X265_LOG_WARNING, "Intra refinement requires analysis load, analysis-reuse-level 10, scale factor. Disabling intra refine.\n");<br>
p->intraRefine = 0;<br>
}<br>
}<br>
<br>
if (p->interRefine)<br>
{<br>
- if (p->analysisMode != X265_ANALYSIS_LOAD || p->analysisRefineLevel < 10 || !p->scaleFactor)<br>
+ if (p->analysisReuseMode != X265_ANALYSIS_LOAD || p->analysisReuseLevel < 10 || !p->scaleFactor)<br>
{<br>
- x265_log(p, X265_LOG_WARNING, "Inter refinement requires analysis load, refine-level 10, scale factor. Disabling inter refine.\n");<br>
+ x265_log(p, X265_LOG_WARNING, "Inter refinement requires analysis load, analysis-reuse-level 10, scale factor. Disabling inter refine.\n");<br>
p->interRefine = 0;<br>
}<br>
}<br>
@@ -2299,9 +2299,9 @@<br>
<br>
if (p->mvRefine)<br>
{<br>
- if (p->analysisMode != X265_ANALYSIS_LOAD || p->analysisRefineLevel < 10 || !p->scaleFactor)<br>
+ if (p->analysisReuseMode != X265_ANALYSIS_LOAD || p->analysisReuseLevel < 10 || !p->scaleFactor)<br>
{<br>
- x265_log(p, X265_LOG_WARNING, "MV refinement requires analysis load, refine-level 10, scale factor. Disabling MV refine.\n");<br>
+ x265_log(p, X265_LOG_WARNING, "MV refinement requires analysis load, analysis-reuse-level 10, scale factor. Disabling MV refine.\n");<br>
p->mvRefine = 0;<br>
}<br>
}<br>
@@ -2395,7 +2395,7 @@<br>
m_conformanceWindow.<wbr>bottomOffset = 0;<br>
m_conformanceWindow.leftOffset = 0;<br>
/* set pad size if width is not multiple of the minimum CU size */<br>
- if (p->scaleFactor == 2 && ((p->sourceWidth / 2) & (p->minCUSize - 1)) && p->analysisMode == X265_ANALYSIS_LOAD)<br>
+ if (p->scaleFactor == 2 && ((p->sourceWidth / 2) & (p->minCUSize - 1)) && p->analysisReuseMode == X265_ANALYSIS_LOAD)<br>
{<br>
uint32_t rem = (p->sourceWidth / 2) & (p->minCUSize - 1);<br>
uint32_t padsize = p->minCUSize - rem;<br>
@@ -2584,7 +2584,7 @@<br>
}<br>
}<br>
/* set pad size if height is not multiple of the minimum CU size */<br>
- if (p->scaleFactor == 2 && ((p->sourceHeight / 2) & (p->minCUSize - 1)) && p->analysisMode == X265_ANALYSIS_LOAD)<br>
+ if (p->scaleFactor == 2 && ((p->sourceHeight / 2) & (p->minCUSize - 1)) && p->analysisReuseMode == X265_ANALYSIS_LOAD)<br>
{<br>
uint32_t rem = (p->sourceHeight / 2) & (p->minCUSize - 1);<br>
uint32_t padsize = p->minCUSize - rem;<br>
@@ -2647,7 +2647,7 @@<br>
analysis->interData = analysis->intraData = NULL;<br>
if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)<br>
{<br>
- if (m_param->analysisRefineLevel < 2)<br>
+ if (m_param->analysisReuseLevel < 2)<br>
return;<br>
<br>
analysis_intra_data *intraData = (analysis_intra_data*)<wbr>analysis->intraData;<br>
@@ -2663,20 +2663,20 @@<br>
int numDir = analysis->sliceType == X265_TYPE_P ? 1 : 2;<br>
uint32_t numPlanes = m_param->internalCsp == X265_CSP_I400 ? 1 : 3;<br>
CHECKED_MALLOC_ZERO(analysis-><wbr>wt, WeightParam, numPlanes * numDir);<br>
- if (m_param->analysisRefineLevel < 2)<br>
+ if (m_param->analysisReuseLevel < 2)<br>
return;<br>
<br>
analysis_inter_data *interData = (analysis_inter_data*)<wbr>analysis->interData;<br>
CHECKED_MALLOC_ZERO(interData, analysis_inter_data, 1);<br>
CHECKED_MALLOC(interData-><wbr>depth, uint8_t, analysis->numPartitions * analysis->numCUsInFrame);<br>
CHECKED_MALLOC(interData-><wbr>modes, uint8_t, analysis->numPartitions * analysis->numCUsInFrame);<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
{<br>
CHECKED_MALLOC(interData-><wbr>partSize, uint8_t, analysis->numPartitions * analysis->numCUsInFrame);<br>
CHECKED_MALLOC(interData-><wbr>mergeFlag, uint8_t, analysis->numPartitions * analysis->numCUsInFrame);<br>
}<br>
<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
CHECKED_MALLOC(interData-><wbr>interDir, uint8_t, analysis->numPartitions * analysis->numCUsInFrame);<br>
for (int dir = 0; dir < numDir; dir++)<br>
@@ -2713,7 +2713,7 @@<br>
/* Early exit freeing weights alone if level is 1 (when there is no analysis inter/intra) */<br>
if (analysis->sliceType > X265_TYPE_I && analysis->wt)<br>
X265_FREE(analysis->wt);<br>
- if (m_param->analysisRefineLevel < 2)<br>
+ if (m_param->analysisReuseLevel < 2)<br>
return;<br>
<br>
if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)<br>
@@ -2741,12 +2741,12 @@<br>
{<br>
X265_FREE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>depth);<br>
X265_FREE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>modes);<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
{<br>
X265_FREE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>mergeFlag);<br>
X265_FREE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>partSize);<br>
}<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
X265_FREE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>interDir);<br>
int numDir = analysis->sliceType == X265_TYPE_P ? 1 : 2;<br>
@@ -2901,7 +2901,7 @@<br>
<br>
if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)<br>
{<br>
- if (m_param->analysisRefineLevel < 2)<br>
+ if (m_param->analysisReuseLevel < 2)<br>
return;<br>
<br>
uint8_t *tempBuf = NULL, *depthBuf = NULL, *modeBuf = NULL, *partSizes = NULL;<br>
@@ -2953,7 +2953,7 @@<br>
uint32_t numDir = analysis->sliceType == X265_TYPE_P ? 1 : 2;<br>
uint32_t numPlanes = m_param->internalCsp == X265_CSP_I400 ? 1 : 3;<br>
X265_FREAD((WeightParam*)<wbr>analysis->wt, sizeof(WeightParam), numPlanes * numDir, m_analysisFile, (picIn->analysisData.wt));<br>
- if (m_param->analysisRefineLevel < 2)<br>
+ if (m_param->analysisReuseLevel < 2)<br>
return;<br>
<br>
uint8_t *tempBuf = NULL, *depthBuf = NULL, *modeBuf = NULL, *partSize = NULL, *mergeFlag = NULL;<br>
@@ -2961,9 +2961,9 @@<br>
MV* mv[2];<br>
int8_t* refIdx[2];<br>
<br>
- int numBuf = m_param->analysisRefineLevel > 4 ? 4 : 2;<br>
+ int numBuf = m_param->analysisReuseLevel > 4 ? 4 : 2;<br>
bool bIntraInInter = false;<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
numBuf++;<br>
bIntraInInter = (analysis->sliceType == X265_TYPE_P || m_param->bIntraInBFrames);<br>
@@ -2977,14 +2977,14 @@<br>
X265_FREAD(depthBuf, sizeof(uint8_t), depthBytes, m_analysisFile, interPic->depth);<br>
X265_FREAD(modeBuf, sizeof(uint8_t), depthBytes, m_analysisFile, interPic->modes);<br>
<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
{<br>
partSize = modeBuf + depthBytes;<br>
mergeFlag = partSize + depthBytes;<br>
X265_FREAD(partSize, sizeof(uint8_t), depthBytes, m_analysisFile, interPic->partSize);<br>
X265_FREAD(mergeFlag, sizeof(uint8_t), depthBytes, m_analysisFile, interPic->mergeFlag);<br>
<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
interDir = mergeFlag + depthBytes;<br>
X265_FREAD(interDir, sizeof(uint8_t), depthBytes, m_analysisFile, interPic->interDir);<br>
@@ -3013,7 +3013,7 @@<br>
depthBuf[d] = 1;<br>
memset(&((analysis_inter_data *)analysis->interData)->depth[<wbr>count], depthBuf[d], bytes);<br>
memset(&((analysis_inter_data *)analysis->interData)->modes[<wbr>count], modeBuf[d], bytes);<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
{<br>
if (m_param->scaleFactor && modeBuf[d] == MODE_INTRA && partSize[d] == SIZE_NxN)<br>
partSize[d] = SIZE_2Nx2N;<br>
@@ -3023,7 +3023,7 @@<br>
{<br>
if (pu) d++;<br>
((analysis_inter_data *)analysis->interData)-><wbr>mergeFlag[count + pu] = mergeFlag[d];<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
((analysis_inter_data *)analysis->interData)-><wbr>interDir[count + pu] = interDir[d];<br>
for (uint32_t i = 0; i < numDir; i++)<br>
@@ -3039,7 +3039,7 @@<br>
}<br>
}<br>
}<br>
- if (m_param->analysisRefineLevel == 10 && bIntraInInter)<br>
+ if (m_param->analysisReuseLevel == 10 && bIntraInInter)<br>
memset(&((analysis_intra_data *)analysis->intraData)-><wbr>chromaModes[count], chromaDir[d], bytes);<br>
}<br>
count += bytes;<br>
@@ -3047,7 +3047,7 @@<br>
<br>
X265_FREE(tempBuf);<br>
<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
for (uint32_t i = 0; i < numDir; i++)<br>
{<br>
@@ -3232,7 +3232,7 @@<br>
analysis->frameRecordSize += sizeof(WeightParam) * numPlanes * numDir;<br>
}<br>
<br>
- if (m_param->analysisRefineLevel > 1)<br>
+ if (m_param->analysisReuseLevel > 1)<br>
{<br>
if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)<br>
{<br>
@@ -3280,12 +3280,12 @@<br>
interDataCTU->depth[<wbr>depthBytes] = depth;<br>
<br>
predMode = ctu->m_predMode[absPartIdx];<br>
- if (m_param->analysisRefineLevel != 10 && ctu->m_refIdx[1][absPartIdx] != -1)<br>
+ if (m_param->analysisReuseLevel != 10 && ctu->m_refIdx[1][absPartIdx] != -1)<br>
predMode = 4; // used as indiacator if the block is coded as bidir<br>
<br>
interDataCTU->modes[<wbr>depthBytes] = predMode;<br>
<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
{<br>
partSize = ctu->m_partSize[absPartIdx];<br>
interDataCTU->partSize[<wbr>depthBytes] = partSize;<br>
@@ -3298,7 +3298,7 @@<br>
if (puIdx) depthBytes++;<br>
interDataCTU->mergeFlag[<wbr>depthBytes] = ctu->m_mergeFlag[puabsPartIdx]<wbr>;<br>
<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
interDataCTU->interDir[<wbr>depthBytes] = ctu->m_interDir[puabsPartIdx];<br>
for (uint32_t dir = 0; dir < numDir; dir++)<br>
@@ -3309,12 +3309,12 @@<br>
}<br>
}<br>
}<br>
- if (m_param->analysisRefineLevel == 10 && bIntraInInter)<br>
+ if (m_param->analysisReuseLevel == 10 && bIntraInInter)<br>
intraDataCTU->chromaModes[<wbr>depthBytes] = ctu->m_chromaIntraDir[<wbr>absPartIdx];<br>
}<br>
absPartIdx += ctu->m_numPartitions >> (depth * 2);<br>
}<br>
- if (m_param->analysisRefineLevel == 10 && bIntraInInter)<br>
+ if (m_param->analysisReuseLevel == 10 && bIntraInInter)<br>
memcpy(&intraDataCTU->modes[<wbr>ctu->m_cuAddr * ctu->m_numPartitions], ctu->m_lumaIntraDir, sizeof(uint8_t)* ctu->m_numPartitions);<br>
}<br>
}<br>
@@ -3325,10 +3325,10 @@<br>
{<br>
/* Add sizeof depth, modes, partSize, mergeFlag */<br>
analysis->frameRecordSize += depthBytes * 2;<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
analysis->frameRecordSize += (depthBytes * 2);<br>
<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
/* Add Size of interDir, mvpIdx, refIdx, mv, luma and chroma modes */<br>
analysis->frameRecordSize += depthBytes;<br>
@@ -3358,7 +3358,7 @@<br>
if (analysis->sliceType > X265_TYPE_I)<br>
X265_FWRITE((WeightParam*)<wbr>analysis->wt, sizeof(WeightParam), numPlanes * numDir, m_analysisFile);<br>
<br>
- if (m_param->analysisRefineLevel < 2)<br>
+ if (m_param->analysisReuseLevel < 2)<br>
return;<br>
<br>
if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)<br>
@@ -3372,11 +3372,11 @@<br>
{<br>
X265_FWRITE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>depth, sizeof(uint8_t), depthBytes, m_analysisFile);<br>
X265_FWRITE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>modes, sizeof(uint8_t), depthBytes, m_analysisFile);<br>
- if (m_param->analysisRefineLevel > 4)<br>
+ if (m_param->analysisReuseLevel > 4)<br>
{<br>
X265_FWRITE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>partSize, sizeof(uint8_t), depthBytes, m_analysisFile);<br>
X265_FWRITE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>mergeFlag, sizeof(uint8_t), depthBytes, m_analysisFile);<br>
- if (m_param->analysisRefineLevel == 10)<br>
+ if (m_param->analysisReuseLevel == 10)<br>
{<br>
X265_FWRITE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>interDir, sizeof(uint8_t), depthBytes, m_analysisFile);<br>
if (bIntraInInter) X265_FWRITE(((analysis_intra_<wbr>data*)analysis->intraData)-><wbr>chromaModes, sizeof(uint8_t), depthBytes, m_analysisFile);<br>
@@ -3390,7 +3390,7 @@<br>
X265_FWRITE(((analysis_intra_<wbr>data*)analysis->intraData)-><wbr>modes, sizeof(uint8_t), analysis->numCUsInFrame * analysis->numPartitions, m_analysisFile);<br>
}<br>
}<br>
- if (m_param->analysisRefineLevel != 10)<br>
+ if (m_param->analysisReuseLevel != 10)<br>
X265_FWRITE(((analysis_inter_<wbr>data*)analysis->interData)-><wbr>ref, sizeof(int32_t), analysis->numCUsInFrame * X265_MAX_PRED_MODE_PER_CTU * numDir, m_analysisFile);<br>
<br>
}<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/encoder/frameencoder.<wbr>cpp<br>
--- a/source/encoder/frameencoder.<wbr>cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/encoder/frameencoder.<wbr>cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -388,7 +388,7 @@<br>
bool bUseWeightB = slice->m_sliceType == B_SLICE && slice->m_pps-><wbr>bUseWeightedBiPred;<br>
<br>
WeightParam* reuseWP = NULL;<br>
- if (m_param->analysisMode && (bUseWeightP || bUseWeightB))<br>
+ if (m_param->analysisReuseMode && (bUseWeightP || bUseWeightB))<br>
reuseWP = (WeightParam*)m_frame->m_<wbr>analysisData.wt;<br>
<br>
if (bUseWeightP || bUseWeightB)<br>
@@ -397,7 +397,7 @@<br>
m_cuStats.countWeightAnalyze++<wbr>;<br>
ScopedElapsedTime time(m_cuStats.<wbr>weightAnalyzeTime);<br>
#endif<br>
- if (m_param->analysisMode == X265_ANALYSIS_LOAD)<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD)<br>
{<br>
for (int list = 0; list < slice->isInterB() + 1; list++)<br>
{<br>
@@ -436,7 +436,7 @@<br>
slice->m_refReconPicList[l][<wbr>ref] = slice->m_refFrameList[l][ref]-<wbr>>m_reconPic;<br>
m_mref[l][ref].init(slice->m_<wbr>refReconPicList[l][ref], w, *m_param);<br>
}<br>
- if (m_param->analysisMode == X265_ANALYSIS_SAVE && (bUseWeightP || bUseWeightB))<br>
+ if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE && (bUseWeightP || bUseWeightB))<br>
{<br>
for (int i = 0; i < (m_param->internalCsp != X265_CSP_I400 ? 3 : 1); i++)<br>
*(reuseWP++) = slice->m_weightPredTable[l][0]<wbr>[i];<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/encoder/search.cpp<br>
--- a/source/encoder/search.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/encoder/search.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -2073,7 +2073,7 @@<br>
int mvpIdx = selectMVP(interMode.cu, pu, amvp, list, ref);<br>
MV mvmin, mvmax, outmv, mvp = amvp[mvpIdx];<br>
<br>
- if (!m_param->analysisMode) /* Prevents load/save outputs from diverging if lowresMV is not available */<br>
+ if (!m_param->analysisReuseMode) /* Prevents load/save outputs from diverging if lowresMV is not available */<br>
{<br>
MV lmv = getLowresMV(interMode.cu, pu, list, ref);<br>
if (lmv.notZero())<br>
@@ -2161,7 +2161,7 @@<br>
cu.getNeighbourMV(puIdx, pu.puAbsPartIdx, interMode.interNeighbours);<br>
<br>
/* Uni-directional prediction */<br>
- if ((m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1 && m_param->analysisRefineLevel != 10)<br>
+ if ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)<br>
|| (m_param-><wbr>analysisMultiPassRefine && m_param->rc.bStatRead))<br>
{<br>
for (int list = 0; list < numPredDir; list++)<br>
@@ -2297,7 +2297,7 @@<br>
int mvpIdx = selectMVP(cu, pu, amvp, list, ref);<br>
MV mvmin, mvmax, outmv, mvp = amvp[mvpIdx];<br>
<br>
- if (!m_param->analysisMode) /* Prevents load/save outputs from diverging when lowresMV is not available */<br>
+ if (!m_param->analysisReuseMode) /* Prevents load/save outputs from diverging when lowresMV is not available */<br>
{<br>
MV lmv = getLowresMV(cu, pu, list, ref);<br>
if (lmv.notZero())<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/encoder/slicetype.cpp<br>
--- a/source/encoder/slicetype.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/encoder/slicetype.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -893,7 +893,7 @@<br>
if (m_param->rc.cuTree && !m_param->rc.bStatRead)<br>
/* update row satds based on cutree offsets */<br>
curFrame->m_lowres.satdCost = frameCostRecalculate(frames, p0, p1, b);<br>
- else if (m_param->analysisMode != X265_ANALYSIS_LOAD || m_param->scaleFactor)<br>
+ else if (m_param->analysisReuseMode != X265_ANALYSIS_LOAD || m_param->scaleFactor)<br>
{<br>
if (m_param->rc.aqMode)<br>
curFrame->m_lowres.satdCost = curFrame->m_lowres.costEstAq[b - p0][p1 - b];<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/x265.cpp<br>
--- a/source/x265.cpp Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/x265.cpp Wed Jun 21 10:03:53 2017 +0530<br>
@@ -580,9 +580,9 @@<br>
<br>
x265_picture pic_orig, pic_out;<br>
x265_picture *pic_in = &pic_orig;<br>
- /* Allocate recon picture if analysisMode is enabled */<br>
+ /* Allocate recon picture if analysisReuseMode is enabled */<br>
std::priority_queue<int64_t>* pts_queue = cliopt.output->needPTS() ? new std::priority_queue<int64_t>() : NULL;<br>
- x265_picture *pic_recon = (cliopt.recon || !!param->analysisMode || pts_queue || reconPlay || param->csvLogLevel) ? &pic_out : NULL;<br>
+ x265_picture *pic_recon = (cliopt.recon || !!param->analysisReuseMode || pts_queue || reconPlay || param->csvLogLevel) ? &pic_out : NULL;<br>
uint32_t inFrameCount = 0;<br>
uint32_t outFrameCount = 0;<br>
x265_nal *p_nal;<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/x265.h<br>
--- a/source/x265.h Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/x265.h Wed Jun 21 10:03:53 2017 +0530<br>
@@ -301,15 +301,15 @@<br>
* to allow the encoder to determine base QP */<br>
int forceqp;<br>
<br>
- /* If param.analysisMode is X265_ANALYSIS_OFF this field is ignored on input<br>
+ /* If param.analysisReuseMode is X265_ANALYSIS_OFF this field is ignored on input<br>
* and output. Else the user must call x265_alloc_analysis_data() to<br>
* allocate analysis buffers for every picture passed to the encoder.<br>
*<br>
- * On input when param.analysisMode is X265_ANALYSIS_LOAD and analysisData<br>
+ * On input when param.analysisReuseMode is X265_ANALYSIS_LOAD and analysisData<br>
* member pointers are valid, the encoder will use the data stored here to<br>
* reduce encoder work.<br>
*<br>
- * On output when param.analysisMode is X265_ANALYSIS_SAVE and analysisData<br>
+ * On output when param.analysisReuseMode is X265_ANALYSIS_SAVE and analysisData<br>
* member pointers are valid, the encoder will write output analysis into<br>
* this data structure */<br>
x265_analysis_data analysisData;<br>
@@ -1107,10 +1107,10 @@<br>
* buffers. if X265_ANALYSIS_LOAD, read analysis information into analysis<br>
* buffer and use this analysis information to reduce the amount of work<br>
* the encoder must perform. Default X265_ANALYSIS_OFF */<br>
- int analysisMode;<br>
+ int analysisReuseMode;<br>
<br>
- /* Filename for analysisMode save/load. Default name is "x265_analysis.dat" */<br>
- const char* analysisFileName;<br>
+ /* Filename for analysisReuseMode save/load. Default name is "x265_analysis.dat" */<br>
+ const char* analysisReuseFileName;<br>
<br>
/*== Rate Control ==*/<br>
<br>
@@ -1426,9 +1426,9 @@<br>
int bHDROpt;<br>
<br>
/* A value between 1 and 10 (both inclusive) determines the level of<br>
- * information stored/reused in save/load analysis-mode. Higher the refine<br>
- * level higher the informtion stored/reused. Default is 5 */<br>
- int analysisRefineLevel;<br>
+ * information stored/reused in save/load analysis-reuse-mode. Higher the refine<br>
+ * level higher the information stored/reused. Default is 5 */<br>
+ int analysisReuseLevel;<br>
<br>
/* Limit Sample Adaptive Offset filter computation by early terminating SAO<br>
* process based on inter prediction mode, CTU spatial-domain correlations,<br>
diff -r 40dbeef1d8b5 -r edbdfb8e8eea source/x265cli.h<br>
--- a/source/x265cli.h Tue Jun 13 14:00:40 2017 +0530<br>
+++ b/source/x265cli.h Wed Jun 21 10:03:53 2017 +0530<br>
@@ -248,9 +248,9 @@<br>
{ "no-slow-firstpass", no_argument, NULL, 0 },<br>
{ "multi-pass-opt-rps", no_argument, NULL, 0 },<br>
{ "no-multi-pass-opt-rps", no_argument, NULL, 0 },<br>
- { "analysis-mode", required_argument, NULL, 0 },<br>
- { "analysis-file", required_argument, NULL, 0 },<br>
- { "refine-level", required_argument, NULL, 0 },<br>
+ { "analysis-reuse-mode", required_argument, NULL, 0 },<br>
+ { "analysis-reuse-file", required_argument, NULL, 0 },<br>
+ { "analysis-reuse-level", required_argument, NULL, 0 },<br>
{ "scale-factor", required_argument, NULL, 0 },<br>
{ "refine-intra", no_argument, NULL, 0 },<br>
{ "no-refine-intra",no_argument, NULL, 0 },<br>
@@ -444,9 +444,9 @@<br>
H0(" --[no-]analyze-src-pics Motion estimation uses source frame planes. Default disable\n");<br>
H0(" --[no-]slow-firstpass Enable a slow first pass in a multipass rate control mode. Default %s\n", OPT(param->rc.<wbr>bEnableSlowFirstPass));<br>
H0(" --[no-]strict-cbr Enable stricter conditions and tolerance for bitrate deviations in CBR mode. Default %s\n", OPT(param->rc.bStrictCbr));<br>
- H0(" --analysis-mode <string|int> save - Dump analysis info into file, load - Load analysis buffers from the file. Default %d\n", param->analysisMode);<br>
- H0(" --analysis-file <filename> Specify file name used for either dumping or reading analysis data.\n");<br>
- H0(" --refine-level <1..10> Level of analysis refinement indicates amount of info stored/reused in save/load mode, 1:least....10:most. Default %d\n", param->analysisRefineLevel);<br>
+ H0(" --analysis-reuse-mode <string|int> save - Dump analysis info into file, load - Load analysis buffers from the file. Default %d\n", param->analysisReuseMode);<br>
+ H0(" --analysis-reuse-file <filename> Specify file name used for either dumping or reading analysis data. Deault x265_analysis.dat\n");<br>
+ H0(" --analysis-reuse-level <1..10> Level of analysis reuse indicates amount of info stored/reused in save/load mode, 1:least..10:most. Default %d\n", param->analysisReuseLevel);<br>
H0(" --scale-factor <int> Specify factor by which input video is scaled down for analysis save mode. Default %d\n", param->scaleFactor);<br>
H0(" --[no-]refine-intra Enable intra refinement for load mode. Default %s\n", OPT(param->intraRefine));<br>
H0(" --[no-]refine-inter Enable inter refinement for load mode. Default %s\n", OPT(param->interRefine));<br>
<br>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>