History

encoder interface update step1

ruil2 committed 12 years ago

Commit 35fa4291 parent 3ff7e3d20 files · +598 −501Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 20 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+126−125
@@ -88,7 +88,7 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 87 unmodified lines
8888
8989 assert (pCfg != NULL);
9090
91− for (i = 0; i < pCfg->iNumDependencyLayer; ++ i) {
91+ for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
9292 SDLayerParam* fDlp = &pCfg->sDependencyLayers[i];
9393 if (fDlp->fOutputFrameRate > fDlp->fInputFrameRate || (fDlp->fInputFrameRate >= -fEpsn
9494 && fDlp->fInputFrameRate <= fEpsn)
@@ -109,7 +109,7 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 14 unmodified lines
109109 }
110110 }
111111
112− for (i = 0; i < pCfg->iNumDependencyLayer; ++ i) {
112+ for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
113113 SDLayerParam* fDlp = &pCfg->sDependencyLayers[i];
114114 if (fDlp->fInputFrameRate > fMaxFrameRate)
115115 fMaxFrameRate = fDlp->fInputFrameRate;
@@ -120,7 +120,7 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 4 unmodified lines
120120 pCfg->fMaxFrameRate = fMaxFrameRate;
121121 }
122122
123− for (i = 0; i < pCfg->iNumDependencyLayer; ++ i) {
123+ for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
124124 SDLayerParam* fDlp = &pCfg->sDependencyLayers[i];
125125
126126 pLastSpatialParam = fDlp;
@@ -142,19 +142,19 @@ int32_t ParamValidationExt (void* pParam) { · 15 unmodified lines
142142 if (NULL == pCodingParam)
143143 return 1;
144144
145− if (pCodingParam->iNumDependencyLayer < 1 || pCodingParam->iNumDependencyLayer > MAX_DEPENDENCY_LAYER) {
145+ if (pCodingParam->iSpatialLayerNum < 1 || pCodingParam->iSpatialLayerNum > MAX_DEPENDENCY_LAYER) {
146146 #if defined (_DEBUG)
147− fprintf (stderr, "ParamValidationExt(), monitor invalid pCodingParam->iNumDependencyLayer: %d!\n",
148− pCodingParam->iNumDependencyLayer);
147+ fprintf (stderr, "ParamValidationExt(), monitor invalid pCodingParam->iSpatialLayerNum: %d!\n",
148+ pCodingParam->iSpatialLayerNum);
149149 #endif//#if _DEBUG
150150
151151 return 1;
152152 }
153153
154− if (pCodingParam->iNumTemporalLayer < 1 || pCodingParam->iNumTemporalLayer > MAX_TEMPORAL_LEVEL) {
154+ if (pCodingParam->iTemporalLayerNum < 1 || pCodingParam->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) {
155155 #if defined (_DEBUG)
156− fprintf (stderr, "ParamValidationExt(), monitor invalid pCodingParam->iNumTemporalLayer: %d!\n",
157− pCodingParam->iNumTemporalLayer);
156+ fprintf (stderr, "ParamValidationExt(), monitor invalid pCodingParam->iTemporalLayerNum: %d!\n",
157+ pCodingParam->iTemporalLayerNum);
158158 #endif//#if _DEBUG
159159 return 1;
160160 }
@@ -201,7 +201,7 @@ int32_t ParamValidationExt (void* pParam) { · 40 unmodified lines
201201 pCodingParam->bDeblockingParallelFlag = false;
202202 #endif//MT_ENABLED
203203
204− for (i = 0; i < pCodingParam->iNumDependencyLayer; ++ i) {
204+ for (i = 0; i < pCodingParam->iSpatialLayerNum; ++ i) {
205205 SDLayerParam* fDlp = &pCodingParam->sDependencyLayers[i];
206206 const int32_t kiPicWidth = fDlp->iFrameWidth;
207207 const int32_t kiPicHeight = fDlp->iFrameHeight;
@@ -224,9 +224,9 @@ int32_t ParamValidationExt (void* pParam) { · 16 unmodified lines
224224 return 1;
225225 }
226226
227− if (fDlp->sMso.uiSliceMode >= SM_RESERVED) {
227+ if (fDlp->sSliceCfg.uiSliceMode >= SM_RESERVED) {
228228 #if defined (_DEBUG)
229− fprintf (stderr, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n", fDlp->sMso.uiSliceMode);
229+ fprintf (stderr, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n", fDlp->sSliceCfg.uiSliceMode);
230230 #endif//#if _DEBUG
231231 return 1;
232232 }
@@ -234,102 +234,102 @@ int32_t ParamValidationExt (void* pParam) { · 1 unmodified line
234234 //check pSlice settings under multi-pSlice
235235 if (kiPicWidth <= 16 && kiPicHeight <= 16) {
236236 //only have one MB, set to single_slice
237− fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE;
237+ fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
238238 }
239− switch (fDlp->sMso.uiSliceMode) {
239+ switch (fDlp->sSliceCfg.uiSliceMode) {
240240 case SM_SINGLE_SLICE:
241− fDlp->sMso.sSliceArgument.iSliceNum = 1;
242− fDlp->sMso.sSliceArgument.uiSliceSizeConstraint = 0;
243− fDlp->sMso.sSliceArgument.iSliceNum = 0;
241+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum = 1;
242+ fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0;
243+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum = 0;
244244 for (iIdx = 0; iIdx < MAX_SLICES_NUM; iIdx++) {
245− fDlp->sMso.sSliceArgument.uiSliceMbNum[iIdx] = 0;
245+ fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[iIdx] = 0;
246246 }
247247 break;
248248 case SM_FIXEDSLCNUM_SLICE: {
249− fDlp->sMso.sSliceArgument.uiSliceSizeConstraint = 0;
249+ fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0;
250250
251251 iMbWidth = (kiPicWidth + 15) >> 4;
252252 iMbHeight = (kiPicHeight + 15) >> 4;
253253 iMbNumInFrame = iMbWidth * iMbHeight;
254254 iMaxSliceNum = MAX_SLICES_NUM;
255− if (fDlp->sMso.sSliceArgument.iSliceNum <= 0
256− || fDlp->sMso.sSliceArgument.iSliceNum > iMaxSliceNum) {
255+ if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum <= 0
256+ || fDlp->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) {
257257 #if defined (_DEBUG)
258− fprintf (stderr, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n", fDlp->sMso.sSliceArgument.iSliceNum);
258+ fprintf (stderr, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n", fDlp->sSliceCfg.sSliceArgument.uiSliceNum);
259259 #endif//#if _DEBUG
260260 return 1;
261261 }
262− if (fDlp->sMso.sSliceArgument.iSliceNum == 1) {
262+ if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum == 1) {
263263 #if defined (_DEBUG)
264264 fprintf (stderr,
265265 "ParamValidationExt(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type!\n",
266− fDlp->sMso.sSliceArgument.iSliceNum);
266+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum);
267267 #endif//#if _DEBUG
268− fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE;
268+ fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
269269 break;
270270 }
271271 if (pCodingParam->bEnableRc) { // multiple slices verify with gom
272272 //check uiSliceNum
273− GomValidCheckSliceNum (iMbWidth, iMbHeight, (int32_t*)&fDlp->sMso.sSliceArgument.iSliceNum);
274− assert (fDlp->sMso.sSliceArgument.iSliceNum > 1);
273+ GomValidCheckSliceNum (iMbWidth, iMbHeight, (int32_t*)&fDlp->sSliceCfg.sSliceArgument.uiSliceNum);
274+ assert (fDlp->sSliceCfg.sSliceArgument.uiSliceNum > 1);
275275 //set uiSliceMbNum with current uiSliceNum
276− GomValidCheckSliceMbNum (iMbWidth, iMbHeight, &fDlp->sMso.sSliceArgument);
276+ GomValidCheckSliceMbNum (iMbWidth, iMbHeight, &fDlp->sSliceCfg.sSliceArgument);
277277 } else if (!CheckFixedSliceNumMultiSliceSetting (iMbNumInFrame,
278− &fDlp->sMso.sSliceArgument)) { // verify interleave mode settings
278+ &fDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
279279 //check uiSliceMbNum with current uiSliceNum
280280 #if defined (_DEBUG)
281281 fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
282− fDlp->sMso.sSliceArgument.uiSliceMbNum[0]);
282+ fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
283283 #endif//#if _DEBUG
284284 return 1;
285285 }
286286 // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting
287287 if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) {
288− fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE;
289− fDlp->sMso.sSliceArgument.iSliceNum = 1;
288+ fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
289+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum = 1;
290290 break;
291291 }
292292 }
293293 break;
294294 case SM_RASTER_SLICE: {
295− fDlp->sMso.sSliceArgument.uiSliceSizeConstraint = 0;
295+ fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0;
296296
297297 iMbWidth = (kiPicWidth + 15) >> 4;
298298 iMbHeight = (kiPicHeight + 15) >> 4;
299299 iMbNumInFrame = iMbWidth * iMbHeight;
300300 iMaxSliceNum = MAX_SLICES_NUM;
301− if (fDlp->sMso.sSliceArgument.uiSliceMbNum[0] <= 0) {
301+ if (fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0] <= 0) {
302302 #if defined (_DEBUG)
303303 fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
304− fDlp->sMso.sSliceArgument.uiSliceMbNum[0]);
304+ fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
305305 #endif//#if _DEBUG
306306 return 1;
307307 }
308308
309− if (!CheckRasterMultiSliceSetting (iMbNumInFrame, &fDlp->sMso.sSliceArgument)) { // verify interleave mode settings
309+ if (!CheckRasterMultiSliceSetting (iMbNumInFrame, &fDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
310310 #if defined (_DEBUG)
311311 fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
312− fDlp->sMso.sSliceArgument.uiSliceMbNum[0]);
312+ fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
313313 #endif//#if _DEBUG
314314 return 1;
315315 }
316− if (fDlp->sMso.sSliceArgument.iSliceNum <= 0
317− || fDlp->sMso.sSliceArgument.iSliceNum > iMaxSliceNum) { // verify interleave mode settings
316+ if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum <= 0
317+ || fDlp->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) { // verify interleave mode settings
318318 #if defined (_DEBUG)
319319 fprintf (stderr, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!\n",
320− fDlp->sMso.sSliceArgument.iSliceNum);
320+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum);
321321 #endif//#if _DEBUG
322322 return 1;
323323 }
324− if (fDlp->sMso.sSliceArgument.iSliceNum == 1) {
324+ if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum == 1) {
325325 #if defined (_DEBUG)
326326 fprintf (stderr, "ParamValidationExt(), pSlice setting for SM_RASTER_SLICE now turn to SM_SINGLE_SLICE!\n");
327327 #endif//#if _DEBUG
328− fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE;
328+ fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
329329 break;
330330 }
331331 #ifdef MT_ENABLED
332− if (pCodingParam->bEnableRc && fDlp->sMso.sSliceArgument.iSliceNum > 1) {
332+ if (pCodingParam->bEnableRc && fDlp->sSliceCfg.sSliceArgument.uiSliceNum > 1) {
333333 #if defined (_DEBUG)
334334 fprintf (stderr, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!\n");
335335 #endif//#if _DEBUG
@@ -337,14 +337,14 @@ int32_t ParamValidationExt (void* pParam) { · 1 unmodified line
337337 #endif
338338 // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting
339339 if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) {
340− fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE;
341− fDlp->sMso.sSliceArgument.iSliceNum = 1;
340+ fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
341+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum = 1;
342342 break;
343343 }
344344 }
345345 break;
346346 case SM_ROWMB_SLICE: {
347− fDlp->sMso.sSliceArgument.uiSliceSizeConstraint = 0;
347+ fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0;
348348
349349 iMbWidth = (kiPicWidth + 15) >> 4;
350350 iMbHeight = (kiPicHeight + 15) >> 4;
@@ -355,18 +355,18 @@ int32_t ParamValidationExt (void* pParam) { · 4 unmodified lines
355355 #endif//#if _DEBUG
356356 return 1;
357357 }
358− fDlp->sMso.sSliceArgument.iSliceNum = iMbHeight;
358+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum = iMbHeight;
359359
360− if (fDlp->sMso.sSliceArgument.iSliceNum <= 0) {
360+ if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum <= 0) {
361361 #if defined (_DEBUG)
362− fprintf (stderr, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n", fDlp->sMso.sSliceArgument.iSliceNum);
362+ fprintf (stderr, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n", fDlp->sSliceCfg.sSliceArgument.uiSliceNum);
363363 #endif//#if _DEBUG
364364 return 1;
365365 }
366− if (!CheckRowMbMultiSliceSetting (iMbWidth, &fDlp->sMso.sSliceArgument)) { // verify interleave mode settings
366+ if (!CheckRowMbMultiSliceSetting (iMbWidth, &fDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
367367 #if defined (_DEBUG)
368368 fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
369− fDlp->sMso.sSliceArgument.uiSliceMbNum[0]);
369+ fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
370370 #endif//#if _DEBUG
371371 return 1;
372372 }
@@ -375,17 +375,17 @@ int32_t ParamValidationExt (void* pParam) { · 2 unmodified lines
375375 case SM_DYN_SLICE: {
376376 iMbWidth = (kiPicWidth + 15) >> 4;
377377 iMbHeight = (kiPicHeight + 15) >> 4;
378− if (fDlp->sMso.sSliceArgument.uiSliceSizeConstraint <= 0) {
378+ if (fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint <= 0) {
379379 #if defined (_DEBUG)
380380 fprintf (stderr, "ParamValidationExt(), invalid iSliceSize (%d) settings!\n",
381− fDlp->sMso.sSliceArgument.uiSliceSizeConstraint);
381+ fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint);
382382 #endif//#if _DEBUG
383383 return 1;
384384 }
385385 // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting
386386 if (iMbWidth * iMbHeight <= MIN_NUM_MB_PER_SLICE) {
387− fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE;
388− fDlp->sMso.sSliceArgument.iSliceNum = 1;
387+ fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
388+ fDlp->sSliceCfg.sSliceArgument.uiSliceNum = 1;
389389 break;
390390 }
391391 }
@@ -394,7 +394,7 @@ int32_t ParamValidationExt (void* pParam) { · 2 unmodified lines
394394
395395 #if defined (_DEBUG)
396396 fprintf (stderr, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n",
397− pCodingParam->sDependencyLayers[0].sMso.uiSliceMode);
397+ pCodingParam->sDependencyLayers[0].sSliceCfg.uiSliceMode);
398398 #endif//#if _DEBUG
399399 return 1;
400400
@@ -411,7 +411,7 @@ void WelsEncoderApplyFrameRate(SWelsSvcCodingParam* pParam) · 10 unmodified lines
411411 {
412412 SDLayerParam* pLayerParam;
413413 const float kfEpsn = 0.000001f;
414− const int32_t kiNumLayer = pParam->iNumDependencyLayer;
414+ const int32_t kiNumLayer = pParam->iSpatialLayerNum;
415415 int32_t i;
416416 const float kfMaxFrameRate = pParam->fMaxFrameRate;
417417 float fRatio;
@@ -439,7 +439,7 @@ void WelsEncoderApplyBitRate(SWelsSvcCodingParam* pParam) · 21 unmodified lines
439439 //but it is also possible to fulfill the bitrate of lower layer first
440440
441441 SDLayerParam* pLayerParam;
442− const int32_t iNumLayers = pParam->iNumDependencyLayer;
442+ const int32_t iNumLayers = pParam->iSpatialLayerNum;
443443 int32_t i, iOrigTotalBitrate=0;
444444 //read old BR
445445 for (i=0;i<iNumLayers;i++) {
@@ -474,7 +474,7 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 28 unmodified lines
474474 if (NULL == pParam || NULL == ppCtx || NULL == *ppCtx)
475475 return 1;
476476
477− iNumDependencyLayers = pParam->iNumDependencyLayer;
477+ iNumDependencyLayers = pParam->iSpatialLayerNum;
478478
479479 do {
480480 SDLayerParam* pDLayer = &pParam->sDependencyLayers[iDIndex];
@@ -485,7 +485,7 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 4 unmodified lines
485485 //Review this part and suggest no change, since the memory over-use
486486 //(1) counts little to the overall performance
487487 //(2) should not be critial even under mobile case
488− if (SM_DYN_SLICE == pDLayer->sMso.uiSliceMode) {
488+ if (SM_DYN_SLICE == pDLayer->sSliceCfg.uiSliceMode) {
489489 iCountNumNals += MAX_SLICES_NUM;
490490 // plus prefix NALs
491491 if (iDIndex == 0)
@@ -497,10 +497,10 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 5 unmodified lines
497497 #else//!MT_ENABLED || !PACKING_ONE_SLICE_PER_LAYER
498498 assert (iCountNumNals - iOrgNumNals <= MAX_NAL_UNITS_IN_LAYER);
499499 #endif//MT_ENABLED && PACKING_ONE_SLICE_PER_LAYER
500− } else { /*if ( SM_SINGLE_SLICE != pDLayer->sMso.uiSliceMode )*/
500+ } else { /*if ( SM_SINGLE_SLICE != pDLayer->sSliceCfg.uiSliceMode )*/
501501 const int32_t kiNumOfSlice = GetInitialSliceNum ((pDLayer->iFrameWidth + 0x0f) >> 4,
502502 (pDLayer->iFrameHeight + 0x0f) >> 4,
503− &pDLayer->sMso);
503+ &pDLayer->sSliceCfg);
504504
505505 // NEED check iCountNals value in case multiple slices is used
506506 iCountNumNals += kiNumOfSlice; // for pSlice VCL NALs
@@ -575,7 +575,7 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 68 unmodified lines
575575 */
576576 int32_t AllocSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodingParam* pParam) {
577577 CMemoryAlign* pMa = pCtx->pMemAlign;
578− const int32_t kiDlayerCount = pParam->iNumDependencyLayer;
578+ const int32_t kiDlayerCount = pParam->iSpatialLayerNum;
579579 int32_t iDlayerIndex = 0;
580580
581581 // spatial pictures
@@ -605,7 +605,7 @@ int32_t AllocSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodingParam* pParam) { · 23 unmodified lines
605605 void FreeSpatialPictures (sWelsEncCtx* pCtx) {
606606 CMemoryAlign* pMa = pCtx->pMemAlign;
607607 int32_t j = 0;
608− while (j < pCtx->pSvcParam->iNumDependencyLayer) {
608+ while (j < pCtx->pSvcParam->iSpatialLayerNum) {
609609 uint8_t i = 0;
610610 uint8_t uiRefNumInTemporal = pCtx->uiSpatialPicNum[j];
611611
@@ -695,7 +695,7 @@ static void InitMbInfo (sWelsEncCtx* pEnc, SMB* pList, SDqLayer* pLayer, con · 83 unmodified lines
695695
696696
697697 int32_t InitMbListD (sWelsEncCtx** ppCtx) {
698− int32_t iNumDlayer = (*ppCtx)->pSvcParam->iNumDependencyLayer;
698+ int32_t iNumDlayer = (*ppCtx)->pSvcParam->iSpatialLayerNum;
699699 int32_t iMbSize[MAX_DEPENDENCY_LAYER] = { 0 };
700700 int32_t iOverallMbNum = 0;
701701 int32_t iMbWidth = 0;
@@ -811,7 +811,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 109 unmodified lines
811811
812812 pMa = (*ppCtx)->pMemAlign;
813813 pParam = (*ppCtx)->pSvcParam;
814− iDlayerCount = pParam->iNumDependencyLayer;
814+ iDlayerCount = pParam->iSpatialLayerNum;
815815 iNumRef = pParam->iNumRefFrame;
816816 // highest_layers_in_temporal = 1 + WELS_MAX(pParam->iDecompStages, 1);
817817 pStrideTab = (*ppCtx)->pStrideTab;
@@ -859,7 +859,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 41 unmodified lines
859859 const int32_t kiMbW = (pDlayer->iFrameWidth + 0x0f) >> 4;
860860 const int32_t kiMbH = (pDlayer->iFrameHeight + 0x0f) >> 4;
861861 int32_t iMaxSliceNum = 1;
862− const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sMso);
862+ const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sSliceCfg);
863863 if (iMaxSliceNum < kiSliceNum)
864864 iMaxSliceNum = kiSliceNum;
865865
@@ -868,7 +868,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 2 unmodified lines
868868 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeMemorySvc (ppCtx))
869869
870870 // for dynamic slicing mode
871− if (SM_DYN_SLICE == pDlayer->sMso.uiSliceMode) {
871+ if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) {
872872 const int32_t iSize = pParam->iCountThreadsNum * sizeof (int32_t);
873873
874874 pDqLayer->pNumSliceCodedOfPartition = (int32_t*)pMa->WelsMallocz (iSize, "pNumSliceCodedOfPartition");
@@ -885,7 +885,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 10 unmodified lines
885885 pDqLayer->iMbWidth = kiMbW;
886886 pDqLayer->iMbHeight = kiMbH;
887887 #ifndef MT_ENABLED
888− if (SM_DYN_SLICE == pDlayer->sMso.uiSliceMode) { //wmalloc pSliceInLayer
888+ if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) { //wmalloc pSliceInLayer
889889 SSlice* pSlice = NULL;
890890 int32_t iSliceIdx = 0;
891891 //wmalloc AVERSLICENUM_CONSTANT of pDqLayer->sLayerInfo.pSliceInLayer,
@@ -958,7 +958,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 66 unmodified lines
958958 pDqLayer->bDeblockingParallelFlag = pParam->bDeblockingParallelFlag;
959959
960960 //deblocking parameter adjustment
961− if (SM_SINGLE_SLICE == pDlayer->sMso.uiSliceMode) {
961+ if (SM_SINGLE_SLICE == pDlayer->sSliceCfg.uiSliceMode) {
962962 //iLoopFilterDisableIdc: will be 0 or 1 under single_slice
963963 if (2 == pParam->iLoopFilterDisableIdc) {
964964 pDqLayer->iLoopFilterDisableIdc = 0;
@@ -1037,7 +1037,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 72 unmodified lines
10371037 false,
10381038 pSps->iMbWidth,
10391039 pSps->iMbHeight,
1040− & (pDlayerParam->sMso),
1040+ & (pDlayerParam->sSliceCfg),
10411041 pPps);
10421042 if (iResult) {
10431043 WelsLog (*ppCtx, WELS_LOG_WARNING, "InitDqLayers(), InitSlicePEncCtx failed(%d)!", iResult);
@@ -1099,7 +1099,7 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 55 unmodified lines
10991099 return 1;
11001100 (*ppCtx)->pStrideTab = pPtr;
11011101
1102− iCntTid = pParam->iNumTemporalLayer > 1 ? 2 : 1;
1102+ iCntTid = pParam->iTemporalLayerNum > 1 ? 2 : 1;
11031103
11041104 iSpatialIdx = 0;
11051105 while (iSpatialIdx < kiNumSpatialLayers) {
@@ -1335,7 +1335,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 229 unmodified lines
13351335 int32_t iCountLayers = 0;
13361336 int32_t iResult = 0;
13371337 float fCompressRatioThr = .5f;
1338− const int32_t kiNumDependencyLayers = pParam->iNumDependencyLayer;
1338+ const int32_t kiNumDependencyLayers = pParam->iSpatialLayerNum;
13391339 const uint32_t kuiMvdInterTableSize = (kiNumDependencyLayers == 1 ? (1 + (648 << 1)) : (1 + (972 << 1)));
13401340 const uint32_t kuiMvdCacheAlginedSize = kuiMvdInterTableSize * sizeof (uint16_t);
13411341 int32_t iVclLayersBsSizeCount = 0;
@@ -1371,12 +1371,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 29 unmodified lines
13711371 return 1;
13721372 }
13731373
1374− iNonVclLayersBsSizeCount = SSEI_BUFFER_SIZE + pParam->iNumDependencyLayer * SPS_BUFFER_SIZE +
1375− (1 + pParam->iNumDependencyLayer) * PPS_BUFFER_SIZE;
1374+ iNonVclLayersBsSizeCount = SSEI_BUFFER_SIZE + pParam->iSpatialLayerNum * SPS_BUFFER_SIZE +
1375+ (1 + pParam->iSpatialLayerNum) * PPS_BUFFER_SIZE;
13761376
13771377 int32_t iLayerBsSize = 0;
13781378 iIndex = 0;
1379− while (iIndex < pParam->iNumDependencyLayer) {
1379+ while (iIndex < pParam->iSpatialLayerNum) {
13801380 SDLayerParam* fDlp = &pParam->sDependencyLayers[iIndex];
13811381
13821382 fCompressRatioThr = COMPRESS_RATIO_DECIDED_BY_RESOLUTION (fDlp->iFrameWidth, fDlp->iFrameHeight);
@@ -1664,16 +1664,17 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 281 unmodified lines
16641664 // pDq layers list
16651665 ilayer = 0;
16661666 if (NULL != pCtx->ppDqLayerList && pParam != NULL) {
1667− while (ilayer < pParam->iNumDependencyLayer) {
1667+ while (ilayer < pParam->iSpatialLayerNum) {
16681668 SDqLayer* pDq = pCtx->ppDqLayerList[ilayer];
16691669 SDLayerParam* pDlp = &pCtx->pSvcParam->sDependencyLayers[ilayer];
1670− const bool kbIsDynamicSlicing = (SM_DYN_SLICE == pDlp->sMso.uiSliceMode);
1670+
1671+ const bool kbIsDynamicSlicing = (SM_DYN_SLICE == pDlp->sSliceCfg.uiSliceMode);
16711672
16721673 // pDq layers
16731674 if (NULL != pDq) {
16741675 if (NULL != pDq->sLayerInfo.pSliceInLayer) {
16751676 int32_t iSliceIdx = 0;
1676− int32_t iSliceNum = GetInitialSliceNum (pDq->iMbWidth, pDq->iMbHeight, &pDlp->sMso);
1677+ int32_t iSliceNum = GetInitialSliceNum (pDq->iMbWidth, pDq->iMbHeight, &pDlp->sSliceCfg);
16771678 if (iSliceNum < 1)
16781679 iSliceNum = 1;
16791680 while (iSliceIdx < iSliceNum) {
@@ -1707,7 +1708,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 27 unmodified lines
17071708 // reference picture list extension
17081709 if (NULL != pCtx->ppRefPicListExt && pParam != NULL) {
17091710 ilayer = 0;
1710− while (ilayer < pParam->iNumDependencyLayer) {
1711+ while (ilayer < pParam->iSpatialLayerNum) {
17111712 SRefList* pRefList = pCtx->ppRefPicListExt[ilayer];
17121713 if (NULL != pRefList) {
17131714 int32_t iRef = 0;
@@ -1731,7 +1732,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 17 unmodified lines
17311732 // pSlice context list
17321733 if (NULL != pCtx->pSliceCtxList && pParam != NULL) {
17331734 ilayer = 0;
1734− while (ilayer < pParam->iNumDependencyLayer) {
1735+ while (ilayer < pParam->iSpatialLayerNum) {
17351736 SSliceCtx* pSliceCtx = &pCtx->pSliceCtxList[ilayer];
17361737 if (NULL != pSliceCtx)
17371738 UninitSlicePEncCtx (pSliceCtx, pMa);
@@ -1817,12 +1818,12 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 79 unmodified lines
18171818 }
18181819
18191820 int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCpuCores, int16_t* pMaxSliceCount) {
1820− int32_t iSpatialIdx = 0, iSpatialNum = pCodingParam->iNumDependencyLayer;
1821+ int32_t iSpatialIdx = 0, iSpatialNum = pCodingParam->iSpatialLayerNum;
18211822 int16_t iMaxSliceCount = 0;
18221823
18231824 do {
18241825 SDLayerParam* pDlp = &pCodingParam->sDependencyLayers[iSpatialIdx];
1825− SMulSliceOption* pMso = &pDlp->sMso;
1826+ SSliceConfig* pMso = &pDlp->sSliceCfg;
18261827 SSliceArgument* pSlcArg = &pMso->sSliceArgument;
18271828 const int32_t kiMbWidth = (pDlp->iFrameWidth + 15) >> 4;
18281829 const int32_t kiMbHeight = (pDlp->iFrameHeight + 15) >> 4;
@@ -1831,7 +1832,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 2 unmodified lines
18311832 #if defined(DYNAMIC_SLICE_ASSIGN)
18321833 int32_t iSliceNum = (SM_FIXEDSLCNUM_SLICE == pMso->uiSliceMode
18331834 || SM_DYN_SLICE == pMso->uiSliceMode) ? kiCpuCores :
1834− pSlcArg->iSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
1835+ pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
18351836 #else//!DYNAMIC_SLICE_ASSIGN
18361837 int32_t iSliceNum = (SM_DYN_SLICE == pMso->uiSliceMode) ? kiCpuCores :
18371838 pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
@@ -1843,7 +1844,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 5 unmodified lines
18431844 // NOTE: Per design, in case MT/DYNAMIC_SLICE_ASSIGN enabled, for SM_FIXEDSLCNUM_SLICE mode,
18441845 // uiSliceNum of current spatial layer settings equals to uiCpuCores number; SM_DYN_SLICE mode,
18451846 // uiSliceNum intials as uiCpuCores also, stay tuned dynamically slicing in future
1846− pSlcArg->iSliceNum = iSliceNum; // used fixed one
1847+ pSlcArg->uiSliceNum = iSliceNum; // used fixed one
18471848
18481849 switch (pMso->uiSliceMode) {
18491850 case SM_DYN_SLICE:
@@ -2093,7 +2094,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 243 unmodified lines
20932094 #endif//ENABLE_TRACE_FILE
20942095
20952096 pCodingParam->DetermineTemporalSettings();
2096− iRet = AllocCodingParam (&pCtx->pSvcParam, pCtx->pMemAlign, pCodingParam->iNumDependencyLayer);
2097+ iRet = AllocCodingParam (&pCtx->pSvcParam, pCtx->pMemAlign, pCodingParam->iSpatialLayerNum);
20972098 if (iRet != 0) {
20982099 FreeMemorySvc (&pCtx);
20992100 return iRet;
@@ -2151,7 +2152,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 51 unmodified lines
21512152 void StatOverallEncodingExt (sWelsEncCtx* pCtx) {
21522153 int8_t i = 0;
21532154 int8_t j = 0;
2154− for (i = 0; i < pCtx->pSvcParam->iNumDependencyLayer; i++) {
2155+ for (i = 0; i < pCtx->pSvcParam->iSpatialLayerNum; i++) {
21552156 fprintf (stdout, "\nDependency layer : %d\n", i);
21562157 fprintf (stdout, "Quality layer : %d\n", j);
21572158 {
@@ -2563,8 +2564,8 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 405 unmodified lines
25632564
25642565 pCurDq->pDecPic = pDecPic;
25652566
2566− if (fDlp->sMso.uiSliceMode == SM_DYN_SLICE) // need get extra slices for update
2567− iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sMso);
2567+ if (fDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE) // need get extra slices for update
2568+ iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sSliceCfg);
25682569 else
25692570 iSliceCount = GetCurrentSliceNum (pCurDq->pSliceEncCtx);
25702571 assert (iSliceCount > 0);
@@ -2644,7 +2645,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 73 unmodified lines
26442645
26452646 if (P_SLICE == pCtx->eSliceType) {
26462647 if (kbBaseAvail) {
2647− if (pCtx->pSvcParam->iNumDependencyLayer == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1)) { //
2648+ if (pCtx->pSvcParam->iSpatialLayerNum == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1)) { //
26482649 pCtx->pFuncList->pfMotionSearch = WelsMotionEstimateSearchSad;
26492650 pCtx->pFuncList->pfFirstIntraMode = WelsMdFirstIntraMode;
26502651 pCtx->pFuncList->pfIntraFineMd = WelsMdIntraFinePartitionVaa;
@@ -2667,7 +2668,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 16 unmodified lines
26672668 pCtx->pFuncList->sSampleDealingFuncs.pfMeCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSatd;
26682669 } else {
26692670 //case 3: pBase layer MD + encoding
2670− if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iNumDependencyLayer) {
2671+ if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iSpatialLayerNum) {
26712672 pCtx->pFuncList->pfMotionSearch = WelsMotionEstimateSearchSad;
26722673 pCtx->pFuncList->pfFirstIntraMode = WelsMdFirstIntraMode;
26732674 pCtx->pFuncList->pfIntraFineMd = WelsMdIntraFinePartitionVaa;
@@ -2690,7 +2691,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 16 unmodified lines
26902691 pCtx->pFuncList->sSampleDealingFuncs.pfMeCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSatd;
26912692 }
26922693 } else if (I_SLICE == pCtx->eSliceType) {
2693− if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iNumDependencyLayer) {
2694+ if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iSpatialLayerNum) {
26942695 pCtx->pFuncList->sSampleDealingFuncs.pfMdCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSad;
26952696 pCtx->pFuncList->sSampleDealingFuncs.pfIntra16x16Combined3 =
26962697 pCtx->pFuncList->sSampleDealingFuncs.pfIntra16x16Combined3Sad;
@@ -3199,12 +3200,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 502 unmodified lines
31993200
32003201 // Encoding this picture might mulitiple sQualityStat layers potentially be encoded as followed
32013202
3202− switch (param_d->sMso.uiSliceMode) {
3203+ switch (param_d->sSliceCfg.uiSliceMode) {
32033204 case SM_FIXEDSLCNUM_SLICE: {
32043205 #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN)
32053206 if ((iCurDid > 0) && (pSvcParam->iMultipleThreadIdc > 1) &&
3206− (pSvcParam->sDependencyLayers[iCurDid].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3207− && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[iCurDid].sMso.sSliceArgument.iSliceNum)
3207+ (pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3208+ && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.sSliceArgument.uiSliceNum)
32083209 )
32093210 AdjustEnhanceLayer (pCtx, iCurDid);
32103211 #endif//MT_ENABLED && DYNAMIC_SLICE_ASSIGN
@@ -3235,7 +3236,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 24 unmodified lines
32353236 bAvcBased = (iCurDid == BASE_DEPENDENCY_ID);
32363237 pCtx->bNeedPrefixNalFlag = (bAvcBased &&
32373238 (pSvcParam->bPrefixNalAddingCtrl ||
3238− (pSvcParam->iNumDependencyLayer > 1)));
3239+ (pSvcParam->iSpatialLayerNum > 1)));
32393240
32403241 if (eFrameType == WELS_FRAME_TYPE_P) {
32413242 eNalType = bAvcBased ? NAL_UNIT_CODED_SLICE : NAL_UNIT_CODED_SLICE_EXT;
@@ -3281,7 +3282,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 39 unmodified lines
32813282 PreprocessSliceCoding (pCtx); // MUST be called after pfWelsRcPictureInit() and WelsInitCurrentLayer()
32823283
32833284 iLayerSize = 0;
3284− if (SM_SINGLE_SLICE == param_d->sMso.uiSliceMode) { // only one slice within a sQualityStat layer
3285+ if (SM_SINGLE_SLICE == param_d->sSliceCfg.uiSliceMode) { // only one slice within a sQualityStat layer
32853286 int32_t iSliceSize = 0;
32863287
32873288 if (pCtx->bNeedPrefixNalFlag) {
@@ -3310,9 +3311,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 22 unmodified lines
33103311 }
33113312 // for dynamic slicing single threading..
33123313 #ifndef MT_ENABLED
3313− else if (SM_DYN_SLICE == param_d->sMso.uiSliceMode)
3314+ else if (SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode)
33143315 #else // MT_ENABLED
3315− else if ((SM_DYN_SLICE == param_d->sMso.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1))
3316+ else if ((SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1))
33163317 #endif//MT_ENABLED
33173318 {
33183319 const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->pSliceEncCtx->iMbNumInFrame;
@@ -3322,7 +3323,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 3 unmodified lines
33223323 #if defined(MT_ENABLED)
33233324 int err = 0;
33243325 // THREAD_FULLY_FIRE_MODE/THREAD_PICK_UP_MODE for any mode of non-SM_DYN_SLICE
3325− if ((SM_DYN_SLICE != param_d->sMso.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
3326+ if ((SM_DYN_SLICE != param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
33263327 iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx);
33273328 if (iLayerNum +
33283329 #if defined(PACKING_ONE_SLICE_PER_LAYER)
@@ -3333,7 +3334,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 4 unmodified lines
33333334 >= MAX_LAYER_NUM_OF_FRAME) { // check available layer_bs_info for further writing as followed
33343335 WelsLog (pCtx, WELS_LOG_ERROR,
33353336 "WelsEncoderEncodeExt(), iLayerNum(%d) overflow(max:%d) at iDid= %d uiSliceMode= %d, iSliceCount= %d!",
3336− iLayerNum, MAX_LAYER_NUM_OF_FRAME, iCurDid, param_d->sMso.uiSliceMode, iSliceCount);
3337+ iLayerNum, MAX_LAYER_NUM_OF_FRAME, iCurDid, param_d->sSliceCfg.uiSliceMode, iSliceCount);
33373338 return -1;
33383339 }
33393340 if (iSliceCount <= 1) {
@@ -3363,7 +3364,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 23 unmodified lines
33633364 if (err) {
33643365 WelsLog (pCtx, WELS_LOG_ERROR,
33653366 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
3366− err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sMso.uiSliceMode, pSvcParam->iMultipleThreadIdc);
3367+ err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
33673368 return -1;
33683369 }
33693370
@@ -3422,7 +3423,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 52 unmodified lines
34223423 if (err) {
34233424 WelsLog (pCtx, WELS_LOG_ERROR,
34243425 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
3425− err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sMso.uiSliceMode, pSvcParam->iMultipleThreadIdc);
3426+ err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
34263427 return -1;
34273428 }
34283429
@@ -3499,7 +3500,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 70 unmodified lines
34993500 }
35003501 }
35013502 // THREAD_FULLY_FIRE_MODE && SM_DYN_SLICE
3502− else if ((SM_DYN_SLICE == param_d->sMso.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
3503+ else if ((SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
35033504 const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum; //pSvcParam->iCountThreadsNum;
35043505 #if defined(PACKING_ONE_SLICE_PER_LAYER)
35053506 ResetCountBsSizeInPartitions (pCtx->pSliceThreading->pCountBsSizeInPartition, kiPartitionCnt);
@@ -3514,7 +3515,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 8 unmodified lines
35143515 if (err) {
35153516 WelsLog (pCtx, WELS_LOG_ERROR,
35163517 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
3517− err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sMso.uiSliceMode, pSvcParam->iMultipleThreadIdc);
3518+ err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
35183519 return -1;
35193520 }
35203521
@@ -3604,7 +3605,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 83 unmodified lines
36043605
36053606 #ifdef ENABLE_FRAME_DUMP
36063607 // Dump reconstruction picture for each sQualityStat layer
3607− if (iCurDid + 1 < pSvcParam->iNumDependencyLayer)
3608+ if (iCurDid + 1 < pSvcParam->iSpatialLayerNum)
36083609 DumpDependencyRec (fsnr, &param_d->sRecFileName[0], iCurDid);
36093610 #endif//ENABLE_FRAME_DUMP
36103611
@@ -3686,7 +3687,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 75 unmodified lines
36863687 #endif//STAT_OUTPUT
36873688
36883689 #if defined(MT_ENABLED) && defined(PACKING_ONE_SLICE_PER_LAYER)
3689− if (pSvcParam->iMultipleThreadIdc <= 1 || SM_SINGLE_SLICE == param_d->sMso.uiSliceMode) // sigle thread actually used
3690+ if (pSvcParam->iMultipleThreadIdc <= 1 || SM_SINGLE_SLICE == param_d->sSliceCfg.uiSliceMode) // sigle thread actually used
36903691 #else
36913692 if (1)
36923693 #endif//MT_ENABLED && PACKING_ONE_SLICE_PER_LAYER
@@ -3725,8 +3726,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 32 unmodified lines
37253726 }
37263727
37273728 #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
3728− if (param_d->sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE && pSvcParam->iMultipleThreadIdc > 1 &&
3729− pSvcParam->iMultipleThreadIdc >= param_d->sMso.sSliceArgument.iSliceNum) {
3729+ if (param_d->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE && pSvcParam->iMultipleThreadIdc > 1 &&
3730+ pSvcParam->iMultipleThreadIdc >= param_d->sSliceCfg.sSliceArgument.uiSliceNum) {
37303731 CalcSliceComplexRatio (pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], pCtx->pCurDqLayer->pSliceEncCtx,
37313732 pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]);
37323733 #if defined(MT_DEBUG)
@@ -3737,7 +3738,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 4 unmodified lines
37373738
37383739 ++ iSpatialIdx;
37393740
3740− if (iCurDid + 1 < pSvcParam->iNumDependencyLayer) {
3741+ if (iCurDid + 1 < pSvcParam->iSpatialLayerNum) {
37413742 WelsSwapDqLayers (pCtx);
37423743 }
37433744
@@ -3777,17 +3778,17 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 33 unmodified lines
37773778
37783779 #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN)
37793780 if (pSvcParam->iMultipleThreadIdc > 1 && did_list[0] == BASE_DEPENDENCY_ID
3780− && pSvcParam->sDependencyLayers[0].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3781− && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[0].sMso.sSliceArgument.iSliceNum
3782− && pSvcParam->sDependencyLayers[did_list[iSpatialNum - 1]].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3781+ && pSvcParam->sDependencyLayers[0].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3782+ && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[0].sSliceCfg.sSliceArgument.uiSliceNum
3783+ && pSvcParam->sDependencyLayers[did_list[iSpatialNum - 1]].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
37833784 && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[did_list[iSpatialNum -
3784− 1]].sMso.sSliceArgument.iSliceNum) {
3785+ 1]].sSliceCfg.sSliceArgument.uiSliceNum) {
37853786 AdjustBaseLayer (pCtx);
37863787 }
37873788 #endif//DYNAMIC_SLICE_ASSIGN
37883789
37893790 #ifdef ENABLE_FRAME_DUMP
3790− DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iNumDependencyLayer -
3791+ DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iSpatialLayerNum -
37913792 1].sRecFileName[0]); // pDecPic: final reconstruction output
37923793 #endif//ENABLE_FRAME_DUMP
37933794
@@ -3823,18 +3824,18 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 29 unmodified lines
38233824 /* Decide whether need reset for IDR frame based on adjusting prarameters changed */
38243825 /* Temporal levels, spatial settings and/ or quality settings changed need update parameter sets related. */
38253826 bNeedReset = (pOldParam == NULL) ||
3826− (pOldParam->iNumTemporalLayer != pNewParam->iNumTemporalLayer) ||
3827+ (pOldParam->iTemporalLayerNum != pNewParam->iTemporalLayerNum) ||
38273828 (pOldParam->uiGopSize != pNewParam->uiGopSize) ||
3828− (pOldParam->iNumDependencyLayer != pNewParam->iNumDependencyLayer) ||
3829+ (pOldParam->iSpatialLayerNum != pNewParam->iSpatialLayerNum) ||
38293830 (pOldParam->iDecompStages != pNewParam->iDecompStages) ||
3830− (pOldParam->iActualPicWidth != pNewParam->iActualPicWidth
3831− || pOldParam->iActualPicHeight != pNewParam->iActualPicHeight) ||
3831+ (pOldParam->iPicWidth != pNewParam->iPicWidth
3832+ || pOldParam->iPicHeight != pNewParam->iPicHeight) ||
38323833 (pOldParam->SUsedPicRect.iWidth != pNewParam->SUsedPicRect.iWidth
38333834 || pOldParam->SUsedPicRect.iHeight != pNewParam->SUsedPicRect.iHeight) ||
38343835 (pOldParam->bEnableLongTermReference != pNewParam->bEnableLongTermReference);
38353836 if (!bNeedReset) { // Check its picture resolutions/quality settings respectively in each dependency layer
38363837 iIndexD = 0;
3837− assert (pOldParam->iNumDependencyLayer == pNewParam->iNumDependencyLayer);
3838+ assert (pOldParam->iSpatialLayerNum == pNewParam->iSpatialLayerNum);
38383839 do {
38393840 const SDLayerParam* kpOldDlp = &pOldParam->sDependencyLayers[iIndexD];
38403841 const SDLayerParam* kpNewDlp = &pNewParam->sDependencyLayers[iIndexD];
@@ -3850,8 +3851,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 9 unmodified lines
38503851 break;
38513852 }
38523853
3853− if (kpOldDlp->sMso.uiSliceMode != kpNewDlp->sMso.uiSliceMode ||
3854− kpOldDlp->sMso.sSliceArgument.iSliceNum != kpNewDlp->sMso.sSliceArgument.iSliceNum) {
3854+ if (kpOldDlp->sSliceCfg.uiSliceMode != kpNewDlp->sSliceCfg.uiSliceMode ||
3855+ kpOldDlp->sSliceCfg.sSliceArgument.uiSliceNum != kpNewDlp->sSliceCfg.sSliceArgument.uiSliceNum) {
38553856 bNeedReset = true;
38563857 break;
38573858 }
@@ -3874,7 +3875,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 16 unmodified lines
38743875 }
38753876
38763877 ++ iIndexD;
3877− } while (iIndexD < pOldParam->iNumDependencyLayer);
3878+ } while (iIndexD < pOldParam->iSpatialLayerNum);
38783879 }
38793880
38803881 if (bNeedReset) {
@@ -3929,7 +3930,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 48 unmodified lines
39293930
39303931 /* int32_t term reference control */
39313932 pOldParam->bEnableLongTermReference = pNewParam->bEnableLongTermReference;
3932− pOldParam->uiLtrMarkPeriod = pNewParam->uiLtrMarkPeriod;
3933+ pOldParam->iLtrMarkPeriod = pNewParam->iLtrMarkPeriod;
39333934
39343935 // keep below values unchanged as before
39353936 pOldParam->bEnableSSEI = pNewParam->bEnableSSEI;
@@ -3977,7 +3978,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 41 unmodified lines
39773978 sizeof (pOldDlp->uiCodingIdx2TemporalId)); // confirmed_safe_unsafe_usage
39783979
39793980 ++ iIndexD;
3980− } while (iIndexD < pOldParam->iNumDependencyLayer);
3981+ } while (iIndexD < pOldParam->iSpatialLayerNum);
39813982 }
39823983
39833984 /* Any else initialization/reset for rate control here? */

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