From ab7eb1535dfb55984c43e021dfa676158f2d0d3c Mon Sep 17 00:00:00 2001 From: Karina Date: Wed, 25 Nov 2015 14:21:44 +0800 Subject: [PATCH] add minqp and maxqp parameters in console --- codec/console/enc/src/welsenc.cpp | 12 ++++++++++++ testbin/welsenc.cfg | 3 ++- testbin/welsenc_arbitrary_res.cfg | 3 ++- testbin/welsenc_ios.cfg | 3 ++- testbin/welsenc_vd_1d.cfg | 3 ++- testbin/welsenc_vd_rc.cfg | 3 ++- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/codec/console/enc/src/welsenc.cpp b/codec/console/enc/src/welsenc.cpp index 4426f45d..6a91c2f4 100644 --- a/codec/console/enc/src/welsenc.cpp +++ b/codec/console/enc/src/welsenc.cpp @@ -308,6 +308,10 @@ int ParseConfig (CReadConfig& cRdCfg, SSourcePicture* pSrcPic, SEncParamExt& pSv fprintf (stderr, "Invalid max overall bitrate setting due to RC enabled. Check MaxOverallBitrate field please!\n"); return 1; } + } else if (strTag[0].compare ("MaxQp") == 0) { + pSvcParam.iMaxQp = atoi (strTag[1].c_str()); + } else if (strTag[0].compare ("MinQp") == 0) { + pSvcParam.iMinQp = atoi (strTag[1].c_str()); } else if (strTag[0].compare ("EnableDenoise") == 0) { pSvcParam.bEnableDenoise = atoi (strTag[1].c_str()) ? true : false; } else if (strTag[0].compare ("EnableSceneChangeDetection") == 0) { @@ -399,6 +403,8 @@ void PrintHelp() { printf (" -rc rate control mode: 0-quality mode; 1-bitrate mode; 2-bitrate limited mode; -1-rc off \n"); printf (" -tarb Overall target bitrate\n"); printf (" -maxbrTotal Overall max bitrate\n"); + printf (" -maxqp Maximum Qp\n"); + printf (" -minqp Minimum Qp\n"); printf (" -numl Number Of Layers: Must exist with layer_cfg file and the number of input layer_cfg file must equal to the value set by this command\n"); printf (" The options below are layer-based: (need to be set with layer id)\n"); printf (" -lconfig (Layer) (spatial layer configure file)\n"); @@ -528,6 +534,12 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE else if (!strcmp (pCommand, "-maxbrTotal") && (n < argc)) pSvcParam.iMaxBitrate = 1000 * atoi (argv[n++]); + else if (!strcmp (pCommand, "-maxqp") && (n < argc)) + pSvcParam.iMaxQp = atoi (argv[n++]); + + else if (!strcmp (pCommand, "-minqp") && (n < argc)) + pSvcParam.iMinQp = atoi (argv[n++]); + else if (!strcmp (pCommand, "-numl") && (n < argc)) { pSvcParam.iSpatialLayerNum = atoi (argv[n++]); } else if (!strcmp (pCommand, "-lconfig") && (n < argc)) { diff --git a/testbin/welsenc.cfg b/testbin/welsenc.cfg index 2b03820f..32d35f89 100644 --- a/testbin/welsenc.cfg +++ b/testbin/welsenc.cfg @@ -34,7 +34,8 @@ RCMode 0 # 0: quality mode; 1: bitrate mode; TargetBitrate 5000 # Unit: kbps, controled by EnableRC also MaxOverallBitrate 0 # Unit: kbps, max bitrate overall, 0 - unspecified EnableFrameSkip 1 #Enable Frame Skip - +MaxQp 51 # maximum quant +MinQp 0 # minimum quant #============================== DENOISE CONTROL ============================== EnableDenoise 0 # Enable Denoise (1: enable, 0: disable) diff --git a/testbin/welsenc_arbitrary_res.cfg b/testbin/welsenc_arbitrary_res.cfg index dcb5c1e1..47c5e0e4 100644 --- a/testbin/welsenc_arbitrary_res.cfg +++ b/testbin/welsenc_arbitrary_res.cfg @@ -33,7 +33,8 @@ MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple RCMode 0 # 0: quality mode; 1: bitrate mode; # 2: buffer based mode,can't control bitrate; -1: rc off mode; TargetBitrate 5000 # Unit: kbps, controled by EnableRC also MaxOverallBitrate 6000 # Unit: kbps, max bitrate overall - +MaxQp 51 # maximum quant +MinQp 0 # minimum quant #============================== DENOISE CONTROL ============================== EnableDenoise 0 # Enable Denoise (1: enable, 0: disable) diff --git a/testbin/welsenc_ios.cfg b/testbin/welsenc_ios.cfg index 05886aff..3aeef194 100644 --- a/testbin/welsenc_ios.cfg +++ b/testbin/welsenc_ios.cfg @@ -34,7 +34,8 @@ RCMode 0 # 0: quality mode; 1: bitrate mode; TargetBitrate 5000 # Unit: kbps, controled by EnableRC also MaxOverallBitrate 6000 # Unit: kbps, max bitrate overall EnableFrameSkip 1 #Enable Frame Skip - +MaxQp 51 # maximum quant +MinQp 0 # minimum quant #============================== DENOISE CONTROL ============================== EnableDenoise 0 # Enable Denoise (1: enable, 0: disable) diff --git a/testbin/welsenc_vd_1d.cfg b/testbin/welsenc_vd_1d.cfg index 3381729a..10627f58 100644 --- a/testbin/welsenc_vd_1d.cfg +++ b/testbin/welsenc_vd_1d.cfg @@ -33,7 +33,8 @@ MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple RCMode 0 # 0: quality mode; 1: bitrate mode; # 2: buffer based mode,can't control bitrate; -1: rc off mode; TargetBitrate 5000 # Unit: kbps, controled by EnableRC also MaxOverallBitrate 6000 # Unit: kbps, max bitrate overall - +MaxQp 51 # maximum quant +MinQp 0 # minimum quant #============================== DENOISE CONTROL ============================== EnableDenoise 0 # Enable Denoise (1: enable, 0: disable) diff --git a/testbin/welsenc_vd_rc.cfg b/testbin/welsenc_vd_rc.cfg index 4db90595..536dfc15 100644 --- a/testbin/welsenc_vd_rc.cfg +++ b/testbin/welsenc_vd_rc.cfg @@ -33,7 +33,8 @@ MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple RCMode 0 # 0: quality mode; 1: bitrate mode; # 2: buffer based mode,can't control bitrate; -1: rc off mode; TargetBitrate 600 # Unit: kbps, controled by EnableRC also MaxOverallBitrate 800 # Unit: kbps, max bitrate overall - +MaxQp 51 # maximum quant +MinQp 0 # minimum quant #============================== DENOISE CONTROL ============================== EnableDenoise 1 # Enable Denoise (1: enable, 0: disable)