Home | History | Annotate | Download | only in src
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /****************************************************************************************
     19 Portions of this file are derived from the following 3GPP standard:
     20 
     21     3GPP TS 26.173
     22     ANSI-C code for the Adaptive Multi-Rate - Wideband (AMR-WB) speech codec
     23     Available from http://www.3gpp.org
     24 
     25 (C) 2007, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
     26 Permission to distribute, modify and use this file under the standard license
     27 terms listed above has been obtained from the copyright holder.
     28 ****************************************************************************************/
     29 /*
     30 ------------------------------------------------------------------------------
     31 
     32 
     33 
     34  Filename: preemph_amrwb_dec.cpp
     35 
     36      Date: 12/10/2004
     37 
     38 ------------------------------------------------------------------------------
     39  REVISION HISTORY
     40 
     41 
     42  Description:
     43 
     44 ------------------------------------------------------------------------------
     45  INPUT AND OUTPUT DEFINITIONS
     46 
     47      int16 x[],         (i/o)   : input signal overwritten by the output
     48      int16 mu,          (i) Q15 : preemphasis coefficient
     49      int16 lg           (i)     : lenght of filtering
     50 
     51 ------------------------------------------------------------------------------
     52  FUNCTION DESCRIPTION
     53 
     54     Preemphasis: filtering through 1 - g z^-1
     55 
     56 ------------------------------------------------------------------------------
     57  REQUIREMENTS
     58 
     59 
     60 ------------------------------------------------------------------------------
     61  REFERENCES
     62 
     63 ------------------------------------------------------------------------------
     64  PSEUDO-CODE
     65 
     66 ------------------------------------------------------------------------------
     67 */
     68 
     69 /*----------------------------------------------------------------------------
     70 ; INCLUDES
     71 ----------------------------------------------------------------------------*/
     72 
     73 #include "pv_amr_wb_type_defs.h"
     74 #include "pvamrwbdecoder_basic_op.h"
     75 #include "pvamrwbdecoder_acelp.h"
     76 
     77 /*----------------------------------------------------------------------------
     78 ; MACROS
     79 ; Define module specific macros here
     80 ----------------------------------------------------------------------------*/
     81 
     82 
     83 /*----------------------------------------------------------------------------
     84 ; DEFINES
     85 ; Include all pre-processor statements here. Include conditional
     86 ; compile variables also.
     87 ----------------------------------------------------------------------------*/
     88 
     89 /*----------------------------------------------------------------------------
     90 ; LOCAL FUNCTION DEFINITIONS
     91 ; Function Prototype declaration
     92 ----------------------------------------------------------------------------*/
     93 
     94 /*----------------------------------------------------------------------------
     95 ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
     96 ; Variable declaration - defined here and used outside this module
     97 ----------------------------------------------------------------------------*/
     98 
     99 /*----------------------------------------------------------------------------
    100 ; EXTERNAL FUNCTION REFERENCES
    101 ; Declare functions defined elsewhere and referenced in this module
    102 ----------------------------------------------------------------------------*/
    103 
    104 /*----------------------------------------------------------------------------
    105 ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
    106 ; Declare variables used in this module but defined elsewhere
    107 ----------------------------------------------------------------------------*/
    108 
    109 /*----------------------------------------------------------------------------
    110 ; FUNCTION CODE
    111 ----------------------------------------------------------------------------*/
    112 
    113 
    114 void preemph_amrwb_dec(
    115     int16 x[],         /* (i/o)   : input signal overwritten by the output */
    116     int16 mu,          /* (i) Q15 : preemphasis coefficient                */
    117     int16 lg           /* (i)     : lenght of filtering                    */
    118 )
    119 {
    120     int16 i;
    121     int32 L_tmp;
    122 
    123     for (i = lg - 1; i != 0; i--)
    124     {
    125         L_tmp = msu_16by16_from_int32((int32)x[i] << 16, x[i - 1], mu);
    126         x[i] = amr_wb_round(L_tmp);
    127     }
    128 
    129 }
    130 
    131