This reverts commit 27172bafd7ff2cc80b08768a32a23470f3d6d3fd, reversing changes made to 24916a652ee5d3e36d931c222df20966f7c158fa.
Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 11 files). Show all
Unified · Split
| @@ -243,7 +243,6 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 242 unmodified lines | |||
| 243 | "CWelsDecoder::init_decoder(), openh264 codec version = %s, ParseOnly = %d", | 243 | "CWelsDecoder::init_decoder(), openh264 codec version = %s, ParseOnly = %d", |
| 244 | VERSION_NUMBER, (int32_t)pParam->bParseOnly); | 244 | VERSION_NUMBER, (int32_t)pParam->bParseOnly); |
| 245 | 245 | ||
| 246 | //reset decoder context | ||
| 247 | if (m_pDecContext) //free | 246 | if (m_pDecContext) //free |
| 248 | UninitDecoder(); | 247 | UninitDecoder(); |
| 249 | m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext"); | 248 | m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext"); |
| @@ -253,8 +252,8 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 3 unmodified lines | |||
| 253 | m_pDecContext->pMemAlign = new CMemoryAlign (iCacheLineSize); | 252 | m_pDecContext->pMemAlign = new CMemoryAlign (iCacheLineSize); |
| 254 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == m_pDecContext->pMemAlign), UninitDecoder()) | 253 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == m_pDecContext->pMemAlign), UninitDecoder()) |
| 255 | 254 | ||
| 256 | //fill in default value into context | 255 | WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, pParam->bParseOnly, |
| 257 | WelsDecoderDefaults (m_pDecContext, &m_pWelsTrace->m_sLogCtx); | 256 | &m_pWelsTrace->m_sLogCtx), UninitDecoder()) |
| 258 | 257 | ||
| 259 | //check param and update decoder context | 258 | //check param and update decoder context |
| 260 | m_pDecContext->pParam = (SDecodingParam*) m_pDecContext->pMemAlign->WelsMallocz (sizeof (SDecodingParam), | 259 | m_pDecContext->pParam = (SDecodingParam*) m_pDecContext->pMemAlign->WelsMallocz (sizeof (SDecodingParam), |
| @@ -263,9 +262,6 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 2 unmodified lines | |||
| 263 | int32_t iRet = DecoderConfigParam (m_pDecContext, pParam); | 262 | int32_t iRet = DecoderConfigParam (m_pDecContext, pParam); |
| 264 | WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess); | 263 | WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess); |
| 265 | 264 | ||
| 266 | //init decoder | ||
| 267 | WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, &m_pWelsTrace->m_sLogCtx), UninitDecoder()) | ||
| 268 | |||
| 269 | return cmResultSuccess; | 265 | return cmResultSuccess; |
| 270 | } | 266 | } |
| 271 | 267 | ||
| @@ -295,7 +291,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 23 unmodified lines | |||
| 295 | return dsInitialOptExpected; | 291 | return dsInitialOptExpected; |
| 296 | 292 | ||
| 297 | if (eOptID == DECODER_OPTION_DATAFORMAT) { // Set color space of decoding output frame | 293 | if (eOptID == DECODER_OPTION_DATAFORMAT) { // Set color space of decoding output frame |
| 298 | if (m_pDecContext->pParam->bParseOnly) { | 294 | if (m_pDecContext->bParseOnly) { |
| 299 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | 295 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 300 | "CWelsDecoder::SetOption for data format meaningless for parseonly."); | 296 | "CWelsDecoder::SetOption for data format meaningless for parseonly."); |
| 301 | return cmResultSuccess; | 297 | return cmResultSuccess; |
| @@ -322,7 +318,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 20 unmodified lines | |||
| 322 | iVal = * ((int*)pOption); // int value for error concealment idc | 318 | iVal = * ((int*)pOption); // int value for error concealment idc |
| 323 | iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE); | 319 | iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE); |
| 324 | m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal; | 320 | m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal; |
| 325 | if ((m_pDecContext->pParam->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) { | 321 | if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) { |
| 326 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 322 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 327 | "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal); | 323 | "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal); |
| 328 | return cmInitParaError; | 324 | return cmInitParaError; |