Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 54 files). Show all
Unified · Split
| @@ -102,7 +102,7 @@ CWelsDecoder::CWelsDecoder (void) · 101 unmodified lines | |||
| 102 | #endif//OUTPUT_BIT_STREAM | 102 | #endif//OUTPUT_BIT_STREAM |
| 103 | 103 | ||
| 104 | 104 | ||
| 105 | m_pWelsTrace = new welsCodecTrace(); | 105 | m_pWelsTrace = new welsCodecTrace(); |
| 106 | if (m_pWelsTrace != NULL) { | 106 | if (m_pWelsTrace != NULL) { |
| 107 | m_pWelsTrace->SetCodecInstance (this); | 107 | m_pWelsTrace->SetCodecInstance (this); |
| 108 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); | 108 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); |
| @@ -227,7 +227,7 @@ void CWelsDecoder::UninitDecoder (void) { · 118 unmodified lines | |||
| 227 | if (NULL != m_pDecContext) { | 227 | if (NULL != m_pDecContext) { |
| 228 | WelsFree (m_pDecContext, "m_pDecContext"); | 228 | WelsFree (m_pDecContext, "m_pDecContext"); |
| 229 | 229 | ||
| 230 | m_pDecContext = NULL; | 230 | m_pDecContext = NULL; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | } | 233 | } |
| @@ -240,7 +240,7 @@ int32_t CWelsDecoder::InitDecoder (const bool bParseOnly) { · 6 unmodified lines | |||
| 240 | 240 | ||
| 241 | if (m_pDecContext) //free | 241 | if (m_pDecContext) //free |
| 242 | UninitDecoder(); | 242 | UninitDecoder(); |
| 243 | m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext"); | 243 | m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext"); |
| 244 | if (NULL == m_pDecContext) | 244 | if (NULL == m_pDecContext) |
| 245 | return cmMallocMemeError; | 245 | return cmMallocMemeError; |
| 246 | 246 | ||
| @@ -266,23 +266,23 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 19 unmodified lines | |||
| 266 | if (pOption == NULL) | 266 | if (pOption == NULL) |
| 267 | return cmInitParaError; | 267 | return cmInitParaError; |
| 268 | 268 | ||
| 269 | iVal = * ((int*)pOption); // is_rgb | 269 | iVal = * ((int*)pOption); // is_rgb |
| 270 | 270 | ||
| 271 | return DecoderSetCsp (m_pDecContext, iVal); | 271 | return DecoderSetCsp (m_pDecContext, iVal); |
| 272 | } else if (eOptID == DECODER_OPTION_END_OF_STREAM) { // Indicate bit-stream of the final frame to be decoded | 272 | } else if (eOptID == DECODER_OPTION_END_OF_STREAM) { // Indicate bit-stream of the final frame to be decoded |
| 273 | if (pOption == NULL) | 273 | if (pOption == NULL) |
| 274 | return cmInitParaError; | 274 | return cmInitParaError; |
| 275 | 275 | ||
| 276 | iVal = * ((int*)pOption); // boolean value for whether enabled End Of Stream flag | 276 | iVal = * ((int*)pOption); // boolean value for whether enabled End Of Stream flag |
| 277 | 277 | ||
| 278 | m_pDecContext->bEndOfStreamFlag = iVal ? true : false; | 278 | m_pDecContext->bEndOfStreamFlag = iVal ? true : false; |
| 279 | 279 | ||
| 280 | return cmResultSuccess; | 280 | return cmResultSuccess; |
| 281 | } else if (eOptID == DECODER_OPTION_ERROR_CON_IDC) { // Indicate error concealment status | 281 | } else if (eOptID == DECODER_OPTION_ERROR_CON_IDC) { // Indicate error concealment status |
| 282 | if (pOption == NULL) | 282 | if (pOption == NULL) |
| 283 | return cmInitParaError; | 283 | return cmInitParaError; |
| 284 | 284 | ||
| 285 | iVal = * ((int*)pOption); // int value for error concealment idc | 285 | iVal = * ((int*)pOption); // int value for error concealment idc |
| 286 | iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE); | 286 | iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE); |
| 287 | m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal; | 287 | m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal; |
| 288 | if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) { | 288 | if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) { |
| @@ -340,11 +340,11 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) { · 51 unmodified lines | |||
| 340 | 340 | ||
| 341 | if (DECODER_OPTION_DATAFORMAT == eOptID) { | 341 | if (DECODER_OPTION_DATAFORMAT == eOptID) { |
| 342 | iVal = (int32_t) m_pDecContext->eOutputColorFormat; | 342 | iVal = (int32_t) m_pDecContext->eOutputColorFormat; |
| 343 | * ((int*)pOption) = iVal; | 343 | * ((int*)pOption) = iVal; |
| 344 | return cmResultSuccess; | 344 | return cmResultSuccess; |
| 345 | } else if (DECODER_OPTION_END_OF_STREAM == eOptID) { | 345 | } else if (DECODER_OPTION_END_OF_STREAM == eOptID) { |
| 346 | iVal = m_pDecContext->bEndOfStreamFlag; | 346 | iVal = m_pDecContext->bEndOfStreamFlag; |
| 347 | * ((int*)pOption) = iVal; | 347 | * ((int*)pOption) = iVal; |
| 348 | return cmResultSuccess; | 348 | return cmResultSuccess; |
| 349 | } | 349 | } |
| 350 | #ifdef LONG_TERM_REF | 350 | #ifdef LONG_TERM_REF |
| @@ -473,7 +473,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 122 unmodified lines | |||
| 473 | EWelsNalUnitType eNalType = | 473 | EWelsNalUnitType eNalType = |
| 474 | NAL_UNIT_UNSPEC_0; //for NBR, IDR frames are expected to decode as followed if error decoding an IDR currently | 474 | NAL_UNIT_UNSPEC_0; //for NBR, IDR frames are expected to decode as followed if error decoding an IDR currently |
| 475 | 475 | ||
| 476 | eNalType = m_pDecContext->sCurNalHead.eNalUnitType; | 476 | eNalType = m_pDecContext->sCurNalHead.eNalUnitType; |
| 477 | 477 | ||
| 478 | if (m_pDecContext->iErrorCode & dsOutOfMemory) { | 478 | if (m_pDecContext->iErrorCode & dsOutOfMemory) { |
| 479 | ForceResetParaSetStatusAndAUList (m_pDecContext); | 479 | ForceResetParaSetStatusAndAUList (m_pDecContext); |
| @@ -638,7 +638,7 @@ DECODING_STATE CWelsDecoder::DecodeFrameEx (const unsigned char* kpSrc, · 158 unmodified lines | |||
| 638 | int& iWidth, | 638 | int& iWidth, |
| 639 | int& iHeight, | 639 | int& iHeight, |
| 640 | int& iColorFormat) { | 640 | int& iColorFormat) { |
| 641 | DECODING_STATE state = dsErrorFree; | 641 | DECODING_STATE state = dsErrorFree; |
| 642 | 642 | ||
| 643 | return state; | 643 | return state; |
| 644 | } | 644 | } |
| @@ -678,7 +678,7 @@ long WelsCreateDecoder (ISVCDecoder** ppDecoder) { · 33 unmodified lines | |||
| 678 | return ERR_INVALID_PARAMETERS; | 678 | return ERR_INVALID_PARAMETERS; |
| 679 | } | 679 | } |
| 680 | 680 | ||
| 681 | *ppDecoder = new CWelsDecoder(); | 681 | *ppDecoder = new CWelsDecoder(); |
| 682 | 682 | ||
| 683 | if (NULL == *ppDecoder) { | 683 | if (NULL == *ppDecoder) { |
| 684 | return ERR_MALLOC_FAILED; | 684 | return ERR_MALLOC_FAILED; |