Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 30 files). Show all
Unified · Split
| @@ -88,7 +88,7 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 87 unmodified lines | ||
| 88 | 88 | |
| 89 | 89 | assert (pCfg != NULL); |
| 90 | 90 | |
| 91 | − for (i = 0; i < pCfg->iNumDependencyLayer; ++ i) { | |
| 91 | + for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) { | |
| 92 | 92 | SDLayerParam* fDlp = &pCfg->sDependencyLayers[i]; |
| 93 | 93 | if (fDlp->fOutputFrameRate > fDlp->fInputFrameRate || (fDlp->fInputFrameRate >= -fEpsn |
| 94 | 94 | && fDlp->fInputFrameRate <= fEpsn) |
| @@ -109,7 +109,7 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 14 unmodified lines | ||
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | − for (i = 0; i < pCfg->iNumDependencyLayer; ++ i) { | |
| 112 | + for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) { | |
| 113 | 113 | SDLayerParam* fDlp = &pCfg->sDependencyLayers[i]; |
| 114 | 114 | if (fDlp->fInputFrameRate > fMaxFrameRate) |
| 115 | 115 | fMaxFrameRate = fDlp->fInputFrameRate; |
| @@ -120,7 +120,7 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 4 unmodified lines | ||
| 120 | 120 | pCfg->fMaxFrameRate = fMaxFrameRate; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | − for (i = 0; i < pCfg->iNumDependencyLayer; ++ i) { | |
| 123 | + for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) { | |
| 124 | 124 | SDLayerParam* fDlp = &pCfg->sDependencyLayers[i]; |
| 125 | 125 | |
| 126 | 126 | pLastSpatialParam = fDlp; |
| @@ -142,19 +142,19 @@ int32_t ParamValidationExt (void* pParam) { · 15 unmodified lines | ||
| 142 | 142 | if (NULL == pCodingParam) |
| 143 | 143 | return 1; |
| 144 | 144 | |
| 145 | − if (pCodingParam->iNumDependencyLayer < 1 || pCodingParam->iNumDependencyLayer > MAX_DEPENDENCY_LAYER) { | |
| 145 | + if (pCodingParam->iSpatialLayerNum < 1 || pCodingParam->iSpatialLayerNum > MAX_DEPENDENCY_LAYER) { | |
| 146 | 146 | #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); | |
| 149 | 149 | #endif//#if _DEBUG |
| 150 | 150 | |
| 151 | 151 | return 1; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | − if (pCodingParam->iNumTemporalLayer < 1 || pCodingParam->iNumTemporalLayer > MAX_TEMPORAL_LEVEL) { | |
| 154 | + if (pCodingParam->iTemporalLayerNum < 1 || pCodingParam->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) { | |
| 155 | 155 | #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); | |
| 158 | 158 | #endif//#if _DEBUG |
| 159 | 159 | return 1; |
| 160 | 160 | } |
| @@ -201,7 +201,7 @@ int32_t ParamValidationExt (void* pParam) { · 40 unmodified lines | ||
| 201 | 201 | pCodingParam->bDeblockingParallelFlag = false; |
| 202 | 202 | #endif//MT_ENABLED |
| 203 | 203 | |
| 204 | − for (i = 0; i < pCodingParam->iNumDependencyLayer; ++ i) { | |
| 204 | + for (i = 0; i < pCodingParam->iSpatialLayerNum; ++ i) { | |
| 205 | 205 | SDLayerParam* fDlp = &pCodingParam->sDependencyLayers[i]; |
| 206 | 206 | const int32_t kiPicWidth = fDlp->iFrameWidth; |
| 207 | 207 | const int32_t kiPicHeight = fDlp->iFrameHeight; |
| @@ -224,9 +224,9 @@ int32_t ParamValidationExt (void* pParam) { · 16 unmodified lines | ||
| 224 | 224 | return 1; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | − if (fDlp->sMso.uiSliceMode >= SM_RESERVED) { | |
| 227 | + if (fDlp->sSliceCfg.uiSliceMode >= SM_RESERVED) { | |
| 228 | 228 | #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); | |
| 230 | 230 | #endif//#if _DEBUG |
| 231 | 231 | return 1; |
| 232 | 232 | } |
| @@ -234,102 +234,102 @@ int32_t ParamValidationExt (void* pParam) { · 1 unmodified line | ||
| 234 | 234 | //check pSlice settings under multi-pSlice |
| 235 | 235 | if (kiPicWidth <= 16 && kiPicHeight <= 16) { |
| 236 | 236 | //only have one MB, set to single_slice |
| 237 | − fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE; | |
| 237 | + fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | |
| 238 | 238 | } |
| 239 | − switch (fDlp->sMso.uiSliceMode) { | |
| 239 | + switch (fDlp->sSliceCfg.uiSliceMode) { | |
| 240 | 240 | 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; | |
| 244 | 244 | for (iIdx = 0; iIdx < MAX_SLICES_NUM; iIdx++) { |
| 245 | − fDlp->sMso.sSliceArgument.uiSliceMbNum[iIdx] = 0; | |
| 245 | + fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[iIdx] = 0; | |
| 246 | 246 | } |
| 247 | 247 | break; |
| 248 | 248 | case SM_FIXEDSLCNUM_SLICE: { |
| 249 | − fDlp->sMso.sSliceArgument.uiSliceSizeConstraint = 0; | |
| 249 | + fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | |
| 250 | 250 | |
| 251 | 251 | iMbWidth = (kiPicWidth + 15) >> 4; |
| 252 | 252 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 253 | 253 | iMbNumInFrame = iMbWidth * iMbHeight; |
| 254 | 254 | 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) { | |
| 257 | 257 | #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); | |
| 259 | 259 | #endif//#if _DEBUG |
| 260 | 260 | return 1; |
| 261 | 261 | } |
| 262 | − if (fDlp->sMso.sSliceArgument.iSliceNum == 1) { | |
| 262 | + if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum == 1) { | |
| 263 | 263 | #if defined (_DEBUG) |
| 264 | 264 | fprintf (stderr, |
| 265 | 265 | "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); | |
| 267 | 267 | #endif//#if _DEBUG |
| 268 | − fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE; | |
| 268 | + fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | |
| 269 | 269 | break; |
| 270 | 270 | } |
| 271 | 271 | if (pCodingParam->bEnableRc) { // multiple slices verify with gom |
| 272 | 272 | //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); | |
| 275 | 275 | //set uiSliceMbNum with current uiSliceNum |
| 276 | − GomValidCheckSliceMbNum (iMbWidth, iMbHeight, &fDlp->sMso.sSliceArgument); | |
| 276 | + GomValidCheckSliceMbNum (iMbWidth, iMbHeight, &fDlp->sSliceCfg.sSliceArgument); | |
| 277 | 277 | } else if (!CheckFixedSliceNumMultiSliceSetting (iMbNumInFrame, |
| 278 | − &fDlp->sMso.sSliceArgument)) { // verify interleave mode settings | |
| 278 | + &fDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings | |
| 279 | 279 | //check uiSliceMbNum with current uiSliceNum |
| 280 | 280 | #if defined (_DEBUG) |
| 281 | 281 | fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n", |
| 282 | − fDlp->sMso.sSliceArgument.uiSliceMbNum[0]); | |
| 282 | + fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | |
| 283 | 283 | #endif//#if _DEBUG |
| 284 | 284 | return 1; |
| 285 | 285 | } |
| 286 | 286 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting |
| 287 | 287 | 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; | |
| 290 | 290 | break; |
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | break; |
| 294 | 294 | case SM_RASTER_SLICE: { |
| 295 | − fDlp->sMso.sSliceArgument.uiSliceSizeConstraint = 0; | |
| 295 | + fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | |
| 296 | 296 | |
| 297 | 297 | iMbWidth = (kiPicWidth + 15) >> 4; |
| 298 | 298 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 299 | 299 | iMbNumInFrame = iMbWidth * iMbHeight; |
| 300 | 300 | iMaxSliceNum = MAX_SLICES_NUM; |
| 301 | − if (fDlp->sMso.sSliceArgument.uiSliceMbNum[0] <= 0) { | |
| 301 | + if (fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0] <= 0) { | |
| 302 | 302 | #if defined (_DEBUG) |
| 303 | 303 | fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n", |
| 304 | − fDlp->sMso.sSliceArgument.uiSliceMbNum[0]); | |
| 304 | + fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | |
| 305 | 305 | #endif//#if _DEBUG |
| 306 | 306 | return 1; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | − if (!CheckRasterMultiSliceSetting (iMbNumInFrame, &fDlp->sMso.sSliceArgument)) { // verify interleave mode settings | |
| 309 | + if (!CheckRasterMultiSliceSetting (iMbNumInFrame, &fDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings | |
| 310 | 310 | #if defined (_DEBUG) |
| 311 | 311 | fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n", |
| 312 | − fDlp->sMso.sSliceArgument.uiSliceMbNum[0]); | |
| 312 | + fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | |
| 313 | 313 | #endif//#if _DEBUG |
| 314 | 314 | return 1; |
| 315 | 315 | } |
| 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 | |
| 318 | 318 | #if defined (_DEBUG) |
| 319 | 319 | fprintf (stderr, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!\n", |
| 320 | − fDlp->sMso.sSliceArgument.iSliceNum); | |
| 320 | + fDlp->sSliceCfg.sSliceArgument.uiSliceNum); | |
| 321 | 321 | #endif//#if _DEBUG |
| 322 | 322 | return 1; |
| 323 | 323 | } |
| 324 | − if (fDlp->sMso.sSliceArgument.iSliceNum == 1) { | |
| 324 | + if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum == 1) { | |
| 325 | 325 | #if defined (_DEBUG) |
| 326 | 326 | fprintf (stderr, "ParamValidationExt(), pSlice setting for SM_RASTER_SLICE now turn to SM_SINGLE_SLICE!\n"); |
| 327 | 327 | #endif//#if _DEBUG |
| 328 | − fDlp->sMso.uiSliceMode = SM_SINGLE_SLICE; | |
| 328 | + fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | |
| 329 | 329 | break; |
| 330 | 330 | } |
| 331 | 331 | #ifdef MT_ENABLED |
| 332 | − if (pCodingParam->bEnableRc && fDlp->sMso.sSliceArgument.iSliceNum > 1) { | |
| 332 | + if (pCodingParam->bEnableRc && fDlp->sSliceCfg.sSliceArgument.uiSliceNum > 1) { | |
| 333 | 333 | #if defined (_DEBUG) |
| 334 | 334 | fprintf (stderr, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!\n"); |
| 335 | 335 | #endif//#if _DEBUG |
| @@ -337,14 +337,14 @@ int32_t ParamValidationExt (void* pParam) { · 1 unmodified line | ||
| 337 | 337 | #endif |
| 338 | 338 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting |
| 339 | 339 | 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; | |
| 342 | 342 | break; |
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | break; |
| 346 | 346 | case SM_ROWMB_SLICE: { |
| 347 | − fDlp->sMso.sSliceArgument.uiSliceSizeConstraint = 0; | |
| 347 | + fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | |
| 348 | 348 | |
| 349 | 349 | iMbWidth = (kiPicWidth + 15) >> 4; |
| 350 | 350 | iMbHeight = (kiPicHeight + 15) >> 4; |
| @@ -355,18 +355,18 @@ int32_t ParamValidationExt (void* pParam) { · 4 unmodified lines | ||
| 355 | 355 | #endif//#if _DEBUG |
| 356 | 356 | return 1; |
| 357 | 357 | } |
| 358 | − fDlp->sMso.sSliceArgument.iSliceNum = iMbHeight; | |
| 358 | + fDlp->sSliceCfg.sSliceArgument.uiSliceNum = iMbHeight; | |
| 359 | 359 | |
| 360 | − if (fDlp->sMso.sSliceArgument.iSliceNum <= 0) { | |
| 360 | + if (fDlp->sSliceCfg.sSliceArgument.uiSliceNum <= 0) { | |
| 361 | 361 | #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); | |
| 363 | 363 | #endif//#if _DEBUG |
| 364 | 364 | return 1; |
| 365 | 365 | } |
| 366 | − if (!CheckRowMbMultiSliceSetting (iMbWidth, &fDlp->sMso.sSliceArgument)) { // verify interleave mode settings | |
| 366 | + if (!CheckRowMbMultiSliceSetting (iMbWidth, &fDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings | |
| 367 | 367 | #if defined (_DEBUG) |
| 368 | 368 | fprintf (stderr, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n", |
| 369 | − fDlp->sMso.sSliceArgument.uiSliceMbNum[0]); | |
| 369 | + fDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | |
| 370 | 370 | #endif//#if _DEBUG |
| 371 | 371 | return 1; |
| 372 | 372 | } |
| @@ -375,17 +375,17 @@ int32_t ParamValidationExt (void* pParam) { · 2 unmodified lines | ||
| 375 | 375 | case SM_DYN_SLICE: { |
| 376 | 376 | iMbWidth = (kiPicWidth + 15) >> 4; |
| 377 | 377 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 378 | − if (fDlp->sMso.sSliceArgument.uiSliceSizeConstraint <= 0) { | |
| 378 | + if (fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint <= 0) { | |
| 379 | 379 | #if defined (_DEBUG) |
| 380 | 380 | fprintf (stderr, "ParamValidationExt(), invalid iSliceSize (%d) settings!\n", |
| 381 | − fDlp->sMso.sSliceArgument.uiSliceSizeConstraint); | |
| 381 | + fDlp->sSliceCfg.sSliceArgument.uiSliceSizeConstraint); | |
| 382 | 382 | #endif//#if _DEBUG |
| 383 | 383 | return 1; |
| 384 | 384 | } |
| 385 | 385 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting |
| 386 | 386 | 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; | |
| 389 | 389 | break; |
| 390 | 390 | } |
| 391 | 391 | } |
| @@ -394,7 +394,7 @@ int32_t ParamValidationExt (void* pParam) { · 2 unmodified lines | ||
| 394 | 394 | |
| 395 | 395 | #if defined (_DEBUG) |
| 396 | 396 | fprintf (stderr, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n", |
| 397 | − pCodingParam->sDependencyLayers[0].sMso.uiSliceMode); | |
| 397 | + pCodingParam->sDependencyLayers[0].sSliceCfg.uiSliceMode); | |
| 398 | 398 | #endif//#if _DEBUG |
| 399 | 399 | return 1; |
| 400 | 400 | |
| @@ -411,7 +411,7 @@ void WelsEncoderApplyFrameRate(SWelsSvcCodingParam* pParam) · 10 unmodified lines | ||
| 411 | 411 | { |
| 412 | 412 | SDLayerParam* pLayerParam; |
| 413 | 413 | const float kfEpsn = 0.000001f; |
| 414 | − const int32_t kiNumLayer = pParam->iNumDependencyLayer; | |
| 414 | + const int32_t kiNumLayer = pParam->iSpatialLayerNum; | |
| 415 | 415 | int32_t i; |
| 416 | 416 | const float kfMaxFrameRate = pParam->fMaxFrameRate; |
| 417 | 417 | float fRatio; |
| @@ -439,7 +439,7 @@ void WelsEncoderApplyBitRate(SWelsSvcCodingParam* pParam) · 21 unmodified lines | ||
| 439 | 439 | //but it is also possible to fulfill the bitrate of lower layer first |
| 440 | 440 | |
| 441 | 441 | SDLayerParam* pLayerParam; |
| 442 | − const int32_t iNumLayers = pParam->iNumDependencyLayer; | |
| 442 | + const int32_t iNumLayers = pParam->iSpatialLayerNum; | |
| 443 | 443 | int32_t i, iOrigTotalBitrate=0; |
| 444 | 444 | //read old BR |
| 445 | 445 | for (i=0;i<iNumLayers;i++) { |
| @@ -474,7 +474,7 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 28 unmodified lines | ||
| 474 | 474 | if (NULL == pParam || NULL == ppCtx || NULL == *ppCtx) |
| 475 | 475 | return 1; |
| 476 | 476 | |
| 477 | − iNumDependencyLayers = pParam->iNumDependencyLayer; | |
| 477 | + iNumDependencyLayers = pParam->iSpatialLayerNum; | |
| 478 | 478 | |
| 479 | 479 | do { |
| 480 | 480 | SDLayerParam* pDLayer = &pParam->sDependencyLayers[iDIndex]; |
| @@ -485,7 +485,7 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 4 unmodified lines | ||
| 485 | 485 | //Review this part and suggest no change, since the memory over-use |
| 486 | 486 | //(1) counts little to the overall performance |
| 487 | 487 | //(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) { | |
| 489 | 489 | iCountNumNals += MAX_SLICES_NUM; |
| 490 | 490 | // plus prefix NALs |
| 491 | 491 | if (iDIndex == 0) |
| @@ -497,10 +497,10 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 5 unmodified lines | ||
| 497 | 497 | #else//!MT_ENABLED || !PACKING_ONE_SLICE_PER_LAYER |
| 498 | 498 | assert (iCountNumNals - iOrgNumNals <= MAX_NAL_UNITS_IN_LAYER); |
| 499 | 499 | #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 )*/ | |
| 501 | 501 | const int32_t kiNumOfSlice = GetInitialSliceNum ((pDLayer->iFrameWidth + 0x0f) >> 4, |
| 502 | 502 | (pDLayer->iFrameHeight + 0x0f) >> 4, |
| 503 | − &pDLayer->sMso); | |
| 503 | + &pDLayer->sSliceCfg); | |
| 504 | 504 | |
| 505 | 505 | // NEED check iCountNals value in case multiple slices is used |
| 506 | 506 | iCountNumNals += kiNumOfSlice; // for pSlice VCL NALs |
| @@ -644,7 +644,7 @@ static void InitMbInfo (sWelsEncCtx* pEnc, SMB* pList, SDqLayer* pLayer, con · 137 unmodified lines | ||
| 644 | 644 | |
| 645 | 645 | |
| 646 | 646 | int32_t InitMbListD (sWelsEncCtx** ppCtx) { |
| 647 | − int32_t iNumDlayer = (*ppCtx)->pSvcParam->iNumDependencyLayer; | |
| 647 | + int32_t iNumDlayer = (*ppCtx)->pSvcParam->iSpatialLayerNum; | |
| 648 | 648 | int32_t iMbSize[MAX_DEPENDENCY_LAYER] = { 0 }; |
| 649 | 649 | int32_t iOverallMbNum = 0; |
| 650 | 650 | int32_t iMbWidth = 0; |
| @@ -760,7 +760,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 109 unmodified lines | ||
| 760 | 760 | |
| 761 | 761 | pMa = (*ppCtx)->pMemAlign; |
| 762 | 762 | pParam = (*ppCtx)->pSvcParam; |
| 763 | − iDlayerCount = pParam->iNumDependencyLayer; | |
| 763 | + iDlayerCount = pParam->iSpatialLayerNum; | |
| 764 | 764 | iNumRef = pParam->iNumRefFrame; |
| 765 | 765 | // highest_layers_in_temporal = 1 + WELS_MAX(pParam->iDecompStages, 1); |
| 766 | 766 | pStrideTab = (*ppCtx)->pStrideTab; |
| @@ -802,7 +802,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 35 unmodified lines | ||
| 802 | 802 | const int32_t kiMbW = (pDlayer->iFrameWidth + 0x0f) >> 4; |
| 803 | 803 | const int32_t kiMbH = (pDlayer->iFrameHeight + 0x0f) >> 4; |
| 804 | 804 | int32_t iMaxSliceNum = 1; |
| 805 | − const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sMso); | |
| 805 | + const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sSliceCfg); | |
| 806 | 806 | if (iMaxSliceNum < kiSliceNum) |
| 807 | 807 | iMaxSliceNum = kiSliceNum; |
| 808 | 808 | |
| @@ -811,7 +811,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 2 unmodified lines | ||
| 811 | 811 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeMemorySvc (ppCtx)) |
| 812 | 812 | |
| 813 | 813 | // for dynamic slicing mode |
| 814 | − if (SM_DYN_SLICE == pDlayer->sMso.uiSliceMode) { | |
| 814 | + if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) { | |
| 815 | 815 | const int32_t iSize = pParam->iCountThreadsNum * sizeof (int32_t); |
| 816 | 816 | |
| 817 | 817 | pDqLayer->pNumSliceCodedOfPartition = (int32_t*)pMa->WelsMallocz (iSize, "pNumSliceCodedOfPartition"); |
| @@ -828,7 +828,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 10 unmodified lines | ||
| 828 | 828 | pDqLayer->iMbWidth = kiMbW; |
| 829 | 829 | pDqLayer->iMbHeight = kiMbH; |
| 830 | 830 | #ifndef MT_ENABLED |
| 831 | − if (SM_DYN_SLICE == pDlayer->sMso.uiSliceMode) { //wmalloc pSliceInLayer | |
| 831 | + if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) { //wmalloc pSliceInLayer | |
| 832 | 832 | SSlice* pSlice = NULL; |
| 833 | 833 | int32_t iSliceIdx = 0; |
| 834 | 834 | //wmalloc AVERSLICENUM_CONSTANT of pDqLayer->sLayerInfo.pSliceInLayer, |
| @@ -901,7 +901,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 66 unmodified lines | ||
| 901 | 901 | pDqLayer->bDeblockingParallelFlag = pParam->bDeblockingParallelFlag; |
| 902 | 902 | |
| 903 | 903 | //deblocking parameter adjustment |
| 904 | − if (SM_SINGLE_SLICE == pDlayer->sMso.uiSliceMode) { | |
| 904 | + if (SM_SINGLE_SLICE == pDlayer->sSliceCfg.uiSliceMode) { | |
| 905 | 905 | //iLoopFilterDisableIdc: will be 0 or 1 under single_slice |
| 906 | 906 | if (2 == pParam->iLoopFilterDisableIdc) { |
| 907 | 907 | pDqLayer->iLoopFilterDisableIdc = 0; |
| @@ -980,7 +980,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 72 unmodified lines | ||
| 980 | 980 | false, |
| 981 | 981 | pSps->iMbWidth, |
| 982 | 982 | pSps->iMbHeight, |
| 983 | − & (pDlayerParam->sMso), | |
| 983 | + & (pDlayerParam->sSliceCfg), | |
| 984 | 984 | pPps); |
| 985 | 985 | if (iResult) { |
| 986 | 986 | 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 | ||
| 1042 | 1042 | return 1; |
| 1043 | 1043 | (*ppCtx)->pStrideTab = pPtr; |
| 1044 | 1044 | |
| 1045 | − iCntTid = pParam->iNumTemporalLayer > 1 ? 2 : 1; | |
| 1045 | + iCntTid = pParam->iTemporalLayerNum > 1 ? 2 : 1; | |
| 1046 | 1046 | |
| 1047 | 1047 | iSpatialIdx = 0; |
| 1048 | 1048 | while (iSpatialIdx < kiNumSpatialLayers) { |
| @@ -1278,7 +1278,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 229 unmodified lines | ||
| 1278 | 1278 | int32_t iCountLayers = 0; |
| 1279 | 1279 | int32_t iResult = 0; |
| 1280 | 1280 | float fCompressRatioThr = .5f; |
| 1281 | − const int32_t kiNumDependencyLayers = pParam->iNumDependencyLayer; | |
| 1281 | + const int32_t kiNumDependencyLayers = pParam->iSpatialLayerNum; | |
| 1282 | 1282 | const uint32_t kuiMvdInterTableSize = (kiNumDependencyLayers == 1 ? (1 + (648 << 1)) : (1 + (972 << 1))); |
| 1283 | 1283 | const uint32_t kuiMvdCacheAlginedSize = kuiMvdInterTableSize * sizeof (uint16_t); |
| 1284 | 1284 | int32_t iVclLayersBsSizeCount = 0; |
| @@ -1314,12 +1314,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 29 unmodified lines | ||
| 1314 | 1314 | return 1; |
| 1315 | 1315 | } |
| 1316 | 1316 | |
| 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; | |
| 1319 | 1319 | |
| 1320 | 1320 | int32_t iLayerBsSize = 0; |
| 1321 | 1321 | iIndex = 0; |
| 1322 | − while (iIndex < pParam->iNumDependencyLayer) { | |
| 1322 | + while (iIndex < pParam->iSpatialLayerNum) { | |
| 1323 | 1323 | SDLayerParam* fDlp = &pParam->sDependencyLayers[iIndex]; |
| 1324 | 1324 | |
| 1325 | 1325 | fCompressRatioThr = COMPRESS_RATIO_DECIDED_BY_RESOLUTION (fDlp->iFrameWidth, fDlp->iFrameHeight); |
| @@ -1607,16 +1607,17 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 281 unmodified lines | ||
| 1607 | 1607 | // pDq layers list |
| 1608 | 1608 | ilayer = 0; |
| 1609 | 1609 | if (NULL != pCtx->ppDqLayerList && pParam != NULL) { |
| 1610 | − while (ilayer < pParam->iNumDependencyLayer) { | |
| 1610 | + while (ilayer < pParam->iSpatialLayerNum) { | |
| 1611 | 1611 | SDqLayer* pDq = pCtx->ppDqLayerList[ilayer]; |
| 1612 | 1612 | 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); | |
| 1614 | 1615 | |
| 1615 | 1616 | // pDq layers |
| 1616 | 1617 | if (NULL != pDq) { |
| 1617 | 1618 | if (NULL != pDq->sLayerInfo.pSliceInLayer) { |
| 1618 | 1619 | 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); | |
| 1620 | 1621 | if (iSliceNum < 1) |
| 1621 | 1622 | iSliceNum = 1; |
| 1622 | 1623 | while (iSliceIdx < iSliceNum) { |
| @@ -1648,7 +1649,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 25 unmodified lines | ||
| 1648 | 1649 | // reference picture list extension |
| 1649 | 1650 | if (NULL != pCtx->ppRefPicListExt && pParam != NULL) { |
| 1650 | 1651 | ilayer = 0; |
| 1651 | − while (ilayer < pParam->iNumDependencyLayer) { | |
| 1652 | + while (ilayer < pParam->iSpatialLayerNum) { | |
| 1652 | 1653 | SRefList* pRefList = pCtx->ppRefPicListExt[ilayer]; |
| 1653 | 1654 | if (NULL != pRefList) { |
| 1654 | 1655 | int32_t iRef = 0; |
| @@ -1672,7 +1673,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 17 unmodified lines | ||
| 1672 | 1673 | // pSlice context list |
| 1673 | 1674 | if (NULL != pCtx->pSliceCtxList && pParam != NULL) { |
| 1674 | 1675 | ilayer = 0; |
| 1675 | − while (ilayer < pParam->iNumDependencyLayer) { | |
| 1676 | + while (ilayer < pParam->iSpatialLayerNum) { | |
| 1676 | 1677 | SSliceCtx* pSliceCtx = &pCtx->pSliceCtxList[ilayer]; |
| 1677 | 1678 | if (NULL != pSliceCtx) |
| 1678 | 1679 | UninitSlicePEncCtx (pSliceCtx, pMa); |
| @@ -1758,12 +1759,12 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 79 unmodified lines | ||
| 1758 | 1759 | } |
| 1759 | 1760 | |
| 1760 | 1761 | 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; | |
| 1762 | 1763 | int16_t iMaxSliceCount = 0; |
| 1763 | 1764 | |
| 1764 | 1765 | do { |
| 1765 | 1766 | SDLayerParam* pDlp = &pCodingParam->sDependencyLayers[iSpatialIdx]; |
| 1766 | − SMulSliceOption* pMso = &pDlp->sMso; | |
| 1767 | + SSliceConfig* pMso = &pDlp->sSliceCfg; | |
| 1767 | 1768 | SSliceArgument* pSlcArg = &pMso->sSliceArgument; |
| 1768 | 1769 | const int32_t kiMbWidth = (pDlp->iFrameWidth + 15) >> 4; |
| 1769 | 1770 | const int32_t kiMbHeight = (pDlp->iFrameHeight + 15) >> 4; |
| @@ -1772,7 +1773,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 2 unmodified lines | ||
| 1772 | 1773 | #if defined(DYNAMIC_SLICE_ASSIGN) |
| 1773 | 1774 | int32_t iSliceNum = (SM_FIXEDSLCNUM_SLICE == pMso->uiSliceMode |
| 1774 | 1775 | || 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() | |
| 1776 | 1777 | #else//!DYNAMIC_SLICE_ASSIGN |
| 1777 | 1778 | int32_t iSliceNum = (SM_DYN_SLICE == pMso->uiSliceMode) ? kiCpuCores : |
| 1778 | 1779 | 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 | ||
| 1784 | 1785 | // NOTE: Per design, in case MT/DYNAMIC_SLICE_ASSIGN enabled, for SM_FIXEDSLCNUM_SLICE mode, |
| 1785 | 1786 | // uiSliceNum of current spatial layer settings equals to uiCpuCores number; SM_DYN_SLICE mode, |
| 1786 | 1787 | // 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 | |
| 1788 | 1789 | |
| 1789 | 1790 | switch (pMso->uiSliceMode) { |
| 1790 | 1791 | case SM_DYN_SLICE: |
| @@ -2034,7 +2035,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 243 unmodified lines | ||
| 2034 | 2035 | #endif//ENABLE_TRACE_FILE |
| 2035 | 2036 | |
| 2036 | 2037 | pCodingParam->DetermineTemporalSettings(); |
| 2037 | − iRet = AllocCodingParam (&pCtx->pSvcParam, pCtx->pMemAlign, pCodingParam->iNumDependencyLayer); | |
| 2038 | + iRet = AllocCodingParam (&pCtx->pSvcParam, pCtx->pMemAlign, pCodingParam->iSpatialLayerNum); | |
| 2038 | 2039 | if (iRet != 0) { |
| 2039 | 2040 | FreeMemorySvc (&pCtx); |
| 2040 | 2041 | return iRet; |
| @@ -2098,7 +2099,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 57 unmodified lines | ||
| 2098 | 2099 | void StatOverallEncodingExt (sWelsEncCtx* pCtx) { |
| 2099 | 2100 | int8_t i = 0; |
| 2100 | 2101 | int8_t j = 0; |
| 2101 | − for (i = 0; i < pCtx->pSvcParam->iNumDependencyLayer; i++) { | |
| 2102 | + for (i = 0; i < pCtx->pSvcParam->iSpatialLayerNum; i++) { | |
| 2102 | 2103 | fprintf (stdout, "\nDependency layer : %d\n", i); |
| 2103 | 2104 | fprintf (stdout, "Quality layer : %d\n", j); |
| 2104 | 2105 | { |
| @@ -2511,8 +2512,8 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 406 unmodified lines | ||
| 2511 | 2512 | |
| 2512 | 2513 | pCurDq->pDecPic = pDecPic; |
| 2513 | 2514 | |
| 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); | |
| 2516 | 2517 | else |
| 2517 | 2518 | iSliceCount = GetCurrentSliceNum (pCurDq->pSliceEncCtx); |
| 2518 | 2519 | assert (iSliceCount > 0); |
| @@ -2592,7 +2593,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 73 unmodified lines | ||
| 2592 | 2593 | |
| 2593 | 2594 | if (P_SLICE == pCtx->eSliceType) { |
| 2594 | 2595 | if (kbBaseAvail) { |
| 2595 | − if (pCtx->pSvcParam->iNumDependencyLayer == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1)) { // | |
| 2596 | + if (pCtx->pSvcParam->iSpatialLayerNum == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1)) { // | |
| 2596 | 2597 | pCtx->pFuncList->pfMotionSearch = WelsMotionEstimateSearchSad; |
| 2597 | 2598 | pCtx->pFuncList->pfFirstIntraMode = WelsMdFirstIntraMode; |
| 2598 | 2599 | pCtx->pFuncList->pfIntraFineMd = WelsMdIntraFinePartitionVaa; |
| @@ -2615,7 +2616,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 16 unmodified lines | ||
| 2615 | 2616 | pCtx->pFuncList->sSampleDealingFuncs.pfMeCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSatd; |
| 2616 | 2617 | } else { |
| 2617 | 2618 | //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) { | |
| 2619 | 2620 | pCtx->pFuncList->pfMotionSearch = WelsMotionEstimateSearchSad; |
| 2620 | 2621 | pCtx->pFuncList->pfFirstIntraMode = WelsMdFirstIntraMode; |
| 2621 | 2622 | pCtx->pFuncList->pfIntraFineMd = WelsMdIntraFinePartitionVaa; |
| @@ -2638,7 +2639,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 16 unmodified lines | ||
| 2638 | 2639 | pCtx->pFuncList->sSampleDealingFuncs.pfMeCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSatd; |
| 2639 | 2640 | } |
| 2640 | 2641 | } 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) { | |
| 2642 | 2643 | pCtx->pFuncList->sSampleDealingFuncs.pfMdCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSad; |
| 2643 | 2644 | pCtx->pFuncList->sSampleDealingFuncs.pfIntra16x16Combined3 = |
| 2644 | 2645 | pCtx->pFuncList->sSampleDealingFuncs.pfIntra16x16Combined3Sad; |
| @@ -3084,7 +3085,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 439 unmodified lines | ||
| 3084 | 3085 | pFbi->iLayerNum = 0; // for initialization |
| 3085 | 3086 | |
| 3086 | 3087 | // perform csc/denoise/downsample/padding, generate spatial layers |
| 3087 | − iSpatialNum = pCtx->pVpp->WelsPreprocessStep1 (pCtx, ppSrcList, iConfiguredLayerNum); | |
| 3088 | + iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, ppSrcList, iConfiguredLayerNum); | |
| 3088 | 3089 | if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate) |
| 3089 | 3090 | ++ pCtx->iCodingIndex; |
| 3090 | 3091 | return WELS_FRAME_TYPE_SKIP; |
| @@ -3132,7 +3133,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 41 unmodified lines | ||
| 3132 | 3133 | SDLayerParam* param_d = &pSvcParam->sDependencyLayers[d_idx]; |
| 3133 | 3134 | |
| 3134 | 3135 | pCtx->uiDependencyId = iCurDid = (int8_t)d_idx; |
| 3135 | − pCtx->pVpp->WelsPreprocessStep3 (pCtx, d_idx); | |
| 3136 | + pCtx->pVpp->AnalyzeSpatialPic (pCtx, d_idx); | |
| 3136 | 3137 | |
| 3137 | 3138 | pCtx->pEncPic = pEncPic = (pSpatialIndexMap + iSpatialIdx)->pSrc; |
| 3138 | 3139 | pCtx->pEncPic->iPictureType = pCtx->eSliceType; |
| @@ -3147,12 +3148,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 8 unmodified lines | ||
| 3147 | 3148 | |
| 3148 | 3149 | // Encoding this picture might mulitiple sQualityStat layers potentially be encoded as followed |
| 3149 | 3150 | |
| 3150 | − switch (param_d->sMso.uiSliceMode) { | |
| 3151 | + switch (param_d->sSliceCfg.uiSliceMode) { | |
| 3151 | 3152 | case SM_FIXEDSLCNUM_SLICE: { |
| 3152 | 3153 | #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN) |
| 3153 | 3154 | 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) | |
| 3156 | 3157 | ) |
| 3157 | 3158 | AdjustEnhanceLayer (pCtx, iCurDid); |
| 3158 | 3159 | #endif//MT_ENABLED && DYNAMIC_SLICE_ASSIGN |
| @@ -3183,7 +3184,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 24 unmodified lines | ||
| 3183 | 3184 | bAvcBased = (iCurDid == BASE_DEPENDENCY_ID); |
| 3184 | 3185 | pCtx->bNeedPrefixNalFlag = (bAvcBased && |
| 3185 | 3186 | (pSvcParam->bPrefixNalAddingCtrl || |
| 3186 | − (pSvcParam->iNumDependencyLayer > 1))); | |
| 3187 | + (pSvcParam->iSpatialLayerNum > 1))); | |
| 3187 | 3188 | |
| 3188 | 3189 | if (eFrameType == WELS_FRAME_TYPE_P) { |
| 3189 | 3190 | 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 | ||
| 3229 | 3230 | PreprocessSliceCoding (pCtx); // MUST be called after pfWelsRcPictureInit() and WelsInitCurrentLayer() |
| 3230 | 3231 | |
| 3231 | 3232 | 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 | |
| 3233 | 3234 | int32_t iSliceSize = 0; |
| 3234 | 3235 | |
| 3235 | 3236 | if (pCtx->bNeedPrefixNalFlag) { |
| @@ -3258,9 +3259,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 22 unmodified lines | ||
| 3258 | 3259 | } |
| 3259 | 3260 | // for dynamic slicing single threading.. |
| 3260 | 3261 | #ifndef MT_ENABLED |
| 3261 | − else if (SM_DYN_SLICE == param_d->sMso.uiSliceMode) | |
| 3262 | + else if (SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode) | |
| 3262 | 3263 | #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)) | |
| 3264 | 3265 | #endif//MT_ENABLED |
| 3265 | 3266 | { |
| 3266 | 3267 | const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->pSliceEncCtx->iMbNumInFrame; |
| @@ -3270,7 +3271,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 3 unmodified lines | ||
| 3270 | 3271 | #if defined(MT_ENABLED) |
| 3271 | 3272 | int err = 0; |
| 3272 | 3273 | // 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)) { | |
| 3274 | 3275 | iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx); |
| 3275 | 3276 | if (iLayerNum + |
| 3276 | 3277 | #if defined(PACKING_ONE_SLICE_PER_LAYER) |
| @@ -3281,7 +3282,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 4 unmodified lines | ||
| 3281 | 3282 | >= MAX_LAYER_NUM_OF_FRAME) { // check available layer_bs_info for further writing as followed |
| 3282 | 3283 | WelsLog (pCtx, WELS_LOG_ERROR, |
| 3283 | 3284 | "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); | |
| 3285 | 3286 | return -1; |
| 3286 | 3287 | } |
| 3287 | 3288 | if (iSliceCount <= 1) { |
| @@ -3311,7 +3312,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 23 unmodified lines | ||
| 3311 | 3312 | if (err) { |
| 3312 | 3313 | WelsLog (pCtx, WELS_LOG_ERROR, |
| 3313 | 3314 | "[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); | |
| 3315 | 3316 | return -1; |
| 3316 | 3317 | } |
| 3317 | 3318 | |
| @@ -3370,7 +3371,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 52 unmodified lines | ||
| 3370 | 3371 | if (err) { |
| 3371 | 3372 | WelsLog (pCtx, WELS_LOG_ERROR, |
| 3372 | 3373 | "[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); | |
| 3374 | 3375 | return -1; |
| 3375 | 3376 | } |
| 3376 | 3377 | |
| @@ -3447,7 +3448,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 70 unmodified lines | ||
| 3447 | 3448 | } |
| 3448 | 3449 | } |
| 3449 | 3450 | // 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)) { | |
| 3451 | 3452 | const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum; //pSvcParam->iCountThreadsNum; |
| 3452 | 3453 | #if defined(PACKING_ONE_SLICE_PER_LAYER) |
| 3453 | 3454 | ResetCountBsSizeInPartitions (pCtx->pSliceThreading->pCountBsSizeInPartition, kiPartitionCnt); |
| @@ -3462,7 +3463,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 8 unmodified lines | ||
| 3462 | 3463 | if (err) { |
| 3463 | 3464 | WelsLog (pCtx, WELS_LOG_ERROR, |
| 3464 | 3465 | "[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); | |
| 3466 | 3467 | return -1; |
| 3467 | 3468 | } |
| 3468 | 3469 | |
| @@ -3552,7 +3553,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 83 unmodified lines | ||
| 3552 | 3553 | |
| 3553 | 3554 | #ifdef ENABLE_FRAME_DUMP |
| 3554 | 3555 | // Dump reconstruction picture for each sQualityStat layer |
| 3555 | − if (iCurDid + 1 < pSvcParam->iNumDependencyLayer) | |
| 3556 | + if (iCurDid + 1 < pSvcParam->iSpatialLayerNum) | |
| 3556 | 3557 | DumpDependencyRec (fsnr, ¶m_d->sRecFileName[0], iCurDid); |
| 3557 | 3558 | #endif//ENABLE_FRAME_DUMP |
| 3558 | 3559 | |
| @@ -3634,7 +3635,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 75 unmodified lines | ||
| 3634 | 3635 | #endif//STAT_OUTPUT |
| 3635 | 3636 | |
| 3636 | 3637 | #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 | |
| 3638 | 3639 | #else |
| 3639 | 3640 | if (1) |
| 3640 | 3641 | #endif//MT_ENABLED && PACKING_ONE_SLICE_PER_LAYER |
| @@ -3673,8 +3674,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 32 unmodified lines | ||
| 3673 | 3674 | } |
| 3674 | 3675 | |
| 3675 | 3676 | #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) { | |
| 3678 | 3679 | CalcSliceComplexRatio (pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], pCtx->pCurDqLayer->pSliceEncCtx, |
| 3679 | 3680 | pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]); |
| 3680 | 3681 | #if defined(MT_DEBUG) |
| @@ -3685,7 +3686,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 4 unmodified lines | ||
| 3685 | 3686 | |
| 3686 | 3687 | ++ iSpatialIdx; |
| 3687 | 3688 | |
| 3688 | − if (iCurDid + 1 < pSvcParam->iNumDependencyLayer) { | |
| 3689 | + if (iCurDid + 1 < pSvcParam->iSpatialLayerNum) { | |
| 3689 | 3690 | WelsSwapDqLayers (pCtx); |
| 3690 | 3691 | } |
| 3691 | 3692 | |
| @@ -3711,17 +3712,17 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 19 unmodified lines | ||
| 3711 | 3712 | |
| 3712 | 3713 | #if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN) |
| 3713 | 3714 | 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 | |
| 3717 | 3718 | && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[did_list[iSpatialNum - |
| 3718 | − 1]].sMso.sSliceArgument.iSliceNum) { | |
| 3719 | + 1]].sSliceCfg.sSliceArgument.uiSliceNum) { | |
| 3719 | 3720 | AdjustBaseLayer (pCtx); |
| 3720 | 3721 | } |
| 3721 | 3722 | #endif//DYNAMIC_SLICE_ASSIGN |
| 3722 | 3723 | |
| 3723 | 3724 | #ifdef ENABLE_FRAME_DUMP |
| 3724 | − DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iNumDependencyLayer - | |
| 3725 | + DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iSpatialLayerNum - | |
| 3725 | 3726 | 1].sRecFileName[0]); // pDecPic: final reconstruction output |
| 3726 | 3727 | #endif//ENABLE_FRAME_DUMP |
| 3727 | 3728 | |
| @@ -3757,18 +3758,18 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 29 unmodified lines | ||
| 3757 | 3758 | /* Decide whether need reset for IDR frame based on adjusting prarameters changed */ |
| 3758 | 3759 | /* Temporal levels, spatial settings and/ or quality settings changed need update parameter sets related. */ |
| 3759 | 3760 | bNeedReset = (pOldParam == NULL) || |
| 3760 | − (pOldParam->iNumTemporalLayer != pNewParam->iNumTemporalLayer) || | |
| 3761 | + (pOldParam->iTemporalLayerNum != pNewParam->iTemporalLayerNum) || | |
| 3761 | 3762 | (pOldParam->uiGopSize != pNewParam->uiGopSize) || |
| 3762 | − (pOldParam->iNumDependencyLayer != pNewParam->iNumDependencyLayer) || | |
| 3763 | + (pOldParam->iSpatialLayerNum != pNewParam->iSpatialLayerNum) || | |
| 3763 | 3764 | (pOldParam->iDecompStages != pNewParam->iDecompStages) || |
| 3764 | − (pOldParam->iActualPicWidth != pNewParam->iActualPicWidth | |
| 3765 | − || pOldParam->iActualPicHeight != pNewParam->iActualPicHeight) || | |
| 3765 | + (pOldParam->iPicWidth != pNewParam->iPicWidth | |
| 3766 | + || pOldParam->iPicHeight != pNewParam->iPicHeight) || | |
| 3766 | 3767 | (pOldParam->SUsedPicRect.iWidth != pNewParam->SUsedPicRect.iWidth |
| 3767 | 3768 | || pOldParam->SUsedPicRect.iHeight != pNewParam->SUsedPicRect.iHeight) || |
| 3768 | 3769 | (pOldParam->bEnableLongTermReference != pNewParam->bEnableLongTermReference); |
| 3769 | 3770 | if (!bNeedReset) { // Check its picture resolutions/quality settings respectively in each dependency layer |
| 3770 | 3771 | iIndexD = 0; |
| 3771 | − assert (pOldParam->iNumDependencyLayer == pNewParam->iNumDependencyLayer); | |
| 3772 | + assert (pOldParam->iSpatialLayerNum == pNewParam->iSpatialLayerNum); | |
| 3772 | 3773 | do { |
| 3773 | 3774 | const SDLayerParam* kpOldDlp = &pOldParam->sDependencyLayers[iIndexD]; |
| 3774 | 3775 | const SDLayerParam* kpNewDlp = &pNewParam->sDependencyLayers[iIndexD]; |
| @@ -3784,8 +3785,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 9 unmodified lines | ||
| 3784 | 3785 | break; |
| 3785 | 3786 | } |
| 3786 | 3787 | |
| 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) { | |
| 3789 | 3790 | bNeedReset = true; |
| 3790 | 3791 | break; |
| 3791 | 3792 | } |
| @@ -3808,7 +3809,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 16 unmodified lines | ||
| 3808 | 3809 | } |
| 3809 | 3810 | |
| 3810 | 3811 | ++ iIndexD; |
| 3811 | − } while (iIndexD < pOldParam->iNumDependencyLayer); | |
| 3812 | + } while (iIndexD < pOldParam->iSpatialLayerNum); | |
| 3812 | 3813 | } |
| 3813 | 3814 | |
| 3814 | 3815 | if (bNeedReset) { |
| @@ -3863,7 +3864,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 48 unmodified lines | ||
| 3863 | 3864 | |
| 3864 | 3865 | /* int32_t term reference control */ |
| 3865 | 3866 | pOldParam->bEnableLongTermReference = pNewParam->bEnableLongTermReference; |
| 3866 | − pOldParam->uiLtrMarkPeriod = pNewParam->uiLtrMarkPeriod; | |
| 3867 | + pOldParam->iLtrMarkPeriod = pNewParam->iLtrMarkPeriod; | |
| 3867 | 3868 | |
| 3868 | 3869 | // keep below values unchanged as before |
| 3869 | 3870 | pOldParam->bEnableSSEI = pNewParam->bEnableSSEI; |
| @@ -3911,7 +3912,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 41 unmodified lines | ||
| 3911 | 3912 | sizeof (pOldDlp->uiCodingIdx2TemporalId)); // confirmed_safe_unsafe_usage |
| 3912 | 3913 | |
| 3913 | 3914 | ++ iIndexD; |
| 3914 | − } while (iIndexD < pOldParam->iNumDependencyLayer); | |
| 3915 | + } while (iIndexD < pOldParam->iSpatialLayerNum); | |
| 3915 | 3916 | } |
| 3916 | 3917 | |
| 3917 | 3918 | /* Any else initialization/reset for rate control here? */ |