1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
18 /****************************************************************************************
19 Portions of this file are derived from the following 3GPP standard:
22 ANSI-C code for the Adaptive Multi-Rate - Wideband (AMR-WB) speech codec
23 Available from http://www.3gpp.org
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 ****************************************************************************************/
30 ------------------------------------------------------------------------------
34 Filename: pit_shrp.cpp
36 ------------------------------------------------------------------------------
37 INPUT AND OUTPUT DEFINITIONS
39 int16 * x, in/out: impulse response (or algebraic code)
40 int16 pit_lag, input : pitch lag
41 int16 sharp, input : pitch sharpening factor (Q15)
42 int16 L_subfr input : subframe size
44 ------------------------------------------------------------------------------
47 Performs Pitch sharpening routine
49 ------------------------------------------------------------------------------
53 ------------------------------------------------------------------------------
56 ------------------------------------------------------------------------------
59 ------------------------------------------------------------------------------
63 /*----------------------------------------------------------------------------
65 ----------------------------------------------------------------------------*/
66 #include "pv_amr_wb_type_defs.h"
67 #include "pvamrwbdecoder_basic_op.h"
68 #include "pvamrwbdecoder_acelp.h"
70 /*----------------------------------------------------------------------------
72 ; Define module specific macros here
73 ----------------------------------------------------------------------------*/
76 /*----------------------------------------------------------------------------
78 ; Include all pre-processor statements here. Include conditional
79 ; compile variables also.
80 ----------------------------------------------------------------------------*/
82 /*----------------------------------------------------------------------------
83 ; LOCAL FUNCTION DEFINITIONS
84 ; Function Prototype declaration
85 ----------------------------------------------------------------------------*/
87 /*----------------------------------------------------------------------------
88 ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
89 ; Variable declaration - defined here and used outside this module
90 ----------------------------------------------------------------------------*/
92 /*----------------------------------------------------------------------------
93 ; EXTERNAL FUNCTION REFERENCES
94 ; Declare functions defined elsewhere and referenced in this module
95 ----------------------------------------------------------------------------*/
97 /*----------------------------------------------------------------------------
98 ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
99 ; Declare variables used in this module but defined elsewhere
100 ----------------------------------------------------------------------------*/
102 /*----------------------------------------------------------------------------
104 ----------------------------------------------------------------------------*/
107 int16 * x, /* in/out: impulse response (or algebraic code) */
108 int16 pit_lag, /* input : pitch lag */
109 int16 sharp, /* input : pitch sharpening factor (Q15) */
110 int16 L_subfr /* input : subframe size */
116 for (i = pit_lag; i < L_subfr; i++)
118 L_tmp = mac_16by16_to_int32((int32)x[i] << 16, x[i - pit_lag], sharp);
119 x[i] = amr_wb_round(L_tmp);