History

use temporal layer num and remove gop size in external configure

ruil2 committed 12 years ago

Commit f5cd56e1 parent 218ade35 files · +70 −71Browse files

Unified · Split

5 files
  1. codec/api/svc/codec_app_def.h +0 −1
  2. codec/console/enc/src/welsenc.cpp +4 −4
  3. codec/encoder/core/src/encoder_ext.cpp +1 −1
  4. codec/encoder/core/src/slice_multi_threading.cpp +1 −1
  5. testbin/welsenc.cfg +64 −64
codec/api/svc/codec_app_def.h+0−1
@@ -224,7 +224,6 @@ typedef struct TagEncParamExt:SEncParamBase · 223 unmodified lines
224 SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];224 SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
225 int iNumRefFrame; // number of reference frame used225 int iNumRefFrame; // number of reference frame used
226 unsigned int uiFrameToBeCoded; // frame to be encoded (at input frame rate)226 unsigned int uiFrameToBeCoded; // frame to be encoded (at input frame rate)
227 unsigned int uiGopSize;
228 bool bEnableRc;227 bool bEnableRc;
229 short iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;228 short iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
230 short iCountThreadsNum; // # derived from disable_multiple_slice_idc (=0 or >1) means;229 short iCountThreadsNum; // # derived from disable_multiple_slice_idc (=0 or >1) means;
codec/console/enc/src/welsenc.cpp+4−4
@@ -122,8 +122,8 @@ int ParseConfig (CReadConfig& cRdCfg, SEncParamExt& pSvcParam, SFilesSet& sFileS · 121 unmodified lines
122 pSvcParam.uiFrameToBeCoded = atoi (strTag[1].c_str());122 pSvcParam.uiFrameToBeCoded = atoi (strTag[1].c_str());
123 } else if (strTag[0].compare ("SourceSequenceInRGB24") == 0) {123 } else if (strTag[0].compare ("SourceSequenceInRGB24") == 0) {
124 pSvcParam.iInputCsp = atoi (strTag[1].c_str()) == 0 ? videoFormatI420 : videoFormatRGB;124 pSvcParam.iInputCsp = atoi (strTag[1].c_str()) == 0 ? videoFormatI420 : videoFormatRGB;
125 } else if (strTag[0].compare ("GOPSize") == 0) {125 } else if (strTag[0].compare ("TemporalLayerNum") == 0) {
126 pSvcParam.uiGopSize = atoi (strTag[1].c_str());126 pSvcParam.iTemporalLayerNum = atoi (strTag[1].c_str());
127 } else if (strTag[0].compare ("IntraPeriod") == 0) {127 } else if (strTag[0].compare ("IntraPeriod") == 0) {
128 pSvcParam.uiIntraPeriod = atoi (strTag[1].c_str());128 pSvcParam.uiIntraPeriod = atoi (strTag[1].c_str());
129 } else if (strTag[0].compare ("EnableSpsPpsIDAddition") == 0) {129 } else if (strTag[0].compare ("EnableSpsPpsIDAddition") == 0) {
@@ -428,8 +428,8 @@ int ParseCommandLine (int argc, char** argv, SEncParamExt& pSvcParam, SFilesSet& · 298 unmodified lines
428 else if (!strcmp (pCommand, "-frms") && (n < argc))428 else if (!strcmp (pCommand, "-frms") && (n < argc))
429 pSvcParam.uiFrameToBeCoded = atoi (argv[n++]);429 pSvcParam.uiFrameToBeCoded = atoi (argv[n++]);
430 430
431 else if (!strcmp (pCommand, "-gop") && (n < argc))431 else if (!strcmp (pCommand, "-numtl") && (n < argc))
432 pSvcParam.uiGopSize = atoi (argv[n++]);432 pSvcParam.iTemporalLayerNum = atoi (argv[n++]);
433 433
434 else if (!strcmp (pCommand, "-iper") && (n < argc))434 else if (!strcmp (pCommand, "-iper") && (n < argc))
435 pSvcParam.uiIntraPeriod = atoi (argv[n++]);435 pSvcParam.uiIntraPeriod = atoi (argv[n++]);
codec/encoder/core/src/encoder_ext.cpp+1−1
@@ -1838,7 +1838,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 1837 unmodified lines
1838 pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()1838 pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
1839#endif//DYNAMIC_SLICE_ASSIGN1839#endif//DYNAMIC_SLICE_ASSIGN
1840#else//!MT_ENABLED1840#else//!MT_ENABLED
1841 int16_t iSliceNum = pSlcArg->iSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()1841 int16_t iSliceNum = pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
1842#endif//MT_ENABLED1842#endif//MT_ENABLED
1843 1843
1844 // NOTE: Per design, in case MT/DYNAMIC_SLICE_ASSIGN enabled, for SM_FIXEDSLCNUM_SLICE mode,1844 // NOTE: Per design, in case MT/DYNAMIC_SLICE_ASSIGN enabled, for SM_FIXEDSLCNUM_SLICE mode,
codec/encoder/core/src/slice_multi_threading.cpp+1−1
@@ -1459,7 +1459,7 @@ void TrackSliceConsumeTime (sWelsEncCtx* pCtx, int32_t* pDidList, const int32_t · 1458 unmodified lines
1459 while (iSpatialIdx < iSpatialNum) {1459 while (iSpatialIdx < iSpatialNum) {
1460 const int32_t kiDid = pDidList[iSpatialIdx];1460 const int32_t kiDid = pDidList[iSpatialIdx];
1461 SDLayerParam* pDlp = &pPara->sDependencyLayers[kiDid];1461 SDLayerParam* pDlp = &pPara->sDependencyLayers[kiDid];
1462 SMulSliceOption* pMso = &pDlp->sSliceCfg;1462 SSliceConfig* pMso = &pDlp->sSliceCfg;
1463 SDqLayer* pCurDq = pCtx->ppDqLayerList[kiDid];1463 SDqLayer* pCurDq = pCtx->ppDqLayerList[kiDid];
1464 SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx;1464 SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx;
1465 const uint32_t kuiCountSliceNum = pSliceCtx->iSliceNumInFrame;1465 const uint32_t kuiCountSliceNum = pSliceCtx->iSliceNumInFrame;
testbin/welsenc.cfg+64−64
@@ -1,64 +1,64 @@
1# Cisco Scalable H.264/AVC Extension Encoder Configuration File1# Cisco Scalable H.264/AVC Extension Encoder Configuration File
2 2
3#============================== GENERAL ==============================3#============================== GENERAL ==============================
4OutputFile test.264 # Bitstream file4OutputFile test.264 # Bitstream file
5MaxFrameRate 30 # Maximum frame rate [Hz]5MaxFrameRate 30 # Maximum frame rate [Hz]
6FramesToBeEncoded -1 # Number of frames (at input frame rate)6FramesToBeEncoded -1 # Number of frames (at input frame rate)
7 7
8GOPSize 4 # GOP Size (at maximum frame rate), 168TemporalLayerNum 3 # temporal layer number(1--4)
9IntraPeriod 0 # Intra Period ( multipler of GoP size or -1)9IntraPeriod 0 # Intra Period ( multipler of GoP size or -1)
10EnableSpsPpsIDAddition 110EnableSpsPpsIDAddition 1
11 11
12EnableFrameCropping 1 # enable frame cropping flag12EnableFrameCropping 1 # enable frame cropping flag
13 13
14#============================== LOOP FILTER ==============================14#============================== LOOP FILTER ==============================
15LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off,15LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off,
16 # 2: on except for slice boundaries,16 # 2: on except for slice boundaries,
17 # 3: two stage. slice boundries on in second stage17 # 3: two stage. slice boundries on in second stage
18 # 4: Luma on but Chroma off (w.r.t. idc=0)18 # 4: Luma on but Chroma off (w.r.t. idc=0)
19 # 5: Luma on except on slice boundaries, but Chroma off in enh. layer (w.r.t. idc=2)19 # 5: Luma on except on slice boundaries, but Chroma off in enh. layer (w.r.t. idc=2)
20 # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)20 # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
21LoopFilterAlphaC0Offset 0 # AlphaOffset(-6..+6): valid range21LoopFilterAlphaC0Offset 0 # AlphaOffset(-6..+6): valid range
22LoopFilterBetaOffset 0 # BetaOffset (-6..+6): valid range22LoopFilterBetaOffset 0 # BetaOffset (-6..+6): valid range
23 23
24InterLayerLoopFilterDisableIDC 0 # filter idc for inter-layer deblocking (0: on, 1: off,24InterLayerLoopFilterDisableIDC 0 # filter idc for inter-layer deblocking (0: on, 1: off,
25 # 2: on except for slice boundaries,25 # 2: on except for slice boundaries,
26 # 3: two stage. slice boundries on in second stage26 # 3: two stage. slice boundries on in second stage
27 # 4: Luma on but Chroma off in enh. layer (w.r.t. idc=0)27 # 4: Luma on but Chroma off in enh. layer (w.r.t. idc=0)
28 # 5: Luma on except on slice boundaries, but Chroma off in enh. layer (w.r.t. idc=2)28 # 5: Luma on except on slice boundaries, but Chroma off in enh. layer (w.r.t. idc=2)
29 # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)29 # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
30InterLayerLoopFilterAlphaC0Offset 0 # AlphaOffset for inter-layer deblocking30InterLayerLoopFilterAlphaC0Offset 0 # AlphaOffset for inter-layer deblocking
31InterLayerLoopFilterBetaOffset 0 # BetaOffset for inter-layer deblocking31InterLayerLoopFilterBetaOffset 0 # BetaOffset for inter-layer deblocking
32 32
33#============================== SOFTWARE IMPLEMENTATION ==============================33#============================== SOFTWARE IMPLEMENTATION ==============================
34MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;34MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
35 35
36#============================== RATE CONTROL ==============================36#============================== RATE CONTROL ==============================
37EnableRC 1 # ENABLE RC37EnableRC 1 # ENABLE RC
38TargetBitrate 5000 # Unit: kbps, controled by EnableRC also38TargetBitrate 5000 # Unit: kbps, controled by EnableRC also
39EnableFrameSkip 1 #Enable Frame Skip39EnableFrameSkip 1 #Enable Frame Skip
40 40
41#============================== DENOISE CONTROL ==============================41#============================== DENOISE CONTROL ==============================
42EnableDenoise 0 # Enable Denoise (1: enable, 0: disable)42EnableDenoise 0 # Enable Denoise (1: enable, 0: disable)
43 43
44#============================== SCENE CHANGE DETECTION CONTROL =======================44#============================== SCENE CHANGE DETECTION CONTROL =======================
45EnableSceneChangeDetection 1 # Enable Scene Change Detection (1: enable, 0: disable)45EnableSceneChangeDetection 1 # Enable Scene Change Detection (1: enable, 0: disable)
46 46
47#============================== BACKGROUND DETECTION CONTROL ==============================47#============================== BACKGROUND DETECTION CONTROL ==============================
48EnableBackgroundDetection 1 # BGD control(1: enable, 0: disable)48EnableBackgroundDetection 1 # BGD control(1: enable, 0: disable)
49 49
50#============================== ADAPTIVE QUANTIZATION CONTROL =======================50#============================== ADAPTIVE QUANTIZATION CONTROL =======================
51EnableAdaptiveQuantization 1 # Enable Adaptive Quantization (1: enable, 0: disable)51EnableAdaptiveQuantization 1 # Enable Adaptive Quantization (1: enable, 0: disable)
52 52
53#============================== LONG TERM REFERENCE CONTROL ==============================53#============================== LONG TERM REFERENCE CONTROL ==============================
54EnableLongTermReference 0 # Enable Long Term Reference (1: enable, 0: disable)54EnableLongTermReference 0 # Enable Long Term Reference (1: enable, 0: disable)
55LtrMarkPeriod 30 # Long Term Reference Marking Period55LtrMarkPeriod 30 # Long Term Reference Marking Period
56 56
57#============================== LAYER DEFINITION ==============================57#============================== LAYER DEFINITION ==============================
58PrefixNALAddingCtrl 0 # Control flag of adding prefix unit (0: off, 1: on)58PrefixNALAddingCtrl 0 # Control flag of adding prefix unit (0: off, 1: on)
59 # It shall always be on in SVC contexts (i.e. when there are CGS/MGS/spatial enhancement layers)59 # It shall always be on in SVC contexts (i.e. when there are CGS/MGS/spatial enhancement layers)
60 # Can be disabled when no inter spatial layer prediction in case of its value as 060 # Can be disabled when no inter spatial layer prediction in case of its value as 0
61NumLayers 1 # Number of layers61NumLayers 1 # Number of layers
62//LayerCfg layer0.cfg # Layer 0 configuration file62//LayerCfg layer0.cfg # Layer 0 configuration file
63//LayerCfg layer1.cfg # Layer 1 configuration file63//LayerCfg layer1.cfg # Layer 1 configuration file
64LayerCfg layer2.cfg # Layer 2 configuration file64LayerCfg layer2.cfg # Layer 2 configuration file

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t