Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 26 files). Show all
Unified · Split
| @@ -411,14 +411,14 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 410 unmodified lines | |||
| 411 | return ENC_RETURN_UNSUPPORTED_PARA; | 411 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | if (pSpatialLayer->sSliceCfg.uiSliceMode >= SM_RESERVED) { | 414 | if (pSpatialLayer->sSliceArgument.uiSliceMode >= SM_RESERVED) { |
| 415 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!", | 415 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!", |
| 416 | pSpatialLayer->sSliceCfg.uiSliceMode); | 416 | pSpatialLayer->sSliceArgument.uiSliceMode); |
| 417 | return ENC_RETURN_UNSUPPORTED_PARA; | 417 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 418 | } | 418 | } |
| 419 | if ((pCodingParam->uiMaxNalSize != 0) && (pSpatialLayer->sSliceCfg.uiSliceMode != SM_DYN_SLICE)) { | 419 | if ((pCodingParam->uiMaxNalSize != 0) && (pSpatialLayer->sSliceArgument.uiSliceMode != SM_SIZELIMITED_SLICE)) { |
| 420 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!,MaxNalSize = %d", | 420 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!,MaxNalSize = %d", |
| 421 | pSpatialLayer->sSliceCfg.uiSliceMode, pCodingParam->uiMaxNalSize); | 421 | pSpatialLayer->sSliceArgument.uiSliceMode, pCodingParam->uiMaxNalSize); |
| 422 | return ENC_RETURN_UNSUPPORTED_PARA; | 422 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 423 | } | 423 | } |
| 424 | CheckProfileSetting (pLogCtx, pCodingParam, i, pSpatialLayer->uiProfileIdc); | 424 | CheckProfileSetting (pLogCtx, pCodingParam, i, pSpatialLayer->uiProfileIdc); |
| @@ -426,144 +426,142 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 1 unmodified line | |||
| 426 | //check pSlice settings under multi-pSlice | 426 | //check pSlice settings under multi-pSlice |
| 427 | if (kiPicWidth <= 16 && kiPicHeight <= 16) { | 427 | if (kiPicWidth <= 16 && kiPicHeight <= 16) { |
| 428 | //only have one MB, set to single_slice | 428 | //only have one MB, set to single_slice |
| 429 | pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | 429 | pSpatialLayer->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; |
| 430 | } | 430 | } |
| 431 | switch (pSpatialLayer->sSliceCfg.uiSliceMode) { | 431 | switch (pSpatialLayer->sSliceArgument.uiSliceMode) { |
| 432 | case SM_SINGLE_SLICE: | 432 | case SM_SINGLE_SLICE: |
| 433 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = 1; | 433 | pSpatialLayer->sSliceArgument.uiSliceNum = 1; |
| 434 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | 434 | pSpatialLayer->sSliceArgument.uiSliceSizeConstraint = 0; |
| 435 | for (iIdx = 0; iIdx < MAX_SLICES_NUM; iIdx++) { | 435 | for (iIdx = 0; iIdx < MAX_SLICES_NUM; iIdx++) { |
| 436 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[iIdx] = 0; | 436 | pSpatialLayer->sSliceArgument.uiSliceMbNum[iIdx] = 0; |
| 437 | } | 437 | } |
| 438 | break; | 438 | break; |
| 439 | case SM_FIXEDSLCNUM_SLICE: { | 439 | case SM_FIXEDSLCNUM_SLICE: { |
| 440 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | 440 | pSpatialLayer->sSliceArgument.uiSliceSizeConstraint = 0; |
| 441 | 441 | ||
| 442 | iMbWidth = (kiPicWidth + 15) >> 4; | 442 | iMbWidth = (kiPicWidth + 15) >> 4; |
| 443 | iMbHeight = (kiPicHeight + 15) >> 4; | 443 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 444 | iMbNumInFrame = iMbWidth * iMbHeight; | 444 | iMbNumInFrame = iMbWidth * iMbHeight; |
| 445 | iMaxSliceNum = MAX_SLICES_NUM; | 445 | iMaxSliceNum = MAX_SLICES_NUM; |
| 446 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0 | 446 | if (pSpatialLayer->sSliceArgument.uiSliceNum == 0) { |
| 447 | || pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) { | 447 | int32_t uiCpuCores = 0; |
| 448 | WelsCPUFeatureDetect (&uiCpuCores); // detect cpu capacity features | ||
| 449 | pSpatialLayer->sSliceArgument.uiSliceNum = uiCpuCores; | ||
| 450 | |||
| 451 | if (uiCpuCores <= 1) { | ||
| 452 | WelsLog (pLogCtx, WELS_LOG_INFO, "ParamValidationExt(), uiCpuCores = 1, switched to SM_SINGLE_SLICE"); | ||
| 453 | pSpatialLayer->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; | ||
| 454 | pSpatialLayer->sSliceArgument.uiSliceNum = 1; | ||
| 455 | pSpatialLayer->sSliceArgument.uiSliceSizeConstraint = 0; | ||
| 456 | for (iIdx = 0; iIdx < MAX_SLICES_NUM; iIdx++) { | ||
| 457 | pSpatialLayer->sSliceArgument.uiSliceMbNum[iIdx] = 0; | ||
| 458 | } | ||
| 459 | break; | ||
| 460 | } | ||
| 461 | } | ||
| 462 | if (pSpatialLayer->sSliceArgument.uiSliceNum > iMaxSliceNum) { | ||
| 448 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings!", | 463 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings!", |
| 449 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum); | 464 | pSpatialLayer->sSliceArgument.uiSliceNum); |
| 450 | return ENC_RETURN_UNSUPPORTED_PARA; | 465 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 451 | } | 466 | } |
| 452 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum == 1) { | 467 | if (pSpatialLayer->sSliceArgument.uiSliceNum == 1) { |
| 453 | WelsLog (pLogCtx, WELS_LOG_DEBUG, | 468 | WelsLog (pLogCtx, WELS_LOG_DEBUG, |
| 454 | "ParamValidationExt(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type!", | 469 | "ParamValidationExt(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type!", |
| 455 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum); | 470 | pSpatialLayer->sSliceArgument.uiSliceNum); |
| 456 | pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | 471 | pSpatialLayer->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; |
| 457 | break; | 472 | break; |
| 458 | } | 473 | } |
| 459 | if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom | 474 | if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom |
| 460 | //check uiSliceNum and set uiSliceMbNum with current uiSliceNum | 475 | //check uiSliceNum and set uiSliceMbNum with current uiSliceNum |
| 461 | if (!GomValidCheckSliceNum (iMbWidth, iMbHeight, &pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum)) { | 476 | if (!GomValidCheckSliceNum (iMbWidth, iMbHeight, &pSpatialLayer->sSliceArgument.uiSliceNum)) { |
| 462 | WelsLog (pLogCtx, WELS_LOG_WARNING, | 477 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 463 | "ParamValidationExt(), unsupported setting with Resolution and uiSliceNum combination under RC on! So uiSliceNum is changed to %d!", | 478 | "ParamValidationExt(), unsupported setting with Resolution and uiSliceNum combination under RC on! So uiSliceNum is changed to %d!", |
| 464 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum); | 479 | pSpatialLayer->sSliceArgument.uiSliceNum); |
| 465 | } | 480 | } |
| 466 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 1 || | 481 | if (pSpatialLayer->sSliceArgument.uiSliceNum <= 1 || |
| 467 | !GomValidCheckSliceMbNum (iMbWidth, iMbHeight, &pSpatialLayer->sSliceCfg.sSliceArgument)) { | 482 | !GomValidCheckSliceMbNum (iMbWidth, iMbHeight, &pSpatialLayer->sSliceArgument)) { |
| 468 | WelsLog (pLogCtx, WELS_LOG_ERROR, | 483 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| 469 | "ParamValidationExt(), unsupported setting with Resolution and uiSliceNum (%d) combination under RC on! Consider setting single slice with this resolution!", | 484 | "ParamValidationExt(), unsupported setting with Resolution and uiSliceNum (%d) combination under RC on! Consider setting single slice with this resolution!", |
| 470 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum); | 485 | pSpatialLayer->sSliceArgument.uiSliceNum); |
| 471 | return ENC_RETURN_UNSUPPORTED_PARA; | 486 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 472 | } | 487 | } |
| 473 | assert (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > 1); | 488 | assert (pSpatialLayer->sSliceArgument.uiSliceNum > 1); |
| 474 | } else if (!CheckFixedSliceNumMultiSliceSetting (iMbNumInFrame, | 489 | } else if (!CheckFixedSliceNumMultiSliceSetting (iMbNumInFrame, |
| 475 | &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings | 490 | &pSpatialLayer->sSliceArgument)) { // verify interleave mode settings |
| 476 | //check uiSliceMbNum with current uiSliceNum | 491 | //check uiSliceMbNum with current uiSliceNum |
| 477 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!", | 492 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!", |
| 478 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | 493 | pSpatialLayer->sSliceArgument.uiSliceMbNum[0]); |
| 479 | return ENC_RETURN_UNSUPPORTED_PARA; | 494 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 480 | } | 495 | } |
| 481 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting | 496 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting |
| 482 | if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) { | 497 | if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) { |
| 483 | pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | 498 | pSpatialLayer->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; |
| 484 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = 1; | 499 | pSpatialLayer->sSliceArgument.uiSliceNum = 1; |
| 485 | break; | 500 | break; |
| 486 | } | 501 | } |
| 487 | } | 502 | } |
| 488 | break; | 503 | break; |
| 489 | case SM_AUTO_SLICE: { | ||
| 490 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | ||
| 491 | } | ||
| 492 | break; | ||
| 493 | case SM_RASTER_SLICE: { | 504 | case SM_RASTER_SLICE: { |
| 494 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | 505 | pSpatialLayer->sSliceArgument.uiSliceSizeConstraint = 0; |
| 495 | 506 | ||
| 496 | iMbWidth = (kiPicWidth + 15) >> 4; | 507 | iMbWidth = (kiPicWidth + 15) >> 4; |
| 497 | iMbHeight = (kiPicHeight + 15) >> 4; | 508 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 498 | iMbNumInFrame = iMbWidth * iMbHeight; | 509 | iMbNumInFrame = iMbWidth * iMbHeight; |
| 499 | iMaxSliceNum = MAX_SLICES_NUM; | 510 | iMaxSliceNum = MAX_SLICES_NUM; |
| 500 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0] <= 0) { | 511 | if (pSpatialLayer->sSliceArgument.uiSliceMbNum[0] == 0) { |
| 501 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!", | 512 | if (iMbHeight > iMaxSliceNum) { |
| 502 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | 513 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX(%d)!", |
| 503 | return ENC_RETURN_UNSUPPORTED_PARA; | 514 | iMbHeight, MAX_SLICES_NUM); |
| 515 | return ENC_RETURN_UNSUPPORTED_PARA; | ||
| 516 | } | ||
| 517 | pSpatialLayer->sSliceArgument.uiSliceNum = iMbHeight; | ||
| 518 | for (uint32_t j=0; j<iMbHeight; j++) { | ||
| 519 | pSpatialLayer->sSliceArgument.uiSliceMbNum[j] = iMbWidth; | ||
| 520 | } | ||
| 521 | if (!CheckRowMbMultiSliceSetting (iMbWidth, | ||
| 522 | &pSpatialLayer->sSliceArgument)) { // verify interleave mode settings | ||
| 523 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!", | ||
| 524 | pSpatialLayer->sSliceArgument.uiSliceMbNum[0]); | ||
| 525 | return ENC_RETURN_UNSUPPORTED_PARA; | ||
| 526 | } | ||
| 527 | break; | ||
| 504 | } | 528 | } |
| 505 | 529 | ||
| 506 | if (!CheckRasterMultiSliceSetting (iMbNumInFrame, | 530 | if (!CheckRasterMultiSliceSetting (iMbNumInFrame, |
| 507 | &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings | 531 | &pSpatialLayer->sSliceArgument)) { // verify interleave mode settings |
| 508 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!", | 532 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!", |
| 509 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | 533 | pSpatialLayer->sSliceArgument.uiSliceMbNum[0]); |
| 510 | return ENC_RETURN_UNSUPPORTED_PARA; | 534 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 511 | } | 535 | } |
| 512 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0 | 536 | if (pSpatialLayer->sSliceArgument.uiSliceNum <= 0 |
| 513 | || pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) { // verify interleave mode settings | 537 | || pSpatialLayer->sSliceArgument.uiSliceNum > iMaxSliceNum) { // verify interleave mode settings |
| 514 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!", | 538 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!", |
| 515 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum); | 539 | pSpatialLayer->sSliceArgument.uiSliceNum); |
| 516 | return ENC_RETURN_UNSUPPORTED_PARA; | 540 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 517 | } | 541 | } |
| 518 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum == 1) { | 542 | if (pSpatialLayer->sSliceArgument.uiSliceNum == 1) { |
| 519 | WelsLog (pLogCtx, WELS_LOG_WARNING, | 543 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 520 | "ParamValidationExt(), pSlice setting for SM_RASTER_SLICE now turn to SM_SINGLE_SLICE!"); | 544 | "ParamValidationExt(), pSlice setting for SM_RASTER_SLICE now turn to SM_SINGLE_SLICE!"); |
| 521 | pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | 545 | pSpatialLayer->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; |
| 522 | break; | 546 | break; |
| 523 | } | 547 | } |
| 524 | if ((pCodingParam->iRCMode != RC_OFF_MODE) && pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > 1) { | 548 | if ((pCodingParam->iRCMode != RC_OFF_MODE) && pSpatialLayer->sSliceArgument.uiSliceNum > 1) { |
| 525 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!"); | 549 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!"); |
| 526 | } | 550 | } |
| 527 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting | 551 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting |
| 528 | if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) { | 552 | if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) { |
| 529 | pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | 553 | pSpatialLayer->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; |
| 530 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = 1; | 554 | pSpatialLayer->sSliceArgument.uiSliceNum = 1; |
| 531 | break; | 555 | break; |
| 532 | } | 556 | } |
| 533 | } | 557 | } |
| 534 | break; | 558 | break; |
| 535 | case SM_ROWMB_SLICE: { | 559 | case SM_SIZELIMITED_SLICE: { |
| 536 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 0; | ||
| 537 | |||
| 538 | iMbWidth = (kiPicWidth + 15) >> 4; | 560 | iMbWidth = (kiPicWidth + 15) >> 4; |
| 539 | iMbHeight = (kiPicHeight + 15) >> 4; | 561 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 540 | iMaxSliceNum = MAX_SLICES_NUM; | 562 | if (pSpatialLayer->sSliceArgument.uiSliceSizeConstraint <= 0) { |
| 541 | if (iMbHeight > iMaxSliceNum) { | ||
| 542 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX(%d)!", | ||
| 543 | iMbHeight, MAX_SLICES_NUM); | ||
| 544 | return ENC_RETURN_UNSUPPORTED_PARA; | ||
| 545 | } | ||
| 546 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = iMbHeight; | ||
| 547 | |||
| 548 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0) { | ||
| 549 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings!", | ||
| 550 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum); | ||
| 551 | return ENC_RETURN_UNSUPPORTED_PARA; | ||
| 552 | } | ||
| 553 | if (!CheckRowMbMultiSliceSetting (iMbWidth, | ||
| 554 | &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings | ||
| 555 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!", | ||
| 556 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | ||
| 557 | return ENC_RETURN_UNSUPPORTED_PARA; | ||
| 558 | } | ||
| 559 | } | ||
| 560 | break; | ||
| 561 | case SM_DYN_SLICE: { | ||
| 562 | iMbWidth = (kiPicWidth + 15) >> 4; | ||
| 563 | iMbHeight = (kiPicHeight + 15) >> 4; | ||
| 564 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint <= 0) { | ||
| 565 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid iSliceSize (%d) settings!", | 563 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid iSliceSize (%d) settings!", |
| 566 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint); | 564 | pSpatialLayer->sSliceArgument.uiSliceSizeConstraint); |
| 567 | return ENC_RETURN_UNSUPPORTED_PARA; | 565 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 568 | } | 566 | } |
| 569 | 567 | ||
| @@ -574,19 +572,19 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 4 unmodified lines | |||
| 574 | return ENC_RETURN_UNSUPPORTED_PARA; | 572 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 575 | } | 573 | } |
| 576 | 574 | ||
| 577 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint > (pCodingParam->uiMaxNalSize - | 575 | if (pSpatialLayer->sSliceArgument.uiSliceSizeConstraint > (pCodingParam->uiMaxNalSize - |
| 578 | NAL_HEADER_ADD_0X30BYTES)) { | 576 | NAL_HEADER_ADD_0X30BYTES)) { |
| 579 | WelsLog (pLogCtx, WELS_LOG_WARNING, | 577 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 580 | "ParamValidationExt(), slice mode = SM_DYN_SLICE, uiSliceSizeConstraint = %d ,uiMaxNalsize = %d, will take uiMaxNalsize!", | 578 | "ParamValidationExt(), slice mode = SM_SIZELIMITED_SLICE, uiSliceSizeConstraint = %d ,uiMaxNalsize = %d, will take uiMaxNalsize!", |
| 581 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint, pCodingParam->uiMaxNalSize); | 579 | pSpatialLayer->sSliceArgument.uiSliceSizeConstraint, pCodingParam->uiMaxNalSize); |
| 582 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = pCodingParam->uiMaxNalSize - NAL_HEADER_ADD_0X30BYTES; | 580 | pSpatialLayer->sSliceArgument.uiSliceSizeConstraint = pCodingParam->uiMaxNalSize - NAL_HEADER_ADD_0X30BYTES; |
| 583 | } | 581 | } |
| 584 | 582 | ||
| 585 | } | 583 | } |
| 586 | break; | 584 | break; |
| 587 | default: { | 585 | default: { |
| 588 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!", | 586 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!", |
| 589 | pCodingParam->sSpatialLayers[0].sSliceCfg.uiSliceMode); | 587 | pCodingParam->sSpatialLayers[0].sSliceArgument.uiSliceMode); |
| 590 | return ENC_RETURN_UNSUPPORTED_PARA; | 588 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 591 | 589 | ||
| 592 | } | 590 | } |
| @@ -696,7 +694,7 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 103 unmodified lines | |||
| 696 | //Review this part and suggest no change, since the memory over-use | 694 | //Review this part and suggest no change, since the memory over-use |
| 697 | //(1) counts little to the overall performance | 695 | //(1) counts little to the overall performance |
| 698 | //(2) should not be critial even under mobile case | 696 | //(2) should not be critial even under mobile case |
| 699 | if (SM_DYN_SLICE == pDLayer->sSliceCfg.uiSliceMode) { | 697 | if (SM_SIZELIMITED_SLICE == pDLayer->sSliceArgument.uiSliceMode) { |
| 700 | iCountNumNals += MAX_SLICES_NUM; | 698 | iCountNumNals += MAX_SLICES_NUM; |
| 701 | // plus prefix NALs | 699 | // plus prefix NALs |
| 702 | if (iDIndex == 0) | 700 | if (iDIndex == 0) |
| @@ -708,10 +706,10 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 5 unmodified lines | |||
| 708 | iCountNumNals, iOrgNumNals, iDIndex, MAX_NAL_UNITS_IN_LAYER); | 706 | iCountNumNals, iOrgNumNals, iDIndex, MAX_NAL_UNITS_IN_LAYER); |
| 709 | return 1; | 707 | return 1; |
| 710 | } | 708 | } |
| 711 | } else { /*if ( SM_SINGLE_SLICE != pDLayer->sSliceCfg.uiSliceMode )*/ | 709 | } else { /*if ( SM_SINGLE_SLICE != pDLayer->sSliceArgument.uiSliceMode )*/ |
| 712 | const int32_t kiNumOfSlice = GetInitialSliceNum ((pDLayer->iVideoWidth + 0x0f) >> 4, | 710 | const int32_t kiNumOfSlice = GetInitialSliceNum ((pDLayer->iVideoWidth + 0x0f) >> 4, |
| 713 | (pDLayer->iVideoHeight + 0x0f) >> 4, | 711 | (pDLayer->iVideoHeight + 0x0f) >> 4, |
| 714 | &pDLayer->sSliceCfg); | 712 | &pDLayer->sSliceArgument); |
| 715 | 713 | ||
| 716 | // NEED check iCountNals value in case multiple slices is used | 714 | // NEED check iCountNals value in case multiple slices is used |
| 717 | iCountNumNals += kiNumOfSlice; // for pSlice VCL NALs | 715 | iCountNumNals += kiNumOfSlice; // for pSlice VCL NALs |
| @@ -1159,7 +1157,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 441 unmodified lines | |||
| 1159 | const int32_t kiMbW = (pDlayer->iVideoWidth + 0x0f) >> 4; | 1157 | const int32_t kiMbW = (pDlayer->iVideoWidth + 0x0f) >> 4; |
| 1160 | const int32_t kiMbH = (pDlayer->iVideoHeight + 0x0f) >> 4; | 1158 | const int32_t kiMbH = (pDlayer->iVideoHeight + 0x0f) >> 4; |
| 1161 | int32_t iMaxSliceNum = 1; | 1159 | int32_t iMaxSliceNum = 1; |
| 1162 | const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sSliceCfg); | 1160 | const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sSliceArgument); |
| 1163 | if (iMaxSliceNum < kiSliceNum) | 1161 | if (iMaxSliceNum < kiSliceNum) |
| 1164 | iMaxSliceNum = kiSliceNum; | 1162 | iMaxSliceNum = kiSliceNum; |
| 1165 | 1163 | ||
| @@ -1168,7 +1166,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 2 unmodified lines | |||
| 1168 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeMemorySvc (ppCtx)) | 1166 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeMemorySvc (ppCtx)) |
| 1169 | 1167 | ||
| 1170 | // for dynamic slicing mode | 1168 | // for dynamic slicing mode |
| 1171 | if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) { | 1169 | if (SM_SIZELIMITED_SLICE == pDlayer->sSliceArgument.uiSliceMode) { |
| 1172 | const int32_t iSize = pParam->iCountThreadsNum * sizeof (int32_t); | 1170 | const int32_t iSize = pParam->iCountThreadsNum * sizeof (int32_t); |
| 1173 | 1171 | ||
| 1174 | pDqLayer->pNumSliceCodedOfPartition = (int32_t*)pMa->WelsMallocz (iSize, "pNumSliceCodedOfPartition"); | 1172 | pDqLayer->pNumSliceCodedOfPartition = (int32_t*)pMa->WelsMallocz (iSize, "pNumSliceCodedOfPartition"); |
| @@ -1201,7 +1199,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 26 unmodified lines | |||
| 1201 | pDqLayer->bDeblockingParallelFlag = pParam->bDeblockingParallelFlag; | 1199 | pDqLayer->bDeblockingParallelFlag = pParam->bDeblockingParallelFlag; |
| 1202 | 1200 | ||
| 1203 | //deblocking parameter adjustment | 1201 | //deblocking parameter adjustment |
| 1204 | if (SM_SINGLE_SLICE == pDlayer->sSliceCfg.uiSliceMode) { | 1202 | if (SM_SINGLE_SLICE == pDlayer->sSliceArgument.uiSliceMode) { |
| 1205 | //iLoopFilterDisableIdc: will be 0 or 1 under single_slice | 1203 | //iLoopFilterDisableIdc: will be 0 or 1 under single_slice |
| 1206 | if (2 == pParam->iLoopFilterDisableIdc) { | 1204 | if (2 == pParam->iLoopFilterDisableIdc) { |
| 1207 | pDqLayer->iLoopFilterDisableIdc = 0; | 1205 | pDqLayer->iLoopFilterDisableIdc = 0; |
| @@ -1368,7 +1366,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 160 unmodified lines | |||
| 1368 | false, | 1366 | false, |
| 1369 | pSps->iMbWidth, | 1367 | pSps->iMbWidth, |
| 1370 | pSps->iMbHeight, | 1368 | pSps->iMbHeight, |
| 1371 | & (pDlayerParam->sSliceCfg), | 1369 | & (pDlayerParam->sSliceArgument), |
| 1372 | pPps); | 1370 | pPps); |
| 1373 | if (iResult) { | 1371 | if (iResult) { |
| 1374 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "InitDqLayers(), InitSlicePEncCtx failed(%d)!", iResult); | 1372 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "InitDqLayers(), InitSlicePEncCtx failed(%d)!", iResult); |
| @@ -1776,16 +1774,16 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 401 unmodified lines | |||
| 1776 | iLayerBsSize = WELS_ALIGN (iLayerBsSize, 4); // 4 bytes alinged | 1774 | iLayerBsSize = WELS_ALIGN (iLayerBsSize, 4); // 4 bytes alinged |
| 1777 | iVclLayersBsSizeCount += iLayerBsSize; | 1775 | iVclLayersBsSizeCount += iLayerBsSize; |
| 1778 | 1776 | ||
| 1779 | SSliceConfig* pMso = & (fDlp->sSliceCfg); | 1777 | SSliceArgument* pSliceArgument = & (fDlp->sSliceArgument); |
| 1780 | if (pMso->uiSliceMode == SM_DYN_SLICE) { | 1778 | if (pSliceArgument->uiSliceMode == SM_SIZELIMITED_SLICE) { |
| 1781 | bDynamicSlice = true; | 1779 | bDynamicSlice = true; |
| 1782 | uiMaxSliceNumEstimation = WELS_MIN (AVERSLICENUM_CONSTRAINT, | 1780 | uiMaxSliceNumEstimation = WELS_MIN (AVERSLICENUM_CONSTRAINT, |
| 1783 | (iLayerBsSize / pMso->sSliceArgument.uiSliceSizeConstraint) + 1); | 1781 | (iLayerBsSize / pSliceArgument->uiSliceSizeConstraint) + 1); |
| 1784 | (*ppCtx)->iMaxSliceCount = WELS_MAX ((*ppCtx)->iMaxSliceCount, (int) uiMaxSliceNumEstimation); | 1782 | (*ppCtx)->iMaxSliceCount = WELS_MAX ((*ppCtx)->iMaxSliceCount, (int) uiMaxSliceNumEstimation); |
| 1785 | iSliceBufferSize = (WELS_MAX(pMso->sSliceArgument.uiSliceSizeConstraint, iLayerBsSize/uiMaxSliceNumEstimation)<<1) + MAX_MACROBLOCK_SIZE_IN_BYTE_x2; | 1783 | iSliceBufferSize = (WELS_MAX(pSliceArgument->uiSliceSizeConstraint, iLayerBsSize/uiMaxSliceNumEstimation)<<1) + MAX_MACROBLOCK_SIZE_IN_BYTE_x2; |
| 1786 | } else { | 1784 | } else { |
| 1787 | (*ppCtx)->iMaxSliceCount = WELS_MAX ((*ppCtx)->iMaxSliceCount, (int) pMso->sSliceArgument.uiSliceNum); | 1785 | (*ppCtx)->iMaxSliceCount = WELS_MAX ((*ppCtx)->iMaxSliceCount, (int) pSliceArgument->uiSliceNum); |
| 1788 | iSliceBufferSize = ((iLayerBsSize / pMso->sSliceArgument.uiSliceNum)<<1) + MAX_MACROBLOCK_SIZE_IN_BYTE_x2; | 1786 | iSliceBufferSize = ((iLayerBsSize / pSliceArgument->uiSliceNum)<<1) + MAX_MACROBLOCK_SIZE_IN_BYTE_x2; |
| 1789 | } | 1787 | } |
| 1790 | iMaxSliceBufferSize = WELS_MAX(iMaxSliceBufferSize, iSliceBufferSize); | 1788 | iMaxSliceBufferSize = WELS_MAX(iMaxSliceBufferSize, iSliceBufferSize); |
| 1791 | 1789 | ||
| @@ -2090,14 +2088,14 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 298 unmodified lines | |||
| 2090 | SDqLayer* pDq = pCtx->ppDqLayerList[ilayer]; | 2088 | SDqLayer* pDq = pCtx->ppDqLayerList[ilayer]; |
| 2091 | SSpatialLayerConfig* pDlp = &pCtx->pSvcParam->sSpatialLayers[ilayer]; | 2089 | SSpatialLayerConfig* pDlp = &pCtx->pSvcParam->sSpatialLayers[ilayer]; |
| 2092 | 2090 | ||
| 2093 | const bool kbIsDynamicSlicing = (SM_DYN_SLICE == pDlp->sSliceCfg.uiSliceMode); | 2091 | const bool kbIsDynamicSlicing = (SM_SIZELIMITED_SLICE == pDlp->sSliceArgument.uiSliceMode); |
| 2094 | 2092 | ||
| 2095 | // pDq layers | 2093 | // pDq layers |
| 2096 | if (NULL != pDq) { | 2094 | if (NULL != pDq) { |
| 2097 | if (NULL != pDq->sLayerInfo.pSliceInLayer) { | 2095 | if (NULL != pDq->sLayerInfo.pSliceInLayer) { |
| 2098 | int32_t iSliceIdx = 0; | 2096 | int32_t iSliceIdx = 0; |
| 2099 | int32_t iSliceNum = GetInitialSliceNum (pDq->iMbWidth, pDq->iMbHeight, &pDlp->sSliceCfg); | 2097 | int32_t iSliceNum = GetInitialSliceNum (pDq->iMbWidth, pDq->iMbHeight, &pDlp->sSliceArgument); |
| 2100 | if (pDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE && pCtx->iActiveThreadsNum == 1) { | 2098 | if (pDlp->sSliceArgument.uiSliceMode == SM_SIZELIMITED_SLICE && pCtx->iActiveThreadsNum == 1) { |
| 2101 | if (iSliceNum < pDq->pSliceEncCtx->iMaxSliceNumConstraint) { | 2099 | if (iSliceNum < pDq->pSliceEncCtx->iMaxSliceNumConstraint) { |
| 2102 | iSliceNum = pDq->pSliceEncCtx->iMaxSliceNumConstraint; | 2100 | iSliceNum = pDq->pSliceEncCtx->iMaxSliceNumConstraint; |
| 2103 | } | 2101 | } |
| @@ -2248,29 +2246,93 @@ int32_t InitSliceSettings (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPar · 144 unmodified lines | |||
| 2248 | 2246 | ||
| 2249 | do { | 2247 | do { |
| 2250 | SSpatialLayerConfig* pDlp = &pCodingParam->sSpatialLayers[iSpatialIdx]; | 2248 | SSpatialLayerConfig* pDlp = &pCodingParam->sSpatialLayers[iSpatialIdx]; |
| 2251 | SSliceConfig* pMso = &pDlp->sSliceCfg; | 2249 | SSliceArgument* pSliceArgument = &pDlp->sSliceArgument; |
| 2252 | SSliceArgument* pSlcArg = &pMso->sSliceArgument; | ||
| 2253 | const int32_t kiMbWidth = (pDlp->iVideoWidth + 15) >> 4; | 2250 | const int32_t kiMbWidth = (pDlp->iVideoWidth + 15) >> 4; |
| 2254 | const int32_t kiMbHeight = (pDlp->iVideoHeight + 15) >> 4; | 2251 | const int32_t kiMbHeight = (pDlp->iVideoHeight + 15) >> 4; |
| 2255 | const int32_t kiMbNumInFrame = kiMbWidth * kiMbHeight; | 2252 | const int32_t kiMbNumInFrame = kiMbWidth * kiMbHeight; |
| 2256 | int32_t iSliceNum = (SM_AUTO_SLICE == pMso->uiSliceMode) ? kiCpuCores : pSlcArg->uiSliceNum; | 2253 | int32_t iSliceNum = (SM_FIXEDSLCNUM_SLICE == pSliceArgument->uiSliceMode && 0==pSliceArgument->uiSliceNum) ? kiCpuCores : pSliceArgument->uiSliceNum; |
| 2257 | // NOTE: Per design, in case MT/DYNAMIC_SLICE_ASSIGN enabled, for SM_FIXEDSLCNUM_SLICE mode, | 2254 | // NOTE: Per design, in case MT/DYNAMIC_SLICE_ASSIGN enabled, for SM_FIXEDSLCNUM_SLICE mode, |
| 2258 | // uiSliceNum of current spatial layer settings equals to uiCpuCores number; SM_DYN_SLICE mode, | 2255 | // uiSliceNum of current spatial layer settings equals to uiCpuCores number; SM_SIZELIMITED_SLICE mode, |
| 2259 | // uiSliceNum intials as uiCpuCores also, stay tuned dynamically slicing in future | 2256 | // uiSliceNum intials as uiCpuCores also, stay tuned dynamically slicing in future |
| 2260 | pSlcArg->uiSliceNum = iSliceNum; // used fixed one | 2257 | pSliceArgument->uiSliceNum = iSliceNum; // used fixed one |
| 2261 | 2258 | ||
| 2262 | switch (pMso->uiSliceMode) { | 2259 | switch (pSliceArgument->uiSliceMode) { |
| 2263 | case SM_DYN_SLICE: | 2260 | case SM_SIZELIMITED_SLICE: |
| 2264 | iMaxSliceCount = AVERSLICENUM_CONSTRAINT; | 2261 | iMaxSliceCount = AVERSLICENUM_CONSTRAINT; |
| 2265 | break; // go through for SM_DYN_SLICE? | 2262 | break; // go through for SM_SIZELIMITED_SLICE? |
| 2266 | case SM_FIXEDSLCNUM_SLICE: | 2263 | case SM_FIXEDSLCNUM_SLICE: |
| 2267 | if (iSliceNum > iMaxSliceCount) | 2264 | if (iSliceNum > iMaxSliceCount) { |
| 2268 | iMaxSliceCount = iSliceNum; | 2265 | iMaxSliceCount = iSliceNum; |
| 2266 | } | ||
| 2267 | if (0==iSliceNum) { | ||
| 2268 | //the auto slice num logic | ||
| 2269 | pDlp->sSliceArgument.uiSliceNum = kiCpuCores; | ||
| 2270 | |||
| 2271 | if (0==kiCpuCores){ | ||
| 2272 | int32_t uiCpuCores = 0; | ||
| 2273 | WelsCPUFeatureDetect (&uiCpuCores); // detect cpu capacity features | ||
| 2274 | pDlp->sSliceArgument.uiSliceNum = uiCpuCores; | ||
| 2275 | |||
| 2276 | if (uiCpuCores == 1) { | ||
| 2277 | WelsLog (pLogCtx, WELS_LOG_INFO, "InitSliceSettings(), uiCpuCores = 1, switched to SM_SINGLE_SLICE"); | ||
| 2278 | pDlp->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; | ||
| 2279 | pDlp->sSliceArgument.uiSliceNum = 1; | ||
| 2280 | pDlp->sSliceArgument.uiSliceSizeConstraint = 0; | ||
| 2281 | for (int32_t iIdx = 0; iIdx < MAX_SLICES_NUM; iIdx++) { | ||
| 2282 | pDlp->sSliceArgument.uiSliceMbNum[iIdx] = 0; | ||
| 2283 | } | ||
| 2284 | break; | ||
| 2285 | } | ||
| 2286 | } | ||
| 2287 | |||
| 2288 | if (pDlp->sSliceArgument.uiSliceNum == 1) { | ||
| 2289 | WelsLog (pLogCtx, WELS_LOG_DEBUG, | ||
| 2290 | "InitSliceSettings(), uiSliceNum(%d) you set for SM_AUTO_SLICE, now turn to SM_SINGLE_SLICE type!", | ||
| 2291 | pDlp->sSliceArgument.uiSliceNum); | ||
| 2292 | pDlp->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; | ||
| 2293 | break; | ||
| 2294 | } | ||
| 2295 | |||
| 2296 | if (pDlp->sSliceArgument.uiSliceNum > MAX_SLICES_NUM) { | ||
| 2297 | pDlp->sSliceArgument.uiSliceNum = MAX_SLICES_NUM; | ||
| 2298 | } | ||
| 2299 | iMaxSliceCount = WELS_MAX(iMaxSliceCount, pDlp->sSliceArgument.uiSliceNum); | ||
| 2300 | |||
| 2301 | if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom | ||
| 2302 | //check uiSliceNum and set uiSliceMbNum with current uiSliceNum | ||
| 2303 | if (!GomValidCheckSliceNum (kiMbWidth, kiMbHeight, &pDlp->sSliceArgument.uiSliceNum)) { | ||
| 2304 | WelsLog (pLogCtx, WELS_LOG_WARNING, | ||
| 2305 | "InitSliceSettings(), unsupported setting with Resolution and uiSliceNum combination under RC on! So uiSliceNum is changed to %d!", | ||
| 2306 | pDlp->sSliceArgument.uiSliceNum); | ||
| 2307 | } | ||
| 2308 | if (pDlp->sSliceArgument.uiSliceNum <= 1 || | ||
| 2309 | !GomValidCheckSliceMbNum (kiMbWidth, kiMbHeight, &pDlp->sSliceArgument)) { | ||
| 2310 | WelsLog (pLogCtx, WELS_LOG_ERROR, | ||
| 2311 | "InitSliceSettings(), unsupported setting with Resolution and uiSliceNum (%d) combination under RC on! Consider setting single slice with this resolution!", | ||
| 2312 | pDlp->sSliceArgument.uiSliceNum); | ||
| 2313 | return ENC_RETURN_INVALIDINPUT; | ||
| 2314 | } | ||
| 2315 | } else if (!CheckFixedSliceNumMultiSliceSetting (kiMbNumInFrame, | ||
| 2316 | &pDlp->sSliceArgument)) { // verify interleave mode settings | ||
| 2317 | //check uiSliceMbNum with current uiSliceNum | ||
| 2318 | WelsLog (pLogCtx, WELS_LOG_ERROR, | ||
| 2319 | "InitSliceSettings(), invalid uiSliceMbNum (%d) settings!,now turn to SM_SINGLE_SLICE type", | ||
| 2320 | pDlp->sSliceArgument.uiSliceMbNum[0]); | ||
| 2321 | pDlp->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; | ||
| 2322 | pDlp->sSliceArgument.uiSliceNum = 1; | ||
| 2323 | } | ||
| 2324 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting | ||
| 2325 | if (kiMbNumInFrame <= MIN_NUM_MB_PER_SLICE) { | ||
| 2326 | pDlp->sSliceArgument.uiSliceMode = SM_SINGLE_SLICE; | ||
| 2327 | pDlp->sSliceArgument.uiSliceNum = 1; | ||
| 2328 | break; | ||
| 2329 | } | ||
| 2330 | } | ||
| 2269 | // need perform check due uiSliceNum might change, although has been initialized somewhere outside | 2331 | // need perform check due uiSliceNum might change, although has been initialized somewhere outside |
| 2270 | if (pCodingParam->iRCMode != RC_OFF_MODE) { | 2332 | if (pCodingParam->iRCMode != RC_OFF_MODE) { |
| 2271 | GomValidCheckSliceMbNum (kiMbWidth, kiMbHeight, pSlcArg); | 2333 | GomValidCheckSliceMbNum (kiMbWidth, kiMbHeight, pSliceArgument); |
| 2272 | } else { | 2334 | } else { |
| 2273 | CheckFixedSliceNumMultiSliceSetting (kiMbNumInFrame, pSlcArg); | 2335 | CheckFixedSliceNumMultiSliceSetting (kiMbNumInFrame, pSliceArgument); |
| 2274 | } | 2336 | } |
| 2275 | break; | 2337 | break; |
| 2276 | case SM_SINGLE_SLICE: | 2338 | case SM_SINGLE_SLICE: |
| @@ -2281,53 +2343,6 @@ int32_t InitSliceSettings (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPar · 4 unmodified lines | |||
| 2281 | if (iSliceNum > iMaxSliceCount) | 2343 | if (iSliceNum > iMaxSliceCount) |
| 2282 | iMaxSliceCount = iSliceNum; | 2344 | iMaxSliceCount = iSliceNum; |
| 2283 | break; | 2345 | break; |
| 2284 | case SM_ROWMB_SLICE: | ||
| 2285 | if (iSliceNum > iMaxSliceCount) | ||
| 2286 | iMaxSliceCount = iSliceNum; | ||
| 2287 | break; | ||
| 2288 | case SM_AUTO_SLICE: | ||
| 2289 | pDlp->sSliceCfg.sSliceArgument.uiSliceNum = kiCpuCores; | ||
| 2290 | if (pDlp->sSliceCfg.sSliceArgument.uiSliceNum > MAX_SLICES_NUM) { | ||
| 2291 | pDlp->sSliceCfg.sSliceArgument.uiSliceNum = MAX_SLICES_NUM; | ||
| 2292 | } | ||
| 2293 | iMaxSliceCount = WELS_MAX(iMaxSliceCount, pDlp->sSliceCfg.sSliceArgument.uiSliceNum); | ||
| 2294 | if (pDlp->sSliceCfg.sSliceArgument.uiSliceNum == 1) { | ||
| 2295 | WelsLog (pLogCtx, WELS_LOG_DEBUG, | ||
| 2296 | "InitSliceSettings(), uiSliceNum(%d) you set for SM_AUTO_SLICE, now turn to SM_SINGLE_SLICE type!", | ||
| 2297 | pDlp->sSliceCfg.sSliceArgument.uiSliceNum); | ||
| 2298 | pDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | ||
| 2299 | break; | ||
| 2300 | } | ||
| 2301 | if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom | ||
| 2302 | //check uiSliceNum and set uiSliceMbNum with current uiSliceNum | ||
| 2303 | if (!GomValidCheckSliceNum (kiMbWidth, kiMbHeight, &pDlp->sSliceCfg.sSliceArgument.uiSliceNum)) { | ||
| 2304 | WelsLog (pLogCtx, WELS_LOG_WARNING, | ||
| 2305 | "ParamValidationExt(), unsupported setting with Resolution and uiSliceNum combination under RC on! So uiSliceNum is changed to %d!", | ||
| 2306 | pDlp->sSliceCfg.sSliceArgument.uiSliceNum); | ||
| 2307 | } | ||
| 2308 | if (pDlp->sSliceCfg.sSliceArgument.uiSliceNum <= 1 || | ||
| 2309 | !GomValidCheckSliceMbNum (kiMbWidth, kiMbHeight, &pDlp->sSliceCfg.sSliceArgument)) { | ||
| 2310 | WelsLog (pLogCtx, WELS_LOG_ERROR, | ||
| 2311 | "ParamValidationExt(), unsupported setting with Resolution and uiSliceNum (%d) combination under RC on! Consider setting single slice with this resolution!", | ||
| 2312 | pDlp->sSliceCfg.sSliceArgument.uiSliceNum); | ||
| 2313 | return ENC_RETURN_INVALIDINPUT; | ||
| 2314 | } | ||
| 2315 | } else if (!CheckFixedSliceNumMultiSliceSetting (kiMbNumInFrame, | ||
| 2316 | &pDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings | ||
| 2317 | //check uiSliceMbNum with current uiSliceNum | ||
| 2318 | WelsLog (pLogCtx, WELS_LOG_ERROR, | ||
| 2319 | "InitSliceSettings(), invalid uiSliceMbNum (%d) settings!,now turn to SM_SINGLE_SLICE type", | ||
| 2320 | pDlp->sSliceCfg.sSliceArgument.uiSliceMbNum[0]); | ||
| 2321 | pDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | ||
| 2322 | pDlp->sSliceCfg.sSliceArgument.uiSliceNum = 1; | ||
| 2323 | } | ||
| 2324 | // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting | ||
| 2325 | if (kiMbNumInFrame <= MIN_NUM_MB_PER_SLICE) { | ||
| 2326 | pDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE; | ||
| 2327 | pDlp->sSliceCfg.sSliceArgument.uiSliceNum = 1; | ||
| 2328 | break; | ||
| 2329 | } | ||
| 2330 | break; | ||
| 2331 | default: | 2346 | default: |
| 2332 | break; | 2347 | break; |
| 2333 | } | 2348 | } |
| @@ -2858,8 +2873,8 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 524 unmodified lines | |||
| 2858 | 2873 | ||
| 2859 | pCurDq->pDecPic = pDecPic; | 2874 | pCurDq->pDecPic = pDecPic; |
| 2860 | 2875 | ||
| 2861 | if (fDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE) // need get extra slices for update | 2876 | if (fDlp->sSliceArgument.uiSliceMode == SM_SIZELIMITED_SLICE) // need get extra slices for update |
| 2862 | iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sSliceCfg); | 2877 | iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sSliceArgument); |
| 2863 | else | 2878 | else |
| 2864 | iSliceCount = GetCurrentSliceNum (pCurDq->pSliceEncCtx); | 2879 | iSliceCount = GetCurrentSliceNum (pCurDq->pSliceEncCtx); |
| 2865 | assert (iSliceCount > 0); | 2880 | assert (iSliceCount > 0); |
| @@ -3869,17 +3884,17 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1003 unmodified lines | |||
| 3869 | iDidList[iSpatialIdx] = iCurDid; | 3884 | iDidList[iSpatialIdx] = iCurDid; |
| 3870 | 3885 | ||
| 3871 | // Encoding this picture might mulitiple sQualityStat layers potentially be encoded as followed | 3886 | // Encoding this picture might mulitiple sQualityStat layers potentially be encoded as followed |
| 3872 | switch (pParam->sSliceCfg.uiSliceMode) { | 3887 | switch (pParam->sSliceArgument.uiSliceMode) { |
| 3873 | case SM_FIXEDSLCNUM_SLICE: | 3888 | case SM_FIXEDSLCNUM_SLICE: { |
| 3874 | case SM_AUTO_SLICE: { | ||
| 3875 | if ((iCurDid > 0) && (pSvcParam->iMultipleThreadIdc > 1) && | 3889 | if ((iCurDid > 0) && (pSvcParam->iMultipleThreadIdc > 1) && |
| 3876 | (pSvcParam->sSpatialLayers[iCurDid].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE | 3890 | (pSvcParam->sSpatialLayers[iCurDid].sSliceArgument.uiSliceMode == SM_FIXEDSLCNUM_SLICE |
| 3877 | && pSvcParam->iMultipleThreadIdc >= pSvcParam->sSpatialLayers[iCurDid].sSliceCfg.sSliceArgument.uiSliceNum) | 3891 | && pSvcParam->bUseLoadBalancing |
| 3892 | && pSvcParam->iMultipleThreadIdc >= pSvcParam->sSpatialLayers[iCurDid].sSliceArgument.uiSliceNum) | ||
| 3878 | ) | 3893 | ) |
| 3879 | AdjustEnhanceLayer (pCtx, iCurDid); | 3894 | AdjustEnhanceLayer (pCtx, iCurDid); |
| 3880 | break; | 3895 | break; |
| 3881 | } | 3896 | } |
| 3882 | case SM_DYN_SLICE: { | 3897 | case SM_SIZELIMITED_SLICE: { |
| 3883 | int32_t iPicIPartitionNum = PicPartitionNumDecision (pCtx); | 3898 | int32_t iPicIPartitionNum = PicPartitionNumDecision (pCtx); |
| 3884 | // MT compatibility | 3899 | // MT compatibility |
| 3885 | pCtx->iActiveThreadsNum = | 3900 | pCtx->iActiveThreadsNum = |
| @@ -3961,7 +3976,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 75 unmodified lines | |||
| 3961 | //TODO Complexity Calculation here for screen content | 3976 | //TODO Complexity Calculation here for screen content |
| 3962 | iLayerSize = 0; | 3977 | iLayerSize = 0; |
| 3963 | 3978 | ||
| 3964 | if (SM_SINGLE_SLICE == pParam->sSliceCfg.uiSliceMode) { // only one slice within a sQualityStat layer | 3979 | if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer |
| 3965 | int32_t iSliceSize = 0; | 3980 | int32_t iSliceSize = 0; |
| 3966 | int32_t iPayloadSize = 0; | 3981 | int32_t iPayloadSize = 0; |
| 3967 | 3982 | ||
| @@ -4002,7 +4017,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 34 unmodified lines | |||
| 4002 | pLayerBsInfo->iNalCount = ++ iNalIdxInLayer; | 4017 | pLayerBsInfo->iNalCount = ++ iNalIdxInLayer; |
| 4003 | } | 4018 | } |
| 4004 | // for dynamic slicing single threading.. | 4019 | // for dynamic slicing single threading.. |
| 4005 | else if ((SM_DYN_SLICE == pParam->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) { | 4020 | else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) { |
| 4006 | const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->pSliceEncCtx->iMbNumInFrame; | 4021 | const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->pSliceEncCtx->iMbNumInFrame; |
| 4007 | pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0, | 4022 | pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0, |
| 4008 | kiLastMbInFrame, 0); | 4023 | kiLastMbInFrame, 0); |
| @@ -4010,14 +4025,13 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1 unmodified line | |||
| 4010 | } else { | 4025 | } else { |
| 4011 | //other multi-slice uiSliceMode | 4026 | //other multi-slice uiSliceMode |
| 4012 | int32_t iRet = 0; | 4027 | int32_t iRet = 0; |
| 4013 | // THREAD_FULLY_FIRE_MODE/THREAD_PICK_UP_MODE for any mode of non-SM_DYN_SLICE | 4028 | // THREAD_FULLY_FIRE_MODE/THREAD_PICK_UP_MODE for any mode of non-SM_SIZELIMITED_SLICE |
| 4014 | if ((SM_DYN_SLICE != pParam->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) { | 4029 | if ((SM_SIZELIMITED_SLICE != pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) { |
| 4015 | |||
| 4016 | iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx); | 4030 | iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx); |
| 4017 | if (iLayerNum + 1 >= MAX_LAYER_NUM_OF_FRAME) { // check available layer_bs_info for further writing as followed | 4031 | if (iLayerNum + 1 >= MAX_LAYER_NUM_OF_FRAME) { // check available layer_bs_info for further writing as followed |
| 4018 | WelsLog (pLogCtx, WELS_LOG_ERROR, | 4032 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| 4019 | "WelsEncoderEncodeExt(), iLayerNum(%d) overflow(max:%d) at iDid= %d uiSliceMode= %d, iSliceCount= %d!", | 4033 | "WelsEncoderEncodeExt(), iLayerNum(%d) overflow(max:%d) at iDid= %d uiSliceMode= %d, iSliceCount= %d!", |
| 4020 | iLayerNum, MAX_LAYER_NUM_OF_FRAME, iCurDid, pParam->sSliceCfg.uiSliceMode, iSliceCount); | 4034 | iLayerNum, MAX_LAYER_NUM_OF_FRAME, iCurDid, pParam->sSliceArgument.uiSliceMode, iSliceCount); |
| 4021 | return ENC_RETURN_UNSUPPORTED_PARA; | 4035 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 4022 | } | 4036 | } |
| 4023 | if (iSliceCount <= 1) { | 4037 | if (iSliceCount <= 1) { |
| @@ -4038,8 +4052,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 14 unmodified lines | |||
| 4038 | pCtx->pTaskManage->ExecuteTasks(); | 4052 | pCtx->pTaskManage->ExecuteTasks(); |
| 4039 | iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, iSliceCount); | 4053 | iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, iSliceCount); |
| 4040 | } | 4054 | } |
| 4041 | // THREAD_FULLY_FIRE_MODE && SM_DYN_SLICE | 4055 | // THREAD_FULLY_FIRE_MODE && SM_SIZELIMITED_SLICE |
| 4042 | else if ((SM_DYN_SLICE == pParam->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) { | 4056 | else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) { |
| 4043 | const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum; //pSvcParam->iCountThreadsNum; | 4057 | const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum; //pSvcParam->iCountThreadsNum; |
| 4044 | 4058 | ||
| 4045 | // to fire slice coding threads | 4059 | // to fire slice coding threads |
| @@ -4050,7 +4064,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 4 unmodified lines | |||
| 4050 | if (iRet) { | 4064 | if (iRet) { |
| 4051 | WelsLog (pLogCtx, WELS_LOG_ERROR, | 4065 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| 4052 | "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!", | 4066 | "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!", |
| 4053 | iRet, pSvcParam->iCountThreadsNum, iSliceCount, pParam->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc); | 4067 | iRet, pSvcParam->iCountThreadsNum, iSliceCount, pParam->sSliceArgument.uiSliceMode, pSvcParam->iMultipleThreadIdc); |
| 4054 | return ENC_RETURN_UNEXPECTED; | 4068 | return ENC_RETURN_UNEXPECTED; |
| 4055 | } | 4069 | } |
| 4056 | 4070 | ||
| @@ -4295,9 +4309,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 238 unmodified lines | |||
| 4295 | iFrameSize += iPaddingNalSize; | 4309 | iFrameSize += iPaddingNalSize; |
| 4296 | } | 4310 | } |
| 4297 | 4311 | ||
| 4298 | if ((pParam->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE || pParam->sSliceCfg.uiSliceMode == SM_AUTO_SLICE) | 4312 | if ((pParam->sSliceArgument.uiSliceMode == SM_FIXEDSLCNUM_SLICE) |
| 4313 | && pSvcParam->bUseLoadBalancing | ||
| 4299 | && pSvcParam->iMultipleThreadIdc > 1 && | 4314 | && pSvcParam->iMultipleThreadIdc > 1 && |
| 4300 | pSvcParam->iMultipleThreadIdc >= pParam->sSliceCfg.sSliceArgument.uiSliceNum) { | 4315 | pSvcParam->iMultipleThreadIdc >= pParam->sSliceArgument.uiSliceNum) { |
| 4301 | CalcSliceComplexRatio (pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], pCtx->pCurDqLayer->pSliceEncCtx, | 4316 | CalcSliceComplexRatio (pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], pCtx->pCurDqLayer->pSliceEncCtx, |
| 4302 | pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]); | 4317 | pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]); |
| 4303 | #if defined(MT_DEBUG) | 4318 | #if defined(MT_DEBUG) |
| @@ -4342,13 +4357,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 38 unmodified lines | |||
| 4342 | #endif//MT_DEBUG | 4357 | #endif//MT_DEBUG |
| 4343 | 4358 | ||
| 4344 | if (pSvcParam->iMultipleThreadIdc > 1 && iDidList[0] == BASE_DEPENDENCY_ID | 4359 | if (pSvcParam->iMultipleThreadIdc > 1 && iDidList[0] == BASE_DEPENDENCY_ID |
| 4345 | && ((pSvcParam->sSpatialLayers[0].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE) | 4360 | && (pSvcParam->sSpatialLayers[0].sSliceArgument.uiSliceMode == SM_FIXEDSLCNUM_SLICE) |
| 4346 | || (pSvcParam->sSpatialLayers[0].sSliceCfg.uiSliceMode == SM_AUTO_SLICE)) | 4361 | && pSvcParam->bUseLoadBalancing |
| 4347 | && pSvcParam->iMultipleThreadIdc >= pSvcParam->sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceNum | 4362 | && pSvcParam->iMultipleThreadIdc >= pSvcParam->sSpatialLayers[0].sSliceArgument.uiSliceNum |
| 4348 | && ((pSvcParam->sSpatialLayers[iDidList[iSpatialNum - 1]].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE) | 4363 | && ((pSvcParam->sSpatialLayers[iDidList[iSpatialNum - 1]].sSliceArgument.uiSliceMode == SM_FIXEDSLCNUM_SLICE)) |
| 4349 | || (pSvcParam->sSpatialLayers[iDidList[iSpatialNum - 1]].sSliceCfg.uiSliceMode == SM_AUTO_SLICE)) | ||
| 4350 | && pSvcParam->iMultipleThreadIdc >= pSvcParam->sSpatialLayers[iDidList[iSpatialNum - | 4364 | && pSvcParam->iMultipleThreadIdc >= pSvcParam->sSpatialLayers[iDidList[iSpatialNum - |
| 4351 | 1]].sSliceCfg.sSliceArgument.uiSliceNum) { | 4365 | 1]].sSliceArgument.uiSliceNum) { |
| 4352 | AdjustBaseLayer (pCtx); | 4366 | AdjustBaseLayer (pCtx); |
| 4353 | } | 4367 | } |
| 4354 | 4368 | ||
| @@ -4483,10 +4497,10 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 128 unmodified lines | |||
| 4483 | break; | 4497 | break; |
| 4484 | } | 4498 | } |
| 4485 | 4499 | ||
| 4486 | if (pOldParam->sSpatialLayers[iIndexD].sSliceCfg.uiSliceMode != pNewParam->sSpatialLayers[iIndexD].sSliceCfg.uiSliceMode | 4500 | if (pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode != pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode |
| 4487 | || | 4501 | || |
| 4488 | pOldParam->sSpatialLayers[iIndexD].sSliceCfg.sSliceArgument.uiSliceNum != | 4502 | pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum != |
| 4489 | pNewParam->sSpatialLayers[iIndexD].sSliceCfg.sSliceArgument.uiSliceNum) { | 4503 | pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum) { |
| 4490 | bNeedReset = true; | 4504 | bNeedReset = true; |
| 4491 | break; | 4505 | break; |
| 4492 | } | 4506 | } |