History

use the same frame type EVideoFrameType in encoder internal

ruil2 committed 12 years ago

Commit e74f01a1 parent fc4cd8b7 files · +33 −85Browse files

Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 7 files). Show all

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+7−48
@@ -510,25 +510,8 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 509 unmodified lines
510510 }
511511
512512 const int32_t kiEncoderReturn = EncodeFrameInternal(kpSrcPic, pBsInfo);
513−
514− switch (kiEncoderReturn) {
515− case ENC_RETURN_MEMALLOCERR:
516− WelsUninitEncoderExt (&m_pEncContext);
517− return cmMallocMemeError;
518− case ENC_RETURN_SUCCESS:
519− case ENC_RETURN_CORRECTED:
520− break;//continue processing
521− case ENC_RETURN_UNSUPPORTED_PARA:
522− return cmUnsupportedData;
523− break;
524− case ENC_RETURN_UNEXPECTED:
525− return cmUnkonwReason;
526− default:
527− WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from WelsEncoderEncodeExt()!\n", kiEncoderReturn);
528− return cmUnkonwReason;
529− }
530−
531−
513+ if(kiEncoderReturn != cmResultSuccess)
514+ return kiEncoderReturn;
532515 #ifdef REC_FRAME_COUNT
533516 ++ m_uiCountFrameNum;
534517 WelsLog (m_pEncContext, WELS_LOG_INFO,
@@ -544,47 +527,23 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 9 unmodified lines
544527
545528 int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFrameBSInfo* pBsInfo) {
546529 if (!(pSrcPic && m_pEncContext && m_bInitialFlag) ){
547− return videoFrameTypeInvalid;
530+ return cmInitParaError;
548531 }
549532
550− int32_t iFrameTypeReturned = 0;
551− int32_t iFrameType = videoFrameTypeInvalid;
552533 const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic);
553534
554535 if(kiEncoderReturn == ENC_RETURN_MEMALLOCERR) {
555536 WelsUninitEncoderExt (&m_pEncContext);
556− return videoFrameTypeInvalid;
537+ return cmMallocMemeError;
557538 }
558539 else if((kiEncoderReturn != ENC_RETURN_SUCCESS)&&(kiEncoderReturn == ENC_RETURN_CORRECTED)){
559540 WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!\n", kiEncoderReturn);
560− return videoFrameTypeInvalid;
541+ return cmUnkonwReason;
561542 }
562543
563− iFrameTypeReturned = pBsInfo->eOutputFrameType;
564− switch (iFrameTypeReturned) {
565− case WELS_FRAME_TYPE_P:
566− iFrameType = videoFrameTypeP;
567− break;
568− case WELS_FRAME_TYPE_IDR:
569− iFrameType = videoFrameTypeIDR;
570− break;
571− case WELS_FRAME_TYPE_SKIP:
572− iFrameType = videoFrameTypeSkip;
573− break;
574− case WELS_FRAME_TYPE_I:
575− iFrameType = videoFrameTypeI;
576− break;
577− case WELS_FRAME_TYPE_AUTO:
578− case WELS_FRAME_TYPE_B: // not support B pictures
579− iFrameType = videoFrameTypeInvalid;
580− break;
581− default:
582− break;
583− }
584− pBsInfo->eOutputFrameType = iFrameType;
585544 ///////////////////for test
586545 #ifdef OUTPUT_BIT_STREAM
587− if (iFrameType != videoFrameTypeInvalid && iFrameType != videoFrameTypeSkip) {
546+ if (pBsInfo->eOutputFrameType != videoFrameTypeInvalid && pBsInfo->eOutputFrameType != videoFrameTypeSkip) {
588547 SLayerBSInfo* pLayer = NULL;
589548 int32_t i = 0, j = 0, iCurLayerBits = 0, total_bits = 0;
590549
@@ -629,7 +588,7 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr · 38 unmodified lines
629588 DumpSrcPicture (pSrcPicList[0]->pData[0]);
630589 #endif // DUMP_SRC_PICTURE
631590
632− return kiEncoderReturn;
591+ return cmResultSuccess;
633592
634593 }
635594

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t