On Wed, Oct 16, 2013 at 6:50 AM, Gopu Govindaswamy < [email protected]> wrote:
> # HG changeset patch > # User Gopu Govindaswamy <[email protected]> > # Date 1381924237 -19800 > # Node ID 5ad0aaa72d6ef149a63cd979751c86b3fed48855 > # Parent d84ba96117b5c9f41361967211f524d459c2cd0b > common : Added new function x265_param2string > > diff -r d84ba96117b5 -r 5ad0aaa72d6e source/common/common.cpp > --- a/source/common/common.cpp Wed Oct 16 16:06:12 2013 +0530 > +++ b/source/common/common.cpp Wed Oct 16 17:20:37 2013 +0530 > @@ -566,3 +566,75 @@ > berror |= valuewasnull; > return berror ? X265_PARAM_BAD_VALUE : 0; > } > + > +char *x265_param2string( x265_param_t *p) > +{ > + char *buf, *s; > + buf = s = (char *)X265_MALLOC(char, PARAM_BUFF_SIZE); > + if (!buf) > + return NULL; > + > +#define OPT(value) (value ? "Enable" : "Disable") > + s += sprintf(s, " %dx%d \n", p->sourceWidth, p->sourceHeight); > + s += sprintf(s, " loglevel = %d", p->logLevel); > parameters that have no effect on the output video like loglevel should not be serialized by this function. > + s += sprintf(s, " EnableWavefront = %s", OPT(p->bEnableWavefront)); > the names serialized by x265_param2string need to be parsed by x265_param_parse, so this must be "no-wpp" or we must make sure x265_param_parse can properly handle "wpp=1" > + s += sprintf(s, " poolNumThreads = %d", p->poolNumThreads); > + s += sprintf(s, " frameNumThreads = %d", p->frameNumThreads); > + s += sprintf(s, " internalBitDepth = %d", p->internalBitDepth); > + s += sprintf(s, " frameRate = %d", p->frameRate); > + s += sprintf(s, " maxCUSize = %d", p->maxCUSize); > + s += sprintf(s, " tuQTMaxInterDepth = %d",p->tuQTMaxInterDepth); > + s += sprintf(s, " tuQTMaxIntraDepth = %d", p->tuQTMaxIntraDepth); > + s += sprintf(s, " decodingRefreshType = %d", p->decodingRefreshType); > + s += sprintf(s, " keyframeMin = %d", p->keyframeMin); > + s += sprintf(s, " keyframeMax = %d", p->keyframeMax); > + s += sprintf(s, " OpenGOP = %s", OPT(p->bOpenGOP)); > + s += sprintf(s, " bframes = %d", p->bframes); > + s += sprintf(s, " lookaheadDepth = %d", p->lookaheadDepth); > + s += sprintf(s, " bFrameAdaptive = %d", p->bFrameAdaptive); > + s += sprintf(s, " bFrameBias = %d", p->bFrameBias); > + s += sprintf(s, " scenecutThreshold = %d", p->scenecutThreshold); > + s += sprintf(s, " bEnableConstrainedIntra = %s", > OPT(p->bEnableConstrainedIntra)); > + s += sprintf(s, " bEnableStrongIntraSmoothing = %s", > OPT(p->bEnableStrongIntraSmoothing)); > + s += sprintf(s, " searchMethod = %d", p->searchMethod); > + s += sprintf(s, " subpelRefine = %d", p->subpelRefine); > + s += sprintf(s, " searchRange = %d", p->searchRange); > + s += sprintf(s, " maxNumMergeCand = %d", p->maxNumMergeCand); > + s += sprintf(s, " bEnableWeightedPred = %s", > OPT(p->bEnableWeightedPred)); > + s += sprintf(s, " bEnableWeightedBiPred = %s", > OPT(p->bEnableWeightedBiPred)); > + s += sprintf(s, " bEnableAMP = %s", OPT(p->bEnableAMP)); > + s += sprintf(s, " bEnableRectInter = %s", OPT(p->bEnableRectInter)); > + s += sprintf(s, " bEnableCbfFastMode = %s", > OPT(p->bEnableCbfFastMode)); > + s += sprintf(s, " bEnableEarlySkip = %s", OPT(p->bEnableEarlySkip)); > + s += sprintf(s, " bRDLevel = %s", OPT(p->bRDLevel)); > + s += sprintf(s, " bEnableRDO = %s", OPT(p->bEnableRDO)); > + s += sprintf(s, " bEnableRDOQ = %s", OPT(p->bEnableRDOQ)); > + s += sprintf(s, " bEnableSignHiding = %s", OPT(p->bEnableSignHiding)); > + s += sprintf(s, " bEnableTransformSkip = %s", > OPT(p->bEnableTransformSkip)); > + s += sprintf(s, " bEnableTSkipFast = %s", OPT(p->bEnableTSkipFast)); > + s += sprintf(s, " bEnableRDOQTS = %s", OPT(p->bEnableRDOQTS)); > + s += sprintf(s, " maxNumReferences = %d", p->maxNumReferences); > + s += sprintf(s, " bEnableLoopFilter = %s", OPT(p->bEnableLoopFilter)); > + s += sprintf(s, " bEnableSAO = %s", OPT(p->bEnableSAO)); > + s += sprintf(s, " saoLcuBoundary = %d", p->saoLcuBoundary); > + s += sprintf(s, " saoLcuBasedOptimization = %d", > p->saoLcuBasedOptimization); > + s += sprintf(s, " cbQpOffset = %d", p->cbQpOffset); > + s += sprintf(s, " crQpOffset = %d", p->crQpOffset); > + s += sprintf(s, " rdPenalty = %d", p->rdPenalty); > + s += sprintf(s, " decodedPictureHashSEI = %d", > p->decodedPictureHashSEI); > + s += sprintf(s, " bEnablePsnr = %s", OPT(p->bEnablePsnr)); > + s += sprintf(s, " bEnableSsim = %s", OPT(p->bEnableSsim)); > these three should be removed > + s += sprintf(s, " rc-bitrate = %d", p->rc.bitrate); > + s += sprintf(s, " rc-rateTolerance = %f", p->rc.rateTolerance); > + s += sprintf(s, " rc-qCompress = %f", p->rc.qCompress); > + s += sprintf(s, " rc-ipFactor = %f", p->rc.ipFactor); > + s += sprintf(s, " rc-pbFactor = %f", p->rc.pbFactor); > + s += sprintf(s, " rc-qpStep = %d", p->rc.qpStep); > + s += sprintf(s, " rc-rateControlMode = %d", p->rc.rateControlMode); > + s += sprintf(s, " rc-qp = %d", p->rc.qp); > + s += sprintf(s, " rc-rateFactor = %d", p->rc.rateFactor); > + s += sprintf(s, " rc-aqMode = %d", p->rc.aqMode); > + s += sprintf(s, " rc-aqStrength = %f", p->rc.aqStrength); > > many of these do not have cli options, in which case they probably shouldn't be included. We should check if x264 has cli options and param_parse() support for them. > + return buf; > +} > diff -r d84ba96117b5 -r 5ad0aaa72d6e source/common/common.h > --- a/source/common/common.h Wed Oct 16 16:06:12 2013 +0530 > +++ b/source/common/common.h Wed Oct 16 17:20:37 2013 +0530 > @@ -73,6 +73,7 @@ > #define MAX_NAL_UNITS 5 > #define MIN_FIFO_SIZE 1000 > #define EMULATION_SIZE 1000 > +#define PARAM_BUFF_SIZE 5000 > > #define CHECKED_MALLOC(var, type, count)\ > {\ > @@ -114,5 +115,6 @@ > int x265_check_params(x265_param_t *param); > void x265_print_params(x265_param_t *param); > int x265_set_globals(x265_param_t *param); > +char *x265_param2string( x265_param_t *p); > > #endif // ifndef X265_COMMON_H > _______________________________________________ > x265-devel mailing list > [email protected] > https://mailman.videolan.org/listinfo/x265-devel > -- Steve Borho
_______________________________________________ x265-devel mailing list [email protected] https://mailman.videolan.org/listinfo/x265-devel
