! * \brief configure decoder parameters */
| 646 | * \brief configure decoder parameters |
| 647 | */ |
| 648 | int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpParam) { |
| 649 | if (NULL == pCtx || NULL == kpParam) |
| 650 | return ERR_INFO_INVALID_PARAM; |
| 651 | |
| 652 | memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam)); |
| 653 | if ((pCtx->pParam->eEcActiveIdc > ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) |
| 654 | || (pCtx->pParam->eEcActiveIdc < ERROR_CON_DISABLE)) { |
| 655 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, |
| 656 | "eErrorConMethod (%d) not in range: (%d - %d). Set as default value: (%d).", pCtx->pParam->eEcActiveIdc, |
| 657 | ERROR_CON_DISABLE, ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE, |
| 658 | ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE); |
| 659 | pCtx->pParam->eEcActiveIdc = ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE; |
| 660 | } |
| 661 | |
| 662 | if (pCtx->pParam->bParseOnly) //parse only, disable EC method |
| 663 | pCtx->pParam->eEcActiveIdc = ERROR_CON_DISABLE; |
| 664 | InitErrorCon (pCtx); |
| 665 | |
| 666 | if (VIDEO_BITSTREAM_SVC == pCtx->pParam->sVideoProperty.eVideoBsType || |
| 667 | VIDEO_BITSTREAM_AVC == pCtx->pParam->sVideoProperty.eVideoBsType) { |
| 668 | pCtx->eVideoType = pCtx->pParam->sVideoProperty.eVideoBsType; |
| 669 | } else { |
| 670 | pCtx->eVideoType = VIDEO_BITSTREAM_DEFAULT; |
| 671 | } |
| 672 | |
| 673 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "eVideoType: %d", pCtx->eVideoType); |
| 674 | |
| 675 | return ERR_NONE; |
| 676 | } |
| 677 | |
| 678 | /*! |
| 679 | ************************************************************************************* |
no test coverage detected