1 /* 2 * Copyright (c) 2012 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 * pitch_estimator.h 13 * 14 * Pitch functions 15 * 16 */ 17 18 #ifndef MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_PITCH_ESTIMATOR_H_ 19 #define MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_PITCH_ESTIMATOR_H_ 20 21 #include "modules/audio_coding/codecs/isac/fix/source/structs.h" 22 23 void WebRtcIsacfix_PitchAnalysis( 24 const int16_t* in, /* PITCH_FRAME_LEN samples */ 25 int16_t* outQ0, /* PITCH_FRAME_LEN+QLOOKAHEAD samples */ 26 PitchAnalysisStruct* State, 27 int16_t* lagsQ7, 28 int16_t* PitchGains_Q12); 29 30 void WebRtcIsacfix_InitialPitch(const int16_t* in, 31 PitchAnalysisStruct* State, 32 int16_t* qlags); 33 34 void WebRtcIsacfix_PitchFilter(int16_t* indatFix, 35 int16_t* outdatQQ, 36 PitchFiltstr* pfp, 37 int16_t* lagsQ7, 38 int16_t* gainsQ12, 39 int16_t type); 40 41 void WebRtcIsacfix_PitchFilterCore(int loopNumber, 42 int16_t gain, 43 size_t index, 44 int16_t sign, 45 int16_t* inputState, 46 int16_t* outputBuff2, 47 const int16_t* coefficient, 48 int16_t* inputBuf, 49 int16_t* outputBuf, 50 int* index2); 51 52 void WebRtcIsacfix_PitchFilterGains(const int16_t* indatQ0, 53 PitchFiltstr* pfp, 54 int16_t* lagsQ7, 55 int16_t* gainsQ12); 56 57 void WebRtcIsacfix_DecimateAllpass32( 58 const int16_t* in, 59 int32_t* state_in, /* array of size: 2*ALLPASSSECTIONS+1 */ 60 int16_t N, /* number of input samples */ 61 int16_t* out); /* array of size N/2 */ 62 63 int32_t WebRtcIsacfix_Log2Q8(uint32_t x); 64 65 void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8); 66 67 #endif /* MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_PITCH_ESTIMATOR_H_ */ 68