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
224224 SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
225225 int iNumRefFrame; // number of reference frame used
226226 unsigned int uiFrameToBeCoded; // frame to be encoded (at input frame rate)
227− unsigned int uiGopSize;
228227 bool bEnableRc;
229228 short iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
230229 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
122122 pSvcParam.uiFrameToBeCoded = atoi (strTag[1].c_str());
123123 } else if (strTag[0].compare ("SourceSequenceInRGB24") == 0) {
124124 pSvcParam.iInputCsp = atoi (strTag[1].c_str()) == 0 ? videoFormatI420 : videoFormatRGB;
125− } else if (strTag[0].compare ("GOPSize") == 0) {
126− pSvcParam.uiGopSize = atoi (strTag[1].c_str());
125+ } else if (strTag[0].compare ("TemporalLayerNum") == 0) {
126+ pSvcParam.iTemporalLayerNum = atoi (strTag[1].c_str());
127127 } else if (strTag[0].compare ("IntraPeriod") == 0) {
128128 pSvcParam.uiIntraPeriod = atoi (strTag[1].c_str());
129129 } else if (strTag[0].compare ("EnableSpsPpsIDAddition") == 0) {
@@ -428,8 +428,8 @@ int ParseCommandLine (int argc, char** argv, SEncParamExt& pSvcParam, SFilesSet& · 298 unmodified lines
428428 else if (!strcmp (pCommand, "-frms") && (n < argc))
429429 pSvcParam.uiFrameToBeCoded = atoi (argv[n++]);
430430
431− else if (!strcmp (pCommand, "-gop") && (n < argc))
432− pSvcParam.uiGopSize = atoi (argv[n++]);
431+ else if (!strcmp (pCommand, "-numtl") && (n < argc))
432+ pSvcParam.iTemporalLayerNum = atoi (argv[n++]);
433433
434434 else if (!strcmp (pCommand, "-iper") && (n < argc))
435435 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
18381838 pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
18391839 #endif//DYNAMIC_SLICE_ASSIGN
18401840 #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()
18421842 #endif//MT_ENABLED
18431843
18441844 // 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
14591459 while (iSpatialIdx < iSpatialNum) {
14601460 const int32_t kiDid = pDidList[iSpatialIdx];
14611461 SDLayerParam* pDlp = &pPara->sDependencyLayers[kiDid];
1462− SMulSliceOption* pMso = &pDlp->sSliceCfg;
1462+ SSliceConfig* pMso = &pDlp->sSliceCfg;
14631463 SDqLayer* pCurDq = pCtx->ppDqLayerList[kiDid];
14641464 SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx;
14651465 const uint32_t kuiCountSliceNum = pSliceCtx->iSliceNumInFrame;
testbin/welsenc.cfg+64−64
@@ -1,64 +1,64 @@
1−# Cisco Scalable H.264/AVC Extension Encoder Configuration File
2−
3−#============================== GENERAL ==============================
4−OutputFile test.264 # Bitstream file
5−MaxFrameRate 30 # Maximum frame rate [Hz]
6−FramesToBeEncoded -1 # Number of frames (at input frame rate)
7−
8−GOPSize 4 # GOP Size (at maximum frame rate), 16
9−IntraPeriod 0 # Intra Period ( multipler of GoP size or -1)
10−EnableSpsPpsIDAddition 1
11−
12−EnableFrameCropping 1 # enable frame cropping flag
13−
14−#============================== LOOP FILTER ==============================
15−LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off,
16− # 2: on except for slice boundaries,
17− # 3: two stage. slice boundries on in second stage
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)
20− # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
21−LoopFilterAlphaC0Offset 0 # AlphaOffset(-6..+6): valid range
22−LoopFilterBetaOffset 0 # BetaOffset (-6..+6): valid range
23−
24−InterLayerLoopFilterDisableIDC 0 # filter idc for inter-layer deblocking (0: on, 1: off,
25− # 2: on except for slice boundaries,
26− # 3: two stage. slice boundries on in second stage
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)
29− # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
30−InterLayerLoopFilterAlphaC0Offset 0 # AlphaOffset for inter-layer deblocking
31−InterLayerLoopFilterBetaOffset 0 # BetaOffset for inter-layer deblocking
32−
33−#============================== SOFTWARE IMPLEMENTATION ==============================
34−MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
35−
36−#============================== RATE CONTROL ==============================
37−EnableRC 1 # ENABLE RC
38−TargetBitrate 5000 # Unit: kbps, controled by EnableRC also
39−EnableFrameSkip 1 #Enable Frame Skip
40−
41−#============================== DENOISE CONTROL ==============================
42−EnableDenoise 0 # Enable Denoise (1: enable, 0: disable)
43−
44−#============================== SCENE CHANGE DETECTION CONTROL =======================
45−EnableSceneChangeDetection 1 # Enable Scene Change Detection (1: enable, 0: disable)
46−
47−#============================== BACKGROUND DETECTION CONTROL ==============================
48−EnableBackgroundDetection 1 # BGD control(1: enable, 0: disable)
49−
50−#============================== ADAPTIVE QUANTIZATION CONTROL =======================
51−EnableAdaptiveQuantization 1 # Enable Adaptive Quantization (1: enable, 0: disable)
52−
53−#============================== LONG TERM REFERENCE CONTROL ==============================
54−EnableLongTermReference 0 # Enable Long Term Reference (1: enable, 0: disable)
55−LtrMarkPeriod 30 # Long Term Reference Marking Period
56−
57−#============================== LAYER DEFINITION ==============================
58−PrefixNALAddingCtrl 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)
60− # Can be disabled when no inter spatial layer prediction in case of its value as 0
61−NumLayers 1 # Number of layers
62−//LayerCfg layer0.cfg # Layer 0 configuration file
63−//LayerCfg layer1.cfg # Layer 1 configuration file
64−LayerCfg layer2.cfg # Layer 2 configuration file
1+# Cisco Scalable H.264/AVC Extension Encoder Configuration File
2+
3+#============================== GENERAL ==============================
4+OutputFile test.264 # Bitstream file
5+MaxFrameRate 30 # Maximum frame rate [Hz]
6+FramesToBeEncoded -1 # Number of frames (at input frame rate)
7+
8+TemporalLayerNum 3 # temporal layer number(1--4)
9+IntraPeriod 0 # Intra Period ( multipler of GoP size or -1)
10+EnableSpsPpsIDAddition 1
11+
12+EnableFrameCropping 1 # enable frame cropping flag
13+
14+#============================== LOOP FILTER ==============================
15+LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off,
16+ # 2: on except for slice boundaries,
17+ # 3: two stage. slice boundries on in second stage
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)
20+ # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
21+LoopFilterAlphaC0Offset 0 # AlphaOffset(-6..+6): valid range
22+LoopFilterBetaOffset 0 # BetaOffset (-6..+6): valid range
23+
24+InterLayerLoopFilterDisableIDC 0 # filter idc for inter-layer deblocking (0: on, 1: off,
25+ # 2: on except for slice boundaries,
26+ # 3: two stage. slice boundries on in second stage
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)
29+ # 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
30+InterLayerLoopFilterAlphaC0Offset 0 # AlphaOffset for inter-layer deblocking
31+InterLayerLoopFilterBetaOffset 0 # BetaOffset for inter-layer deblocking
32+
33+#============================== SOFTWARE IMPLEMENTATION ==============================
34+MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
35+
36+#============================== RATE CONTROL ==============================
37+EnableRC 1 # ENABLE RC
38+TargetBitrate 5000 # Unit: kbps, controled by EnableRC also
39+EnableFrameSkip 1 #Enable Frame Skip
40+
41+#============================== DENOISE CONTROL ==============================
42+EnableDenoise 0 # Enable Denoise (1: enable, 0: disable)
43+
44+#============================== SCENE CHANGE DETECTION CONTROL =======================
45+EnableSceneChangeDetection 1 # Enable Scene Change Detection (1: enable, 0: disable)
46+
47+#============================== BACKGROUND DETECTION CONTROL ==============================
48+EnableBackgroundDetection 1 # BGD control(1: enable, 0: disable)
49+
50+#============================== ADAPTIVE QUANTIZATION CONTROL =======================
51+EnableAdaptiveQuantization 1 # Enable Adaptive Quantization (1: enable, 0: disable)
52+
53+#============================== LONG TERM REFERENCE CONTROL ==============================
54+EnableLongTermReference 0 # Enable Long Term Reference (1: enable, 0: disable)
55+LtrMarkPeriod 30 # Long Term Reference Marking Period
56+
57+#============================== LAYER DEFINITION ==============================
58+PrefixNALAddingCtrl 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)
60+ # Can be disabled when no inter spatial layer prediction in case of its value as 0
61+NumLayers 1 # Number of layers
62+//LayerCfg layer0.cfg # Layer 0 configuration file
63+//LayerCfg layer1.cfg # Layer 1 configuration file
64+LayerCfg 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