shithub: openh264

Download patch

ref: de3990479ea944f98a15d692002fe01184f15eda
parent: 56222afe07d4b67204bc90f4f2226428f588a70b
author: ruil2 <[email protected]>
date: Wed Jun 25 11:43:48 EDT 2014

format update

--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -356,22 +356,22 @@
   if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) {
     if (pCfg->bEnableLongTermReference) {
       pCfg->iLTRRefNum = WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM_SCREEN);
-      if(pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT)
+      if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT)
         pCfg->iNumRefFrame = WELS_MAX (1, WELS_LOG2 (pCfg->uiGopSize)) + pCfg->iLTRRefNum;
     } else {
       pCfg->iLTRRefNum = 0;
-      if(pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT)
-        pCfg->iNumRefFrame = WELS_MAX (1, pCfg->uiGopSize >> 1);;
+      if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT)
+        pCfg->iNumRefFrame = WELS_MAX (1, pCfg->uiGopSize >> 1);
     }
   } else {
     pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM) : 0;
-    if(pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT){
+    if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT) {
       pCfg->iNumRefFrame		= ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) :
-        (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum);
+                              (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum);
       pCfg->iNumRefFrame		= WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM);
     }
   }
-  if(pCfg->iNumRefFrame > pCfg->iMaxNumRefFrame)
+  if (pCfg->iNumRefFrame > pCfg->iMaxNumRefFrame)
     pCfg->iMaxNumRefFrame = pCfg->iNumRefFrame;
   if (pCfg->iLtrMarkPeriod == 0) {
     pCfg->iLtrMarkPeriod = 30;
@@ -572,16 +572,17 @@
 void CWelsH264SVCEncoder::CheckLevelSetting (int32_t iLayer, ELevelIdc uiLevelIdc) {
   SSpatialLayerConfig* pLayerInfo = &m_pEncContext->pSvcParam->sSpatialLayers[iLayer];
   pLayerInfo->uiLevelIdc = uiLevelIdc;
-  if( (uiLevelIdc< LEVEL_1_0)||(uiLevelIdc >LEVEL_5_2)){
+  if ((uiLevelIdc < LEVEL_1_0) || (uiLevelIdc > LEVEL_5_2)) {
     pLayerInfo->uiLevelIdc = LEVEL_5_2;
-    WelsLog (m_pEncContext, WELS_LOG_WARNING, "doesn't support level(%d) change to LEVEL_5_2\n",uiLevelIdc);
+    WelsLog (m_pEncContext, WELS_LOG_WARNING, "doesn't support level(%d) change to LEVEL_5_2\n", uiLevelIdc);
   }
 }
 void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) {
   m_pEncContext->pSvcParam->iNumRefFrame = iNumRef;
-  if((iNumRef < MIN_REF_PIC_COUNT)||(iNumRef> MAX_REFERENCE_PICTURE_COUNT_NUM)){
-     m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT;
-     WelsLog (m_pEncContext, WELS_LOG_WARNING, "doesn't support the number of reference frame(%d) change to auto select mode\n",iNumRef);
+  if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > MAX_REFERENCE_PICTURE_COUNT_NUM)) {
+    m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT;
+    WelsLog (m_pEncContext, WELS_LOG_WARNING,
+             "doesn't support the number of reference frame(%d) change to auto select mode\n", iNumRef);
   }
 }
 /************************************************************************
@@ -943,7 +944,7 @@
   }
   break;
   case ENCODER_OPTION_DELIVERY_STATUS: {
-    SDeliveryStatus *pValue = (static_cast<SDeliveryStatus*>(pOption));
+    SDeliveryStatus* pValue = (static_cast<SDeliveryStatus*> (pOption));
     m_pEncContext->iDropNumber = pValue->iDropNum;
   }
   break;