shithub: openh264

Download patch

ref: a1a22205c63648430e69b587c598b065d29d48a9
parent: 2f8f2880ffdd427d3e066529676578d4f9aa7f3e
parent: 67327dfb2ebe527fb676c601b6eb3a6b08537e1c
author: huili2 <[email protected]>
date: Mon May 12 08:38:01 EDT 2014

Merge pull request #814 from ruil2/enc_nalsize

    add the maximum nal size setting in command line

--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -212,6 +212,8 @@
         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 @@
     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 @@
   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");
@@ -441,6 +447,9 @@
 
     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;
--- a/testbin/welsenc.cfg
+++ b/testbin/welsenc.cfg
@@ -15,6 +15,7 @@
 
 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,
--- a/testbin/welsenc_arbitrary_res.cfg
+++ b/testbin/welsenc_arbitrary_res.cfg
@@ -15,6 +15,7 @@
 
 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,
--- a/testbin/welsenc_ios.cfg
+++ b/testbin/welsenc_ios.cfg
@@ -15,6 +15,7 @@
 
 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,
--- a/testbin/welsenc_vd_1d.cfg
+++ b/testbin/welsenc_vd_1d.cfg
@@ -15,6 +15,7 @@
 
 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,
--- a/testbin/welsenc_vd_rc.cfg
+++ b/testbin/welsenc_vd_rc.cfg
@@ -15,6 +15,7 @@
 
 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,