History

update to the last commit: interface change

volvet committed 12 years ago

Commit 5fe3b6e2 parents 600a79b 287f35330 files · +611 −731Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 30 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
@@ -644,7 +644,7 @@ static void InitMbInfo (sWelsEncCtx* pEnc, SMB* pList, SDqLayer* pLayer, con · 137 unmodified lines
644644
645645
646646 int32_t InitMbListD (sWelsEncCtx** ppCtx) {
647− int32_t iNumDlayer = (*ppCtx)->pSvcParam->iNumDependencyLayer;
647+ int32_t iNumDlayer = (*ppCtx)->pSvcParam->iSpatialLayerNum;
648648 int32_t iMbSize[MAX_DEPENDENCY_LAYER] = { 0 };
649649 int32_t iOverallMbNum = 0;
650650 int32_t iMbWidth = 0;
@@ -760,7 +760,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 109 unmodified lines
760760
761761 pMa = (*ppCtx)->pMemAlign;
762762 pParam = (*ppCtx)->pSvcParam;
763− iDlayerCount = pParam->iNumDependencyLayer;
763+ iDlayerCount = pParam->iSpatialLayerNum;
764764 iNumRef = pParam->iNumRefFrame;
765765 // highest_layers_in_temporal = 1 + WELS_MAX(pParam->iDecompStages, 1);
766766 pStrideTab = (*ppCtx)->pStrideTab;
@@ -802,7 +802,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 35 unmodified lines
802802 const int32_t kiMbW = (pDlayer->iFrameWidth + 0x0f) >> 4;
803803 const int32_t kiMbH = (pDlayer->iFrameHeight + 0x0f) >> 4;
804804 int32_t iMaxSliceNum = 1;
805− const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sMso);
805+ const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sSliceCfg);
806806 if (iMaxSliceNum < kiSliceNum)
807807 iMaxSliceNum = kiSliceNum;
808808
@@ -811,7 +811,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 2 unmodified lines
811811 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeMemorySvc (ppCtx))
812812
813813 // for dynamic slicing mode
814− if (SM_DYN_SLICE == pDlayer->sMso.uiSliceMode) {
814+ if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) {
815815 const int32_t iSize = pParam->iCountThreadsNum * sizeof (int32_t);
816816
817817 pDqLayer->pNumSliceCodedOfPartition = (int32_t*)pMa->WelsMallocz (iSize, "pNumSliceCodedOfPartition");
@@ -828,7 +828,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 10 unmodified lines
828828 pDqLayer->iMbWidth = kiMbW;
829829 pDqLayer->iMbHeight = kiMbH;
830830 #ifndef MT_ENABLED
831− if (SM_DYN_SLICE == pDlayer->sMso.uiSliceMode) { //wmalloc pSliceInLayer
831+ if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) { //wmalloc pSliceInLayer
832832 SSlice* pSlice = NULL;
833833 int32_t iSliceIdx = 0;
834834 //wmalloc AVERSLICENUM_CONSTANT of pDqLayer->sLayerInfo.pSliceInLayer,
@@ -901,7 +901,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 66 unmodified lines
901901 pDqLayer->bDeblockingParallelFlag = pParam->bDeblockingParallelFlag;
902902
903903 //deblocking parameter adjustment
904− if (SM_SINGLE_SLICE == pDlayer->sMso.uiSliceMode) {
904+ if (SM_SINGLE_SLICE == pDlayer->sSliceCfg.uiSliceMode) {
905905 //iLoopFilterDisableIdc: will be 0 or 1 under single_slice
906906 if (2 == pParam->iLoopFilterDisableIdc) {
907907 pDqLayer->iLoopFilterDisableIdc = 0;
@@ -980,7 +980,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 72 unmodified lines
980980 false,
981981 pSps->iMbWidth,
982982 pSps->iMbHeight,
983− & (pDlayerParam->sMso),
983+ & (pDlayerParam->sSliceCfg),
984984 pPps);
985985 if (iResult) {
986986 WelsLog (*ppCtx, WELS_LOG_WARNING, "InitDqLayers(), InitSlicePEncCtx failed(%d)!", iResult);
@@ -1042,7 +1042,7 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 55 unmodified lines
10421042 return 1;
10431043 (*ppCtx)->pStrideTab = pPtr;
10441044
1045− iCntTid = pParam->iNumTemporalLayer > 1 ? 2 : 1;
1045+ iCntTid = pParam->iTemporalLayerNum > 1 ? 2 : 1;
10461046
10471047 iSpatialIdx = 0;
10481048 while (iSpatialIdx < kiNumSpatialLayers) {
@@ -1278,7 +1278,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 229 unmodified lines
12781278 int32_t iCountLayers = 0;
12791279 int32_t iResult = 0;
12801280 float fCompressRatioThr = .5f;
1281− const int32_t kiNumDependencyLayers = pParam->iNumDependencyLayer;
1281+ const int32_t kiNumDependencyLayers = pParam->iSpatialLayerNum;
12821282 const uint32_t kuiMvdInterTableSize = (kiNumDependencyLayers == 1 ? (1 + (648 << 1)) : (1 + (972 << 1)));
12831283 const uint32_t kuiMvdCacheAlginedSize = kuiMvdInterTableSize * sizeof (uint16_t);
12841284 int32_t iVclLayersBsSizeCount = 0;
@@ -1314,12 +1314,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 29 unmodified lines
13141314 return 1;
13151315 }
13161316
1317− iNonVclLayersBsSizeCount = SSEI_BUFFER_SIZE + pParam->iNumDependencyLayer * SPS_BUFFER_SIZE +
1318− (1 + pParam->iNumDependencyLayer) * PPS_BUFFER_SIZE;
1317+ iNonVclLayersBsSizeCount = SSEI_BUFFER_SIZE + pParam->iSpatialLayerNum * SPS_BUFFER_SIZE +
1318+ (1 + pParam->iSpatialLayerNum) * PPS_BUFFER_SIZE;
13191319
13201320 int32_t iLayerBsSize = 0;
13211321 iIndex = 0;
1322− while (iIndex < pParam->iNumDependencyLayer) {
1322+ while (iIndex < pParam->iSpatialLayerNum) {
13231323 SDLayerParam* fDlp = &pParam->sDependencyLayers[iIndex];
13241324
13251325 fCompressRatioThr = COMPRESS_RATIO_DECIDED_BY_RESOLUTION (fDlp->iFrameWidth, fDlp->iFrameHeight);
@@ -1607,16 +1607,17 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 281 unmodified lines
16071607 // pDq layers list
16081608 ilayer = 0;
16091609 if (NULL != pCtx->ppDqLayerList && pParam != NULL) {
1610− while (ilayer < pParam->iNumDependencyLayer) {
1610+ while (ilayer < pParam->iSpatialLayerNum) {
16111611 SDqLayer* pDq = pCtx->ppDqLayerList[ilayer];
16121612 SDLayerParam* pDlp = &pCtx->pSvcParam->sDependencyLayers[ilayer];
1613− const bool kbIsDynamicSlicing = (SM_DYN_SLICE == pDlp->sMso.uiSliceMode);
1613+
1614+ const bool kbIsDynamicSlicing = (SM_DYN_SLICE == pDlp->sSliceCfg.uiSliceMode);
16141615
16151616 // pDq layers
16161617 if (NULL != pDq) {
16171618 if (NULL != pDq->sLayerInfo.pSliceInLayer) {
16181619 int32_t iSliceIdx = 0;
1619− int32_t iSliceNum = GetInitialSliceNum (pDq->iMbWidth, pDq->iMbHeight, &pDlp->sMso);
1620+ int32_t iSliceNum = GetInitialSliceNum (pDq->iMbWidth, pDq->iMbHeight, &pDlp->sSliceCfg);
16201621 if (iSliceNum < 1)
16211622 iSliceNum = 1;
16221623 while (iSliceIdx < iSliceNum) {
@@ -1648,7 +1649,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 25 unmodified lines
16481649 // reference picture list extension
16491650 if (NULL != pCtx->ppRefPicListExt && pParam != NULL) {
16501651 ilayer = 0;
1651− while (ilayer < pParam->iNumDependencyLayer) {
1652+ while (ilayer < pParam->iSpatialLayerNum) {
16521653 SRefList* pRefList = pCtx->ppRefPicListExt[ilayer];
16531654 if (NULL != pRefList) {
16541655 int32_t iRef = 0;
@@ -1672,7 +1673,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 17 unmodified lines
16721673 // pSlice context list
16731674 if (NULL != pCtx->pSliceCtxList && pParam != NULL) {
16741675 ilayer = 0;
1675− while (ilayer < pParam->iNumDependencyLayer) {
1676+ while (ilayer < pParam->iSpatialLayerNum) {
16761677 SSliceCtx* pSliceCtx = &pCtx->pSliceCtxList[ilayer];
16771678 if (NULL != pSliceCtx)
16781679 UninitSlicePEncCtx (pSliceCtx, pMa);
@@ -1758,12 +1759,12 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 79 unmodified lines
17581759 }
17591760
17601761 int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCpuCores, int16_t* pMaxSliceCount) {
1761− int32_t iSpatialIdx = 0, iSpatialNum = pCodingParam->iNumDependencyLayer;
1762+ int32_t iSpatialIdx = 0, iSpatialNum = pCodingParam->iSpatialLayerNum;
17621763 int16_t iMaxSliceCount = 0;
17631764
17641765 do {
17651766 SDLayerParam* pDlp = &pCodingParam->sDependencyLayers[iSpatialIdx];
1766− SMulSliceOption* pMso = &pDlp->sMso;
1767+ SSliceConfig* pMso = &pDlp->sSliceCfg;
17671768 SSliceArgument* pSlcArg = &pMso->sSliceArgument;
17681769 const int32_t kiMbWidth = (pDlp->iFrameWidth + 15) >> 4;
17691770 const int32_t kiMbHeight = (pDlp->iFrameHeight + 15) >> 4;
@@ -1772,7 +1773,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 2 unmodified lines
17721773 #if defined(DYNAMIC_SLICE_ASSIGN)
17731774 int32_t iSliceNum = (SM_FIXEDSLCNUM_SLICE == pMso->uiSliceMode
17741775 || SM_DYN_SLICE == pMso->uiSliceMode) ? kiCpuCores :
1775− pSlcArg->iSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
1776+ pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
17761777 #else//!DYNAMIC_SLICE_ASSIGN
17771778 int32_t iSliceNum = (SM_DYN_SLICE == pMso->uiSliceMode) ? kiCpuCores :
17781779 pSlcArg->uiSliceNum; // uiSliceNum per input has been validated at ParamValidationExt()
@@ -1784,7 +1785,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 5 unmodified lines
17841785 // NOTE: Per design, in case MT/DYNAMIC_SLICE_ASSIGN enabled, for SM_FIXEDSLCNUM_SLICE mode,
17851786 // uiSliceNum of current spatial layer settings equals to uiCpuCores number; SM_DYN_SLICE mode,
17861787 // uiSliceNum intials as uiCpuCores also, stay tuned dynamically slicing in future
1787− pSlcArg->iSliceNum = iSliceNum; // used fixed one
1788+ pSlcArg->uiSliceNum = iSliceNum; // used fixed one
17881789
17891790 switch (pMso->uiSliceMode) {
17901791 case SM_DYN_SLICE:
@@ -2034,7 +2035,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 243 unmodified lines
20342035 #endif//ENABLE_TRACE_FILE
20352036
20362037 pCodingParam->DetermineTemporalSettings();
2037− iRet = AllocCodingParam (&pCtx->pSvcParam, pCtx->pMemAlign, pCodingParam->iNumDependencyLayer);
2038+ iRet = AllocCodingParam (&pCtx->pSvcParam, pCtx->pMemAlign, pCodingParam->iSpatialLayerNum);
20382039 if (iRet != 0) {
20392040 FreeMemorySvc (&pCtx);
20402041 return iRet;
@@ -2098,7 +2099,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 57 unmodified lines
20982099 void StatOverallEncodingExt (sWelsEncCtx* pCtx) {
20992100 int8_t i = 0;
21002101 int8_t j = 0;
2101− for (i = 0; i < pCtx->pSvcParam->iNumDependencyLayer; i++) {
2102+ for (i = 0; i < pCtx->pSvcParam->iSpatialLayerNum; i++) {
21022103 fprintf (stdout, "\nDependency layer : %d\n", i);
21032104 fprintf (stdout, "Quality layer : %d\n", j);
21042105 {
@@ -2511,8 +2512,8 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 406 unmodified lines
25112512
25122513 pCurDq->pDecPic = pDecPic;
25132514
2514− if (fDlp->sMso.uiSliceMode == SM_DYN_SLICE) // need get extra slices for update
2515− iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sMso);
2515+ if (fDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE) // need get extra slices for update
2516+ iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sSliceCfg);
25162517 else
25172518 iSliceCount = GetCurrentSliceNum (pCurDq->pSliceEncCtx);
25182519 assert (iSliceCount > 0);
@@ -2592,7 +2593,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 73 unmodified lines
25922593
25932594 if (P_SLICE == pCtx->eSliceType) {
25942595 if (kbBaseAvail) {
2595− if (pCtx->pSvcParam->iNumDependencyLayer == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1)) { //
2596+ if (pCtx->pSvcParam->iSpatialLayerNum == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1)) { //
25962597 pCtx->pFuncList->pfMotionSearch = WelsMotionEstimateSearchSad;
25972598 pCtx->pFuncList->pfFirstIntraMode = WelsMdFirstIntraMode;
25982599 pCtx->pFuncList->pfIntraFineMd = WelsMdIntraFinePartitionVaa;
@@ -2615,7 +2616,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 16 unmodified lines
26152616 pCtx->pFuncList->sSampleDealingFuncs.pfMeCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSatd;
26162617 } else {
26172618 //case 3: pBase layer MD + encoding
2618− if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iNumDependencyLayer) {
2619+ if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iSpatialLayerNum) {
26192620 pCtx->pFuncList->pfMotionSearch = WelsMotionEstimateSearchSad;
26202621 pCtx->pFuncList->pfFirstIntraMode = WelsMdFirstIntraMode;
26212622 pCtx->pFuncList->pfIntraFineMd = WelsMdIntraFinePartitionVaa;
@@ -2638,7 +2639,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 16 unmodified lines
26382639 pCtx->pFuncList->sSampleDealingFuncs.pfMeCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSatd;
26392640 }
26402641 } else if (I_SLICE == pCtx->eSliceType) {
2641− if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iNumDependencyLayer) {
2642+ if (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1 == pCtx->pSvcParam->iSpatialLayerNum) {
26422643 pCtx->pFuncList->sSampleDealingFuncs.pfMdCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSad;
26432644 pCtx->pFuncList->sSampleDealingFuncs.pfIntra16x16Combined3 =
26442645 pCtx->pFuncList->sSampleDealingFuncs.pfIntra16x16Combined3Sad;
@@ -3084,7 +3085,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 439 unmodified lines
30843085 pFbi->iLayerNum = 0; // for initialization
30853086
30863087 // perform csc/denoise/downsample/padding, generate spatial layers
3087− iSpatialNum = pCtx->pVpp->WelsPreprocessStep1 (pCtx, ppSrcList, iConfiguredLayerNum);
3088+ iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, ppSrcList, iConfiguredLayerNum);
30883089 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)
30893090 ++ pCtx->iCodingIndex;
30903091 return WELS_FRAME_TYPE_SKIP;
@@ -3132,7 +3133,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 41 unmodified lines
31323133 SDLayerParam* param_d = &pSvcParam->sDependencyLayers[d_idx];
31333134
31343135 pCtx->uiDependencyId = iCurDid = (int8_t)d_idx;
3135− pCtx->pVpp->WelsPreprocessStep3 (pCtx, d_idx);
3136+ pCtx->pVpp->AnalyzeSpatialPic (pCtx, d_idx);
31363137
31373138 pCtx->pEncPic = pEncPic = (pSpatialIndexMap + iSpatialIdx)->pSrc;
31383139 pCtx->pEncPic->iPictureType = pCtx->eSliceType;
@@ -3147,12 +3148,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 8 unmodified lines
31473148
31483149 // Encoding this picture might mulitiple sQualityStat layers potentially be encoded as followed
31493150
3150− switch (param_d->sMso.uiSliceMode) {
3151+ switch (param_d->sSliceCfg.uiSliceMode) {
31513152 case SM_FIXEDSLCNUM_SLICE: {
31523153 #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN)
31533154 if ((iCurDid > 0) && (pSvcParam->iMultipleThreadIdc > 1) &&
3154− (pSvcParam->sDependencyLayers[iCurDid].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3155− && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[iCurDid].sMso.sSliceArgument.iSliceNum)
3155+ (pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3156+ && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.sSliceArgument.uiSliceNum)
31563157 )
31573158 AdjustEnhanceLayer (pCtx, iCurDid);
31583159 #endif//MT_ENABLED && DYNAMIC_SLICE_ASSIGN
@@ -3183,7 +3184,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 24 unmodified lines
31833184 bAvcBased = (iCurDid == BASE_DEPENDENCY_ID);
31843185 pCtx->bNeedPrefixNalFlag = (bAvcBased &&
31853186 (pSvcParam->bPrefixNalAddingCtrl ||
3186− (pSvcParam->iNumDependencyLayer > 1)));
3187+ (pSvcParam->iSpatialLayerNum > 1)));
31873188
31883189 if (eFrameType == WELS_FRAME_TYPE_P) {
31893190 eNalType = bAvcBased ? NAL_UNIT_CODED_SLICE : NAL_UNIT_CODED_SLICE_EXT;
@@ -3229,7 +3230,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 39 unmodified lines
32293230 PreprocessSliceCoding (pCtx); // MUST be called after pfWelsRcPictureInit() and WelsInitCurrentLayer()
32303231
32313232 iLayerSize = 0;
3232− if (SM_SINGLE_SLICE == param_d->sMso.uiSliceMode) { // only one slice within a sQualityStat layer
3233+ if (SM_SINGLE_SLICE == param_d->sSliceCfg.uiSliceMode) { // only one slice within a sQualityStat layer
32333234 int32_t iSliceSize = 0;
32343235
32353236 if (pCtx->bNeedPrefixNalFlag) {
@@ -3258,9 +3259,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 22 unmodified lines
32583259 }
32593260 // for dynamic slicing single threading..
32603261 #ifndef MT_ENABLED
3261− else if (SM_DYN_SLICE == param_d->sMso.uiSliceMode)
3262+ else if (SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode)
32623263 #else // MT_ENABLED
3263− else if ((SM_DYN_SLICE == param_d->sMso.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1))
3264+ else if ((SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1))
32643265 #endif//MT_ENABLED
32653266 {
32663267 const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->pSliceEncCtx->iMbNumInFrame;
@@ -3270,7 +3271,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 3 unmodified lines
32703271 #if defined(MT_ENABLED)
32713272 int err = 0;
32723273 // THREAD_FULLY_FIRE_MODE/THREAD_PICK_UP_MODE for any mode of non-SM_DYN_SLICE
3273− if ((SM_DYN_SLICE != param_d->sMso.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
3274+ if ((SM_DYN_SLICE != param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
32743275 iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx);
32753276 if (iLayerNum +
32763277 #if defined(PACKING_ONE_SLICE_PER_LAYER)
@@ -3281,7 +3282,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 4 unmodified lines
32813282 >= MAX_LAYER_NUM_OF_FRAME) { // check available layer_bs_info for further writing as followed
32823283 WelsLog (pCtx, WELS_LOG_ERROR,
32833284 "WelsEncoderEncodeExt(), iLayerNum(%d) overflow(max:%d) at iDid= %d uiSliceMode= %d, iSliceCount= %d!",
3284− iLayerNum, MAX_LAYER_NUM_OF_FRAME, iCurDid, param_d->sMso.uiSliceMode, iSliceCount);
3285+ iLayerNum, MAX_LAYER_NUM_OF_FRAME, iCurDid, param_d->sSliceCfg.uiSliceMode, iSliceCount);
32853286 return -1;
32863287 }
32873288 if (iSliceCount <= 1) {
@@ -3311,7 +3312,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 23 unmodified lines
33113312 if (err) {
33123313 WelsLog (pCtx, WELS_LOG_ERROR,
33133314 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
3314− err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sMso.uiSliceMode, pSvcParam->iMultipleThreadIdc);
3315+ err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
33153316 return -1;
33163317 }
33173318
@@ -3370,7 +3371,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 52 unmodified lines
33703371 if (err) {
33713372 WelsLog (pCtx, WELS_LOG_ERROR,
33723373 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
3373− err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sMso.uiSliceMode, pSvcParam->iMultipleThreadIdc);
3374+ err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
33743375 return -1;
33753376 }
33763377
@@ -3447,7 +3448,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 70 unmodified lines
34473448 }
34483449 }
34493450 // THREAD_FULLY_FIRE_MODE && SM_DYN_SLICE
3450− else if ((SM_DYN_SLICE == param_d->sMso.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
3451+ else if ((SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
34513452 const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum; //pSvcParam->iCountThreadsNum;
34523453 #if defined(PACKING_ONE_SLICE_PER_LAYER)
34533454 ResetCountBsSizeInPartitions (pCtx->pSliceThreading->pCountBsSizeInPartition, kiPartitionCnt);
@@ -3462,7 +3463,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 8 unmodified lines
34623463 if (err) {
34633464 WelsLog (pCtx, WELS_LOG_ERROR,
34643465 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
3465− err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sMso.uiSliceMode, pSvcParam->iMultipleThreadIdc);
3466+ err, pSvcParam->iCountThreadsNum, iSliceCount, param_d->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
34663467 return -1;
34673468 }
34683469
@@ -3552,7 +3553,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 83 unmodified lines
35523553
35533554 #ifdef ENABLE_FRAME_DUMP
35543555 // Dump reconstruction picture for each sQualityStat layer
3555− if (iCurDid + 1 < pSvcParam->iNumDependencyLayer)
3556+ if (iCurDid + 1 < pSvcParam->iSpatialLayerNum)
35563557 DumpDependencyRec (fsnr, &param_d->sRecFileName[0], iCurDid);
35573558 #endif//ENABLE_FRAME_DUMP
35583559
@@ -3634,7 +3635,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 75 unmodified lines
36343635 #endif//STAT_OUTPUT
36353636
36363637 #if defined(MT_ENABLED) && defined(PACKING_ONE_SLICE_PER_LAYER)
3637− if (pSvcParam->iMultipleThreadIdc <= 1 || SM_SINGLE_SLICE == param_d->sMso.uiSliceMode) // sigle thread actually used
3638+ if (pSvcParam->iMultipleThreadIdc <= 1 || SM_SINGLE_SLICE == param_d->sSliceCfg.uiSliceMode) // sigle thread actually used
36383639 #else
36393640 if (1)
36403641 #endif//MT_ENABLED && PACKING_ONE_SLICE_PER_LAYER
@@ -3673,8 +3674,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 32 unmodified lines
36733674 }
36743675
36753676 #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
3676− if (param_d->sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE && pSvcParam->iMultipleThreadIdc > 1 &&
3677− pSvcParam->iMultipleThreadIdc >= param_d->sMso.sSliceArgument.iSliceNum) {
3677+ if (param_d->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE && pSvcParam->iMultipleThreadIdc > 1 &&
3678+ pSvcParam->iMultipleThreadIdc >= param_d->sSliceCfg.sSliceArgument.uiSliceNum) {
36783679 CalcSliceComplexRatio (pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], pCtx->pCurDqLayer->pSliceEncCtx,
36793680 pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]);
36803681 #if defined(MT_DEBUG)
@@ -3685,7 +3686,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 4 unmodified lines
36853686
36863687 ++ iSpatialIdx;
36873688
3688− if (iCurDid + 1 < pSvcParam->iNumDependencyLayer) {
3689+ if (iCurDid + 1 < pSvcParam->iSpatialLayerNum) {
36893690 WelsSwapDqLayers (pCtx);
36903691 }
36913692
@@ -3711,17 +3712,17 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 19 unmodified lines
37113712
37123713 #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN)
37133714 if (pSvcParam->iMultipleThreadIdc > 1 && did_list[0] == BASE_DEPENDENCY_ID
3714− && pSvcParam->sDependencyLayers[0].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3715− && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[0].sMso.sSliceArgument.iSliceNum
3716− && pSvcParam->sDependencyLayers[did_list[iSpatialNum - 1]].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3715+ && pSvcParam->sDependencyLayers[0].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
3716+ && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[0].sSliceCfg.sSliceArgument.uiSliceNum
3717+ && pSvcParam->sDependencyLayers[did_list[iSpatialNum - 1]].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
37173718 && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[did_list[iSpatialNum -
3718− 1]].sMso.sSliceArgument.iSliceNum) {
3719+ 1]].sSliceCfg.sSliceArgument.uiSliceNum) {
37193720 AdjustBaseLayer (pCtx);
37203721 }
37213722 #endif//DYNAMIC_SLICE_ASSIGN
37223723
37233724 #ifdef ENABLE_FRAME_DUMP
3724− DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iNumDependencyLayer -
3725+ DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iSpatialLayerNum -
37253726 1].sRecFileName[0]); // pDecPic: final reconstruction output
37263727 #endif//ENABLE_FRAME_DUMP
37273728
@@ -3757,18 +3758,18 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 29 unmodified lines
37573758 /* Decide whether need reset for IDR frame based on adjusting prarameters changed */
37583759 /* Temporal levels, spatial settings and/ or quality settings changed need update parameter sets related. */
37593760 bNeedReset = (pOldParam == NULL) ||
3760− (pOldParam->iNumTemporalLayer != pNewParam->iNumTemporalLayer) ||
3761+ (pOldParam->iTemporalLayerNum != pNewParam->iTemporalLayerNum) ||
37613762 (pOldParam->uiGopSize != pNewParam->uiGopSize) ||
3762− (pOldParam->iNumDependencyLayer != pNewParam->iNumDependencyLayer) ||
3763+ (pOldParam->iSpatialLayerNum != pNewParam->iSpatialLayerNum) ||
37633764 (pOldParam->iDecompStages != pNewParam->iDecompStages) ||
3764− (pOldParam->iActualPicWidth != pNewParam->iActualPicWidth
3765− || pOldParam->iActualPicHeight != pNewParam->iActualPicHeight) ||
3765+ (pOldParam->iPicWidth != pNewParam->iPicWidth
3766+ || pOldParam->iPicHeight != pNewParam->iPicHeight) ||
37663767 (pOldParam->SUsedPicRect.iWidth != pNewParam->SUsedPicRect.iWidth
37673768 || pOldParam->SUsedPicRect.iHeight != pNewParam->SUsedPicRect.iHeight) ||
37683769 (pOldParam->bEnableLongTermReference != pNewParam->bEnableLongTermReference);
37693770 if (!bNeedReset) { // Check its picture resolutions/quality settings respectively in each dependency layer
37703771 iIndexD = 0;
3771− assert (pOldParam->iNumDependencyLayer == pNewParam->iNumDependencyLayer);
3772+ assert (pOldParam->iSpatialLayerNum == pNewParam->iSpatialLayerNum);
37723773 do {
37733774 const SDLayerParam* kpOldDlp = &pOldParam->sDependencyLayers[iIndexD];
37743775 const SDLayerParam* kpNewDlp = &pNewParam->sDependencyLayers[iIndexD];
@@ -3784,8 +3785,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 9 unmodified lines
37843785 break;
37853786 }
37863787
3787− if (kpOldDlp->sMso.uiSliceMode != kpNewDlp->sMso.uiSliceMode ||
3788− kpOldDlp->sMso.sSliceArgument.iSliceNum != kpNewDlp->sMso.sSliceArgument.iSliceNum) {
3788+ if (kpOldDlp->sSliceCfg.uiSliceMode != kpNewDlp->sSliceCfg.uiSliceMode ||
3789+ kpOldDlp->sSliceCfg.sSliceArgument.uiSliceNum != kpNewDlp->sSliceCfg.sSliceArgument.uiSliceNum) {
37893790 bNeedReset = true;
37903791 break;
37913792 }
@@ -3808,7 +3809,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 16 unmodified lines
38083809 }
38093810
38103811 ++ iIndexD;
3811− } while (iIndexD < pOldParam->iNumDependencyLayer);
3812+ } while (iIndexD < pOldParam->iSpatialLayerNum);
38123813 }
38133814
38143815 if (bNeedReset) {
@@ -3863,7 +3864,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 48 unmodified lines
38633864
38643865 /* int32_t term reference control */
38653866 pOldParam->bEnableLongTermReference = pNewParam->bEnableLongTermReference;
3866− pOldParam->uiLtrMarkPeriod = pNewParam->uiLtrMarkPeriod;
3867+ pOldParam->iLtrMarkPeriod = pNewParam->iLtrMarkPeriod;
38673868
38683869 // keep below values unchanged as before
38693870 pOldParam->bEnableSSEI = pNewParam->bEnableSSEI;
@@ -3911,7 +3912,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 41 unmodified lines
39113912 sizeof (pOldDlp->uiCodingIdx2TemporalId)); // confirmed_safe_unsafe_usage
39123913
39133914 ++ iIndexD;
3914− } while (iIndexD < pOldParam->iNumDependencyLayer);
3915+ } while (iIndexD < pOldParam->iSpatialLayerNum);
39153916 }
39163917
39173918 /* 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