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