1/*
2 ** Copyright 2003-2010, VisualOn, Inc.
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 express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16
17/***********************************************************************
18*      File: pit_shrp.c                                                *
19*                                                                      *
20*      Description: Performs Pitch sharpening routine                  *
21*                                                                      *
22************************************************************************/
23
24#include "typedef.h"
25#include "basic_op.h"
26
27void Pit_shrp(
28		Word16 * x,                           /* in/out: impulse response (or algebraic code) */
29		Word16 pit_lag,                       /* input : pitch lag                            */
30		Word16 sharp,                         /* input : pitch sharpening factor (Q15)        */
31		Word16 L_subfr                        /* input : subframe size                        */
32	     )
33{
34	Word32 i;
35	Word32 L_tmp;
36	Word16 *x_ptr = x + pit_lag;
37
38	for (i = pit_lag; i < L_subfr; i++)
39	{
40		L_tmp = (*x_ptr << 15);
41		L_tmp += *x++ * sharp;
42		*x_ptr++ = ((L_tmp + 0x4000)>>15);
43	}
44
45	return;
46}
47
48
49
50