shithub: openh264

Download patch

ref: cda6a1fa7605956fae72757bfd71b96070d2fff3
parent: 17934b98436e1317bf9ec5cee2bfd61469c0f786
parent: 1661a60090b5a927e33572e12e75cd5cb37e4176
author: HaiboZhu <haibozhu@cisco.com>
date: Thu Oct 29 10:19:22 EDT 2015

Merge pull request #2191 from mstorsjo/cabac-warnings

Avoid warnings in the cabac code

--- a/codec/encoder/core/inc/set_mb_syn_cabac.h
+++ b/codec/encoder/core/inc/set_mb_syn_cabac.h
@@ -76,7 +76,7 @@
 void WelsCabacContextInit (void* pCtx, SCabacCtx* pCbCtx, int32_t iModel);
 void WelsCabacEncodeInit (SCabacCtx* pCbCtx, uint8_t* pBuf,  uint8_t* pEnd);
 inline void WelsCabacEncodeDecision (SCabacCtx* pCbCtx, int32_t iCtx, uint32_t uiBin);
-inline void WelsCabacEncodeBypassOne (SCabacCtx* pCbCtx, uint32_t uiBin);
+inline void WelsCabacEncodeBypassOne (SCabacCtx* pCbCtx, int32_t uiBin);
 void WelsCabacEncodeTerminate (SCabacCtx* pCbCtx, uint32_t uiBin);
 void WelsCabacEncodeUeBypass (SCabacCtx* pCbCtx, int32_t iExpBits, uint32_t uiVal);
 void WelsCabacEncodeFlush (SCabacCtx* pCbCtx);
@@ -116,7 +116,7 @@
   }
 }
 
-void WelsCabacEncodeBypassOne (SCabacCtx* pCbCtx, uint32_t uiBin) {
+void WelsCabacEncodeBypassOne (SCabacCtx* pCbCtx, int32_t uiBin) {
   const uint32_t kuiBinBitmask = -uiBin;
   pCbCtx->m_iRenormCnt++;
   WelsCabacEncodeUpdateLow_ (pCbCtx);
--- a/codec/encoder/core/src/set_mb_syn_cabac.cpp
+++ b/codec/encoder/core/src/set_mb_syn_cabac.cpp
@@ -115,11 +115,11 @@
       PropagateCarry (pBufCur, pCbCtx->m_pBufStart);
 
     if (CABAC_LOW_WIDTH > 32) {
-      WRITE_BE_32 (pBufCur, uiLow >> 31);
+      WRITE_BE_32 (pBufCur, (uint32_t) (uiLow >> 31));
       pBufCur += 4;
     }
-    *pBufCur++ = uiLow >> 23;
-    *pBufCur++ = uiLow >> 15;
+    *pBufCur++ = (uint8_t) (uiLow >> 23);
+    *pBufCur++ = (uint8_t) (uiLow >> 15);
     iRenormCnt -= kiInc;
     iLowBitCnt = 15;
     uiLow &= (1u << iLowBitCnt) - 1;
@@ -193,7 +193,7 @@
   if (uiLow & cabac_low_t (1) << (CABAC_LOW_WIDTH - 1))
     PropagateCarry (pBufCur, pCbCtx->m_pBufStart);
   for (; (iLowBitCnt -= 8) >= 0; uiLow <<= 8)
-    *pBufCur++ = uiLow >> (CABAC_LOW_WIDTH - 9);
+    *pBufCur++ = (uint8_t) (uiLow >> (CABAC_LOW_WIDTH - 9));
 
   pCbCtx->m_pBufCur = pBufCur;
 }