Home | History | Annotate | Download | only in ilbc
      1 /*
      2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 /******************************************************************
     12 
     13  iLBC Speech Coder ANSI-C Source Code
     14 
     15  WebRtcIlbcfix_Smooth_odata.c
     16 
     17 ******************************************************************/
     18 
     19 #include "defines.h"
     20 #include "constants.h"
     21 
     22 int32_t WebRtcIlbcfix_Smooth_odata(
     23     int16_t *odata,
     24     int16_t *psseq,
     25     int16_t *surround,
     26     int16_t C)
     27 {
     28   int i;
     29 
     30   int16_t err;
     31   int32_t errs;
     32 
     33   for(i=0;i<80;i++) {
     34     odata[i]= (int16_t)WEBRTC_SPL_RSHIFT_W32(
     35         (WEBRTC_SPL_MUL_16_16(C, surround[i])+1024), 11);
     36   }
     37 
     38   errs=0;
     39   for(i=0;i<80;i++) {
     40     err=(int16_t)WEBRTC_SPL_RSHIFT_W16((psseq[i]-odata[i]), 3);
     41     errs+=WEBRTC_SPL_MUL_16_16(err, err); /* errs in Q-6 */
     42   }
     43 
     44   return errs;
     45 }
     46