Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 12 files). Show all
Unified · Split
| @@ -283,7 +283,6 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx, CMemor · 282 unmodified lines | |||
| 283 | 283 | ||
| 284 | pCtx->pArgDec = NULL; | 284 | pCtx->pArgDec = NULL; |
| 285 | 285 | ||
| 286 | pCtx->eOutputColorFormat = videoFormatI420; // yuv in default | ||
| 287 | pCtx->bHaveGotMemory = false; // not ever request memory blocks for decoder context related | 286 | pCtx->bHaveGotMemory = false; // not ever request memory blocks for decoder context related |
| 288 | pCtx->uiCpuFlag = 0; | 287 | pCtx->uiCpuFlag = 0; |
| 289 | 288 | ||
| @@ -530,12 +529,6 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa · 240 unmodified lines | |||
| 530 | return 1; | 529 | return 1; |
| 531 | 530 | ||
| 532 | memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam)); | 531 | memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam)); |
| 533 | pCtx->eOutputColorFormat = pCtx->pParam->eOutputColorFormat; | ||
| 534 | if (!pCtx->bParseOnly) { | ||
| 535 | int32_t iRet = DecoderSetCsp (pCtx, pCtx->pParam->eOutputColorFormat); | ||
| 536 | if (iRet) | ||
| 537 | return iRet; | ||
| 538 | } | ||
| 539 | if ((pCtx->pParam->eEcActiveIdc > ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) | 532 | if ((pCtx->pParam->eEcActiveIdc > ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) |
| 540 | || (pCtx->pParam->eEcActiveIdc < ERROR_CON_DISABLE)) { | 533 | || (pCtx->pParam->eEcActiveIdc < ERROR_CON_DISABLE)) { |
| 541 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | 534 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, |
| @@ -803,29 +796,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 261 unmodified lines | |||
| 803 | return pCtx->iErrorCode; | 796 | return pCtx->iErrorCode; |
| 804 | } | 797 | } |
| 805 | 798 | ||
| 806 | /* | ||
| 807 | * set colorspace format in decoder | ||
| 808 | */ | ||
| 809 | int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat) { | ||
| 810 | WELS_VERIFY_RETURN_IF (1, (NULL == pCtx)); | ||
| 811 | |||
| 812 | pCtx->eOutputColorFormat = (EVideoFormatType) kiColorFormat; | ||
| 813 | if (pCtx->pParam != NULL) { | ||
| 814 | pCtx->pParam->eOutputColorFormat = (EVideoFormatType) kiColorFormat; | ||
| 815 | } | ||
| 816 | |||
| 817 | //For now, support only videoFormatI420! | ||
| 818 | if (kiColorFormat == (int32_t) videoFormatInternal) { | ||
| 819 | pCtx->pParam->eOutputColorFormat = pCtx->eOutputColorFormat = videoFormatI420; | ||
| 820 | } else if (kiColorFormat != (int32_t) videoFormatI420) { | ||
| 821 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "Support I420 output only for now! Change to I420..."); | ||
| 822 | pCtx->pParam->eOutputColorFormat = pCtx->eOutputColorFormat = videoFormatI420; | ||
| 823 | return cmUnsupportedData; | ||
| 824 | } | ||
| 825 | |||
| 826 | return 0; | ||
| 827 | } | ||
| 828 | |||
| 829 | /*! | 799 | /*! |
| 830 | * \brief make sure synchonozization picture resolution (get from slice header) among different parts (i.e, memory related and so on) | 800 | * \brief make sure synchonozization picture resolution (get from slice header) among different parts (i.e, memory related and so on) |
| 831 | * over decoder internal | 801 | * over decoder internal |