Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_coding / codecs / isac / fix / source / arith_routines_logist.c
index 4efdecc..5c7df47 100644 (file)
@@ -71,7 +71,7 @@ static __inline uint16_t WebRtcIsacfix_Piecewise(int32_t xinQ15) {
   /* Find index for x-value */
   qtmp1 = WEBRTC_SPL_SAT(kHistEdges[50],xinQ15,kHistEdges[0]);
   ind = WEBRTC_SPL_MUL(5, qtmp1 - kHistEdges[0]);
-  ind =  WEBRTC_SPL_RSHIFT_W32(ind, 16);
+  ind >>= 16;
 
   /* Calculate corresponding y-value ans return*/
   qtmp1 = qtmp1 - kHistEdges[ind];
@@ -184,21 +184,20 @@ int WebRtcIsacfix_EncLogisticMulti2(Bitstr_enc *streamData,
      * W_upper < 2^24 */
     while ( !(W_upper & 0xFF000000) )
     {
-      W_upper = WEBRTC_SPL_LSHIFT_U32(W_upper, 8);
+      W_upper <<= 8;
       if (streamData->full == 0) {
         *streamPtr++ += (uint16_t) WEBRTC_SPL_RSHIFT_U32(
             streamData->streamval, 24);
         streamData->full = 1;
       } else {
-        *streamPtr = (uint16_t) WEBRTC_SPL_LSHIFT_U32(
-            WEBRTC_SPL_RSHIFT_U32(streamData->streamval, 24), 8);
+        *streamPtr = (uint16_t)((streamData->streamval >> 24) << 8);
         streamData->full = 0;
       }
 
       if( streamPtr > maxStreamPtr )
         return -ISAC_DISALLOWED_BITSTREAM_LENGTH;
 
-      streamData->streamval = WEBRTC_SPL_LSHIFT_U32(streamData->streamval, 8);
+      streamData->streamval <<= 8;
     }
   }
 
@@ -257,7 +256,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
   if (streamData->stream_index == 0)
   {
     /* read first word from bytestream */
-    streamVal = WEBRTC_SPL_LSHIFT_U32(*streamPtr++, 16);
+    streamVal = (uint32_t)(*streamPtr++) << 16;
     streamVal |= *streamPtr++;
 
   } else {
@@ -265,8 +264,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
   }
 
 
-  res = WEBRTC_SPL_LSHIFT_W32((int32_t)1,
-                               WEBRTC_SPL_RSHIFT_W16(WebRtcSpl_GetSizeInBits(envQ8[0]), 1));
+  res = 1 << (WebRtcSpl_GetSizeInBits(envQ8[0]) >> 1);
   envCount = 0;
 
   /* code assumes lenData%4 == 0 */
@@ -302,7 +300,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
       candQ7 = - *dataQ7 + 64;
       cdfTmp = WebRtcIsacfix_Piecewise(WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
 
-      W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
+      W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
       W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
 
       if (streamVal > W_tmp)
@@ -311,7 +309,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
         candQ7 += 128;
         cdfTmp = WebRtcIsacfix_Piecewise(WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
 
-        W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
+        W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
         W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
 
         while (streamVal > W_tmp)
@@ -321,7 +319,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
           cdfTmp = WebRtcIsacfix_Piecewise(
               WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
 
-          W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
+          W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
           W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
 
           /* error check */
@@ -340,7 +338,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
         candQ7 -= 128;
         cdfTmp = WebRtcIsacfix_Piecewise(WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
 
-        W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
+        W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
         W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
 
         while ( !(streamVal > W_tmp) )
@@ -350,7 +348,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
           cdfTmp = WebRtcIsacfix_Piecewise(
               WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
 
-          W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
+          W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
           W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
 
           /* error check */