History

astyle all files

huili2 committed 12 years ago

Commit 5ed24f21 parent 0c24686120 files · +3967 −3886Browse files

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

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+115−108
@@ -84,7 +84,7 @@ CWelsH264SVCEncoder::CWelsH264SVCEncoder() · 83 unmodified lines
8484 #ifdef OUTPUT_BIT_STREAM
8585 SWelsTime tTime;
8686
87− WelsGetTimeOfDay(&tTime);
87+ WelsGetTimeOfDay (&tTime);
8888
8989 iCurUsed = WelsSnprintf (strStreamFileName, iBufferLeft, "enc_bs_0x%p_", (void*)this);
9090 iCurUsedSize = WelsSnprintf (strLenFileName, iBufferLeftSize, "enc_size_0x%p_", (void*)this);
@@ -108,14 +108,14 @@ CWelsH264SVCEncoder::CWelsH264SVCEncoder() · 17 unmodified lines
108108
109109 if (iBufferLeft > 0) {
110110 iCurUsed = WelsSnprintf (&strStreamFileName[iBufferUsed], iBufferLeft, ".%03.3u.264",
111− WelsGetMillisecond(&tTime));
111+ WelsGetMillisecond (&tTime));
112112 iBufferUsed += iCurUsed;
113113 iBufferLeft -= iCurUsed;
114114 }
115115
116116 if (iBufferLeftSize > 0) {
117117 iCurUsedSize = WelsSnprintf (&strLenFileName[iBufferUsedSize], iBufferLeftSize, ".%03.3u.len",
118− WelsGetMillisecond(&tTime));
118+ WelsGetMillisecond (&tTime));
119119 iBufferUsedSize += iCurUsedSize;
120120 iBufferLeftSize -= iCurUsedSize;
121121 }
@@ -186,7 +186,7 @@ void CWelsH264SVCEncoder::InitEncoder (void) { · 64 unmodified lines
186186 /* Interfaces override from ISVCEncoder */
187187
188188 int CWelsH264SVCEncoder::GetDefaultParams (SEncParamExt* argv) {
189− SWelsSvcCodingParam::FillDefault(*argv);
189+ SWelsSvcCodingParam::FillDefault (*argv);
190190 return cmResultSuccess;
191191 }
192192
@@ -209,7 +209,7 @@ int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) { · 16 unmodified lines
209209 return cmInitParaError;
210210 }
211211
212− return InitializeInternal(&sConfig);
212+ return InitializeInternal (&sConfig);
213213 }
214214
215215 int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) {
@@ -228,10 +228,10 @@ int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { · 12 unmodified lines
228228 return cmInitParaError;
229229 }
230230
231− return InitializeInternal(&sConfig);
231+ return InitializeInternal (&sConfig);
232232 }
233233
234−int CWelsH264SVCEncoder::InitializeInternal(SWelsSvcCodingParam* pCfg) {
234+int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) {
235235 if (NULL == pCfg) {
236236 WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n",
237237 pCfg);
@@ -245,7 +245,7 @@ int CWelsH264SVCEncoder::InitializeInternal(SWelsSvcCodingParam* pCfg) { · 7 unmodified lines
245245 }
246246
247247 #ifdef REC_FRAME_COUNT
248− SWelsSvcCodingParam &sEncodingParam = *pCfg;
248+ SWelsSvcCodingParam& sEncodingParam = *pCfg;
249249 WelsLog (m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
250250 m_uiCountFrameNum, m_iCspInternal);
251251 WelsLog (m_pEncContext, WELS_LOG_INFO,
@@ -346,17 +346,17 @@ int CWelsH264SVCEncoder::InitializeInternal(SWelsSvcCodingParam* pCfg) { · 94 unmodified lines
346346 }
347347 if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) {
348348 if (pCfg->bEnableLongTermReference) {
349− pCfg->iLTRRefNum = WELS_CLIP3(pCfg->iLTRRefNum,1,LONG_TERM_REF_NUM_SCREEN);
350− pCfg->iNumRefFrame = WELS_MAX(1,WELS_LOG2 (pCfg->uiGopSize)) + pCfg->iLTRRefNum;
349+ pCfg->iLTRRefNum = WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM_SCREEN);
350+ pCfg->iNumRefFrame = WELS_MAX (1, WELS_LOG2 (pCfg->uiGopSize)) + pCfg->iLTRRefNum;
351351 } else {
352352 pCfg->iLTRRefNum = 0;
353− pCfg->iNumRefFrame = WELS_MAX(1, pCfg->uiGopSize>>1);
353+ pCfg->iNumRefFrame = WELS_MAX (1, pCfg->uiGopSize >> 1);
354354 }
355− } else {
356− pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? WELS_CLIP3(pCfg->iLTRRefNum,1,LONG_TERM_REF_NUM) : 0;
357− pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) :
358− (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum);
359− pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM);
355+ } else {
356+ pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM) : 0;
357+ pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) :
358+ (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum);
359+ pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM);
360360 }
361361
362362 if (pCfg->iLtrMarkPeriod == 0) {
@@ -419,9 +419,9 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 56 unmodified lines
419419 return cmInitParaError;
420420 }
421421
422− const int32_t kiEncoderReturn = EncodeFrameInternal(kpSrcPic, pBsInfo);
422+ const int32_t kiEncoderReturn = EncodeFrameInternal (kpSrcPic, pBsInfo);
423423
424− if(kiEncoderReturn != cmResultSuccess)
424+ if (kiEncoderReturn != cmResultSuccess)
425425 return kiEncoderReturn;
426426
427427 #ifdef REC_FRAME_COUNT
@@ -437,14 +437,13 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 9 unmodified lines
437437 }
438438
439439
440−int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFrameBSInfo* pBsInfo) {
440+int CWelsH264SVCEncoder::EncodeFrameInternal (const SSourcePicture* pSrcPic, SFrameBSInfo* pBsInfo) {
441441 const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic);
442442
443− if(kiEncoderReturn == ENC_RETURN_MEMALLOCERR) {
443+ if (kiEncoderReturn == ENC_RETURN_MEMALLOCERR) {
444444 WelsUninitEncoderExt (&m_pEncContext);
445445 return cmMallocMemeError;
446− }
447− else if((kiEncoderReturn != ENC_RETURN_SUCCESS)&&(kiEncoderReturn == ENC_RETURN_CORRECTED)){
446+ } else if ((kiEncoderReturn != ENC_RETURN_SUCCESS) && (kiEncoderReturn == ENC_RETURN_CORRECTED)) {
448447 WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!\n", kiEncoderReturn);
449448 return cmUnkonwReason;
450449 }
@@ -500,7 +499,7 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr · 49 unmodified lines
500499 }
501500
502501 int CWelsH264SVCEncoder::EncodeParameterSets (SFrameBSInfo* pBsInfo) {
503− return WelsEncoderEncodeParameterSets (m_pEncContext, pBsInfo);
502+ return WelsEncoderEncodeParameterSets (m_pEncContext, pBsInfo);
504503 }
505504
506505 /*
@@ -512,7 +511,7 @@ int CWelsH264SVCEncoder::PauseFrame (const SSourcePicture* kpSrcPic, SFrameBSInf · 5 unmodified lines
512511 ForceIntraFrame (true);
513512
514513 if (EncodeFrameInternal (kpSrcPic, pBsInfo) != videoFrameTypeInvalid) {
515− iReturn = 0;
514+ iReturn = 0;
516515 }
517516
518517
@@ -692,7 +691,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 173 unmodified lines
692691 "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_FRAME_RATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %f\n",
693692 m_uiCountFrameNum, m_iCspInternal, iValue);
694693 #endif//REC_FRAME_COUNT
695− if (iValue<=0) {
694+ if (iValue <= 0) {
696695 return cmInitParaError;
697696 }
698697 //adjust to valid range
@@ -701,80 +700,84 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 2 unmodified lines
701700 }
702701 break;
703702 case ENCODER_OPTION_BITRATE: { // Target bit-rate
704− SBitrateInfo*pInfo = (static_cast<SBitrateInfo *>(pOption));
703+ SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
705704 int32_t iBitrate = pInfo->iBitrate;
706705 #ifdef REC_FRAME_COUNT
707706 WelsLog (m_pEncContext, WELS_LOG_INFO,
708− "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",
709− m_uiCountFrameNum, m_iCspInternal, iValue);
707+ "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",
708+ m_uiCountFrameNum, m_iCspInternal, iValue);
710709 #endif//REC_FRAME_COUNT
711− if (iBitrate<=0) {
712− WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iBitrate = %d\n",iBitrate);
710+ if (iBitrate <= 0) {
711+ WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iBitrate = %d\n",
712+ iBitrate);
713713 return cmInitParaError;
714714 }
715715 iBitrate = WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);
716− switch(pInfo->iLayer){
717− case SPATIAL_LAYER_ALL:
718− m_pEncContext->pSvcParam->iTargetBitrate = iBitrate;
719− break;
720− case SPATIAL_LAYER_0:
721− m_pEncContext->pSvcParam->sSpatialLayers[0].iSpatialBitrate = iBitrate;
722− break;
723− case SPATIAL_LAYER_1:
724− m_pEncContext->pSvcParam->sSpatialLayers[1].iSpatialBitrate = iBitrate;
725− break;
726− case SPATIAL_LAYER_2:
727− m_pEncContext->pSvcParam->sSpatialLayers[2].iSpatialBitrate = iBitrate;
728− break;
729− case SPATIAL_LAYER_3:
730− m_pEncContext->pSvcParam->sSpatialLayers[3].iSpatialBitrate = iBitrate;
731− break;
732− default:
733− WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iLayer = %d\n",pInfo->iLayer);
734− return cmInitParaError;
735− break;
736− }
716+ switch (pInfo->iLayer) {
717+ case SPATIAL_LAYER_ALL:
718+ m_pEncContext->pSvcParam->iTargetBitrate = iBitrate;
719+ break;
720+ case SPATIAL_LAYER_0:
721+ m_pEncContext->pSvcParam->sSpatialLayers[0].iSpatialBitrate = iBitrate;
722+ break;
723+ case SPATIAL_LAYER_1:
724+ m_pEncContext->pSvcParam->sSpatialLayers[1].iSpatialBitrate = iBitrate;
725+ break;
726+ case SPATIAL_LAYER_2:
727+ m_pEncContext->pSvcParam->sSpatialLayers[2].iSpatialBitrate = iBitrate;
728+ break;
729+ case SPATIAL_LAYER_3:
730+ m_pEncContext->pSvcParam->sSpatialLayers[3].iSpatialBitrate = iBitrate;
731+ break;
732+ default:
733+ WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iLayer = %d\n",
734+ pInfo->iLayer);
735+ return cmInitParaError;
736+ break;
737+ }
737738 //adjust to valid range
738− WelsEncoderApplyBitRate (m_pEncContext->pSvcParam,pInfo->iLayer);
739+ WelsEncoderApplyBitRate (m_pEncContext->pSvcParam, pInfo->iLayer);
739740 }
740741 break;
741742 case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
742− SBitrateInfo*pInfo = (static_cast<SBitrateInfo *>(pOption));
743+ SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
743744 int32_t iBitrate = pInfo->iBitrate;
744745
745746 #ifdef REC_FRAME_COUNT
746747 WelsLog (m_pEncContext, WELS_LOG_INFO,
747− "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",
748− m_uiCountFrameNum, m_iCspInternal, iValue);
748+ "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",
749+ m_uiCountFrameNum, m_iCspInternal, iValue);
749750 #endif//REC_FRAME_COUNT
750− if (iBitrate<=0) {
751− WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iBitrate = %d\n",iBitrate);
752− return cmInitParaError;
753− }
754− iBitrate = WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);
755− switch(pInfo->iLayer){
756− case SPATIAL_LAYER_ALL:
757− m_pEncContext->pSvcParam->iMaxBitrate = iBitrate;
758− break;
759− case SPATIAL_LAYER_0:
760− m_pEncContext->pSvcParam->sSpatialLayers[0].iMaxSpatialBitrate = iBitrate;
761− break;
762− case SPATIAL_LAYER_1:
763− m_pEncContext->pSvcParam->sSpatialLayers[1].iMaxSpatialBitrate = iBitrate;
764− break;
765− case SPATIAL_LAYER_2:
766− m_pEncContext->pSvcParam->sSpatialLayers[2].iMaxSpatialBitrate = iBitrate;
767− break;
768− case SPATIAL_LAYER_3:
769− m_pEncContext->pSvcParam->sSpatialLayers[3].iMaxSpatialBitrate = iBitrate;
770− break;
771− default:
772− WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iLayer = %d\n",pInfo->iLayer);
773− return cmInitParaError;
774− break;
775− }
776− //adjust to valid range
777− WelsEncoderApplyBitRate (m_pEncContext->pSvcParam,pInfo->iLayer);
751+ if (iBitrate <= 0) {
752+ WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iBitrate = %d\n",
753+ iBitrate);
754+ return cmInitParaError;
755+ }
756+ iBitrate = WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);
757+ switch (pInfo->iLayer) {
758+ case SPATIAL_LAYER_ALL:
759+ m_pEncContext->pSvcParam->iMaxBitrate = iBitrate;
760+ break;
761+ case SPATIAL_LAYER_0:
762+ m_pEncContext->pSvcParam->sSpatialLayers[0].iMaxSpatialBitrate = iBitrate;
763+ break;
764+ case SPATIAL_LAYER_1:
765+ m_pEncContext->pSvcParam->sSpatialLayers[1].iMaxSpatialBitrate = iBitrate;
766+ break;
767+ case SPATIAL_LAYER_2:
768+ m_pEncContext->pSvcParam->sSpatialLayers[2].iMaxSpatialBitrate = iBitrate;
769+ break;
770+ case SPATIAL_LAYER_3:
771+ m_pEncContext->pSvcParam->sSpatialLayers[3].iMaxSpatialBitrate = iBitrate;
772+ break;
773+ default:
774+ WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iLayer = %d\n",
775+ pInfo->iLayer);
776+ return cmInitParaError;
777+ break;
778+ }
779+ //adjust to valid range
780+ WelsEncoderApplyBitRate (m_pEncContext->pSvcParam, pInfo->iLayer);
778781 }
779782 break;
780783 case ENCODER_OPTION_RC_MODE: { // 0:quality mode;1:bit-rate mode;2:bitrate limited mode
@@ -838,20 +841,21 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 57 unmodified lines
838841 }
839842 }
840843 break;
841− case ENCODER_OPTION_DUMP_FILE:{
844+ case ENCODER_OPTION_DUMP_FILE: {
842845 #ifdef ENABLE_FRAME_DUMP
843− if(m_pEncContext->pSvcParam!=NULL){
844− SDumpLayer*pDump = (static_cast<SDumpLayer *>(pOption));
845− WelsStrncpy(m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName, sizeof(m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName),pDump->pFileName);
846+ if (m_pEncContext->pSvcParam != NULL) {
847+ SDumpLayer* pDump = (static_cast<SDumpLayer*> (pOption));
848+ WelsStrncpy (m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName,
849+ sizeof (m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName), pDump->pFileName);
846850 }
847851 #endif
848852 }
849853 break;
850− case ENCODER_OPTION_TRACE_LEVEL:{
851− if(m_pWelsTrace){
852− uint32_t level = *((uint32_t*)pOption);
853− m_pWelsTrace->SetTraceLevel(level);
854− }
854+ case ENCODER_OPTION_TRACE_LEVEL: {
855+ if (m_pWelsTrace) {
856+ uint32_t level = * ((uint32_t*)pOption);
857+ m_pWelsTrace->SetTraceLevel (level);
858+ }
855859 }
856860 break;
857861 default:
@@ -908,7 +912,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 50 unmodified lines
908912 "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
909913 m_uiCountFrameNum, m_iCspInternal);
910914 #endif//REC_FRAME_COUNT
911− m_pEncContext->pSvcParam->GetBaseParams((SEncParamBase*) pOption);
915+ m_pEncContext->pSvcParam->GetBaseParams ((SEncParamBase*) pOption);
912916 }
913917 break;
914918
@@ -927,29 +931,32 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 12 unmodified lines
927931 "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
928932 m_uiCountFrameNum, m_iCspInternal);
929933 #endif//REC_FRAME_COUNT
930− SBitrateInfo*pInfo = (static_cast<SBitrateInfo *>(pOption));
931− if((pInfo->iLayer!=SPATIAL_LAYER_ALL)&&(pInfo->iLayer!=SPATIAL_LAYER_0)&&(pInfo->iLayer!=SPATIAL_LAYER_1)&&(pInfo->iLayer!=SPATIAL_LAYER_2)&&(pInfo->iLayer!=SPATIAL_LAYER_3))
932− return cmInitParaError;
933− if(pInfo->iLayer == SPATIAL_LAYER_ALL){
934+ SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
935+ if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)
936+ && (pInfo->iLayer != SPATIAL_LAYER_2) && (pInfo->iLayer != SPATIAL_LAYER_3))
937+ return cmInitParaError;
938+ if (pInfo->iLayer == SPATIAL_LAYER_ALL) {
934939 pInfo->iBitrate = m_pEncContext->pSvcParam->iTargetBitrate;
935− }else{
940+ } else {
936941 pInfo->iBitrate = m_pEncContext->pSvcParam->sSpatialLayers[pInfo->iLayer].iSpatialBitrate;
937− }
942+ }
938943 }
939944 break;
940945 case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
941946 #ifdef REC_FRAME_COUNT
942− WelsLog (m_pEncContext, WELS_LOG_INFO,"CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_MAX_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
943− m_uiCountFrameNum, m_iCspInternal);
947+ WelsLog (m_pEncContext, WELS_LOG_INFO,
948+ "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_MAX_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
949+ m_uiCountFrameNum, m_iCspInternal);
944950 #endif//REC_FRAME_COUNT
945− SBitrateInfo*pInfo = (static_cast<SBitrateInfo *>(pOption));
946− if((pInfo->iLayer!=SPATIAL_LAYER_ALL)&&(pInfo->iLayer!=SPATIAL_LAYER_0)&&(pInfo->iLayer!=SPATIAL_LAYER_1)&&(pInfo->iLayer!=SPATIAL_LAYER_2)&&(pInfo->iLayer!=SPATIAL_LAYER_3))
947− return cmInitParaError;
948− if(pInfo->iLayer == SPATIAL_LAYER_ALL){
951+ SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
952+ if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)
953+ && (pInfo->iLayer != SPATIAL_LAYER_2) && (pInfo->iLayer != SPATIAL_LAYER_3))
954+ return cmInitParaError;
955+ if (pInfo->iLayer == SPATIAL_LAYER_ALL) {
949956 pInfo->iBitrate = m_pEncContext->pSvcParam->iMaxBitrate;
950− }else{
951− pInfo->iBitrate = m_pEncContext->pSvcParam->sSpatialLayers[pInfo->iLayer].iMaxSpatialBitrate;
952− }
957+ } else {
958+ pInfo->iBitrate = m_pEncContext->pSvcParam->sSpatialLayers[pInfo->iLayer].iMaxSpatialBitrate;
959+ }
953960 }
954961 break;
955962 default:

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