Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 2 files). Show all
Unified · Split
| @@ -512,7 +512,7 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 511 unmodified lines | ||
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | const int32_t kiEncoderReturn = EncodeFrameInternal(kpSrcPic, pBsInfo); |
| 515 | − | |
| 515 | + | |
| 516 | 516 | switch (kiEncoderReturn) { |
| 517 | 517 | case ENC_RETURN_MEMALLOCERR: |
| 518 | 518 | WelsUninitEncoderExt (&m_pEncContext); |
| @@ -540,7 +540,6 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 21 unmodified lines | ||
| 540 | 540 | #ifdef DUMP_SRC_PICTURE |
| 541 | 541 | DumpSrcPicture (pSrc); |
| 542 | 542 | #endif // DUMP_SRC_PICTURE |
| 543 | − | |
| 544 | 543 | return cmResultSuccess; |
| 545 | 544 | } |
| 546 | 545 | |
| @@ -556,18 +555,12 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr · 9 unmodified lines | ||
| 556 | 555 | const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic); |
| 557 | 556 | XMMREG_PROTECT_LOAD(CWelsH264SVCEncoder); |
| 558 | 557 | |
| 559 | − switch (kiEncoderReturn) { | |
| 560 | − case ENC_RETURN_MEMALLOCERR: | |
| 558 | + if(kiEncoderReturn == ENC_RETURN_MEMALLOCERR) { | |
| 561 | 559 | WelsUninitEncoderExt (&m_pEncContext); |
| 562 | 560 | return videoFrameTypeInvalid; |
| 563 | − case ENC_RETURN_SUCCESS: | |
| 564 | − case ENC_RETURN_CORRECTED: | |
| 565 | − break;//continue processing | |
| 566 | − case ENC_RETURN_UNSUPPORTED_PARA: | |
| 567 | − case ENC_RETURN_UNEXPECTED: | |
| 568 | − return videoFrameTypeInvalid; | |
| 569 | − default: | |
| 570 | − WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from WelsEncoderEncodeExt()!\n", kiEncoderReturn); | |
| 561 | + } | |
| 562 | + else if((kiEncoderReturn != ENC_RETURN_SUCCESS)&&(kiEncoderReturn == ENC_RETURN_CORRECTED)){ | |
| 563 | + WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!\n", kiEncoderReturn); | |
| 571 | 564 | return videoFrameTypeInvalid; |
| 572 | 565 | } |
| 573 | 566 | |
| @@ -593,8 +586,6 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr · 19 unmodified lines | ||
| 593 | 586 | break; |
| 594 | 587 | } |
| 595 | 588 | |
| 596 | − | |
| 597 | − | |
| 598 | 589 | ///////////////////for test |
| 599 | 590 | #ifdef OUTPUT_BIT_STREAM |
| 600 | 591 | if (iFrameType != videoFrameTypeInvalid && iFrameType != videoFrameTypeSkip) { |
| @@ -642,7 +633,7 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr · 41 unmodified lines | ||
| 642 | 633 | DumpSrcPicture (pSrcPicList[0]->pData[0]); |
| 643 | 634 | #endif // DUMP_SRC_PICTURE |
| 644 | 635 | |
| 645 | − return iFrameType; | |
| 636 | + return kiEncoderReturn; | |
| 646 | 637 | |
| 647 | 638 | } |
| 648 | 639 | |