summaryrefslogtreecommitdiff
path: root/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h
blob: 93c81c8e7712ec00dc37b16e9a4190435f2a60af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

/*
 * pitch_estimator.h
 *
 * Pitch functions
 *
 */

#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_PITCH_ESTIMATOR_H_
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_PITCH_ESTIMATOR_H_

#include "structs.h"

void WebRtcIsacfix_PitchAnalysis(const int16_t *in,               /* PITCH_FRAME_LEN samples */
                                 int16_t *outQ0,                  /* PITCH_FRAME_LEN+QLOOKAHEAD samples */
                                 PitchAnalysisStruct *State,
                                 int16_t *lagsQ7,
                                 int16_t *PitchGains_Q12);

void WebRtcIsacfix_InitialPitch(const int16_t *in,
                                PitchAnalysisStruct *State,
                                int16_t *qlags);

void WebRtcIsacfix_PitchFilter(int16_t *indatFix,
                               int16_t *outdatQQ,
                               PitchFiltstr *pfp,
                               int16_t *lagsQ7,
                               int16_t *gainsQ12,
                               int16_t type);

void WebRtcIsacfix_PitchFilterCore(int loopNumber,
                                   int16_t gain,
                                   int index,
                                   int16_t sign,
                                   int16_t* inputState,
                                   int16_t* outputBuff2,
                                   const int16_t* coefficient,
                                   int16_t* inputBuf,
                                   int16_t* outputBuf,
                                   int* index2);

void WebRtcIsacfix_PitchFilterGains(const int16_t *indatQ0,
                                    PitchFiltstr *pfp,
                                    int16_t *lagsQ7,
                                    int16_t *gainsQ12);

void WebRtcIsacfix_DecimateAllpass32(const int16_t *in,
                                     int32_t *state_in,        /* array of size: 2*ALLPASSSECTIONS+1 */
                                     int16_t N,                   /* number of input samples */
                                     int16_t *out);             /* array of size N/2 */

#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_PITCH_ESTIMATOR_H_ */