From 67327dfb2ebe527fb676c601b6eb3a6b08537e1c Mon Sep 17 00:00:00 2001 From: ruil2 Date: Mon, 12 May 2014 11:05:16 +0800 Subject: [PATCH] add the maximum nal size setting in command line --- codec/console/enc/src/welsenc.cpp | 9 +++++++++ testbin/welsenc.cfg | 1 + testbin/welsenc_arbitrary_res.cfg | 1 + testbin/welsenc_ios.cfg | 1 + testbin/welsenc_vd_1d.cfg | 1 + testbin/welsenc_vd_rc.cfg | 1 + 6 files changed, 14 insertions(+) diff --git a/codec/console/enc/src/welsenc.cpp b/codec/console/enc/src/welsenc.cpp index b9458df6..7eb02ea3 100644 --- a/codec/console/enc/src/welsenc.cpp +++ b/codec/console/enc/src/welsenc.cpp @@ -212,6 +212,8 @@ int ParseConfig (CReadConfig& cRdCfg, SSourcePicture* pSrcPic, SEncParamExt& pSv pSvcParam.iTemporalLayerNum = atoi (strTag[1].c_str()); } else if (strTag[0].compare ("IntraPeriod") == 0) { pSvcParam.uiIntraPeriod = atoi (strTag[1].c_str()); + } else if (strTag[0].compare ("MaxNalSize") == 0) { + pSvcParam.uiMaxNalSize = atoi (strTag[1].c_str()); } else if (strTag[0].compare ("EnableSpsPpsIDAddition") == 0) { pSvcParam.bEnableSpsPpsIdAddition = atoi (strTag[1].c_str()) ? true : false; } else if (strTag[0].compare ("EnableScalableSEI") == 0) { @@ -326,6 +328,9 @@ int ParseCommandLine (int argc, char** argv, SEncParamExt& sParam) { else if (!strcmp (pCmd, "-iper") && (i < argc)) sParam.uiIntraPeriod = atoi (argv[i++]); + else if (!strcmp (pCmd, "-nalsize") && (i < argc)) + sParam.uiMaxNalSize = atoi (argv[i++]); + else if (!strcmp (pCmd, "-spsid") && (i < argc)) sParam.bEnableSpsPpsIdAddition = atoi (argv[i++]) ? true : false; @@ -388,6 +393,7 @@ void PrintHelp() { printf (" -frms Number of total frames to be encoded\n"); printf (" -gop GOPSize - GOP size (1,2,4,8, default: 1)\n"); printf (" -iper Intra period (default: -1) : must be a power of 2 of GOP size (or -1)\n"); + printf (" -nalsize the Maximum NAL size. which should be larger than the each layer slicesize when slice mode equals to SM_DYN_SLICE\n"); printf (" -spsid Enable id adding in SPS/PPS per IDR \n"); printf (" -denois Control denoising (default: 0)\n"); printf (" -scene Control scene change detection (default: 0)\n"); @@ -442,6 +448,9 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE else if (!strcmp (pCommand, "-iper") && (n < argc)) pSvcParam.uiIntraPeriod = atoi (argv[n++]); + else if (!strcmp (pCommand, "-nalsize") && (n < argc)) + pSvcParam.uiMaxNalSize = atoi (argv[n++]); + else if (!strcmp (pCommand, "-spsid") && (n < argc)) pSvcParam.bEnableSpsPpsIdAddition = atoi (argv[n++]) ? true : false; diff --git a/testbin/welsenc.cfg b/testbin/welsenc.cfg index d9aff576..b489c3cb 100644 --- a/testbin/welsenc.cfg +++ b/testbin/welsenc.cfg @@ -15,6 +15,7 @@ EnableSpsPpsIDAddition 1 EnableFrameCropping 1 # enable frame cropping flag +MaxNalSize 1500 # Unit:Byte, Maximum Nal size #============================== LOOP FILTER ============================== LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off, # 2: on except for slice boundaries, diff --git a/testbin/welsenc_arbitrary_res.cfg b/testbin/welsenc_arbitrary_res.cfg index b043eb18..74c5444a 100644 --- a/testbin/welsenc_arbitrary_res.cfg +++ b/testbin/welsenc_arbitrary_res.cfg @@ -15,6 +15,7 @@ EnableSpsPpsIDAddition 1 EnableFrameCropping 1 # enable frame cropping flag +MaxNalSize 1500 # Unit:Byte, Maximum Nal size #============================== LOOP FILTER ============================== LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off, # 2: on except for slice boundaries, diff --git a/testbin/welsenc_ios.cfg b/testbin/welsenc_ios.cfg index 6a1edc6e..e14be9e8 100644 --- a/testbin/welsenc_ios.cfg +++ b/testbin/welsenc_ios.cfg @@ -15,6 +15,7 @@ EnableSpsPpsIDAddition 1 EnableFrameCropping 1 # enable frame cropping flag +MaxNalSize 1500 # Unit:Byte, Maximum Nal size #============================== LOOP FILTER ============================== LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off, # 2: on except for slice boundaries, diff --git a/testbin/welsenc_vd_1d.cfg b/testbin/welsenc_vd_1d.cfg index 4cb0c248..50b22d56 100644 --- a/testbin/welsenc_vd_1d.cfg +++ b/testbin/welsenc_vd_1d.cfg @@ -15,6 +15,7 @@ EnableSpsPpsIDAddition 1 EnableFrameCropping 1 # enable frame cropping flag +MaxNalSize 1500 # Unit:Byte, Maximum Nal size #============================== LOOP FILTER ============================== LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off, # 2: on except for slice boundaries, diff --git a/testbin/welsenc_vd_rc.cfg b/testbin/welsenc_vd_rc.cfg index 871e3ebd..c6a65780 100644 --- a/testbin/welsenc_vd_rc.cfg +++ b/testbin/welsenc_vd_rc.cfg @@ -15,6 +15,7 @@ EnableSpsPpsIDAddition 1 EnableFrameCropping 1 # enable frame cropping flag +MaxNalSize 1500 # Unit:Byte, Maximum Nal size #============================== LOOP FILTER ============================== LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off, # 2: on except for slice boundaries,