-/* (C) 2007-2008 Jean-Marc Valin, CSIRO
-*/
+/* Copyright (c) 2007-2008 CSIRO
+ Copyright (c) 2007-2009 Xiph.Org Foundation
+ Written by Jean-Marc Valin */
/**
@file pitch.h
@brief Pitch analysis
#ifndef _PITCH_H
#define _PITCH_H
-#include "kiss_fftr.h"
-#include "psy.h"
+#include "modes.h"
+
+void pitch_downsample(celt_sig * restrict x[], celt_word16 * restrict x_lp, int len, int end, int _C, celt_sig * restrict xmem, celt_word16 * restrict filt_mem);
+
+void pitch_search(const CELTMode *m, const celt_word16 * restrict x_lp, celt_word16 * restrict y,
+ int len, int max_pitch, int *pitch, celt_sig *xmem, int M);
-/** Find the optimal delay for the pitch prediction. Computation is
- done in the frequency domain, both to save time and to make it
- easier to apply psychoacoustic weighting */
-void find_spectral_pitch(kiss_fftr_cfg fft, struct PsyDecay *decay, const celt_sig_t *x, const celt_sig_t *y, const celt_word16_t *window, int overlap, int lag, int len, int C, int *pitch);
+celt_word16 remove_doubling(celt_word16 *x, int maxperiod, int minperiod,
+ int N, int *T0, int prev_period, celt_word16 prev_gain);
#endif