annotate lowpass.h @ 7689:3c57663cdafd libavcodec

fir_32bands_perfect[] contents were mixed, restore original order Patch by Alexander Patrakov ($lastname <whirlpool> gmail.com) Thread: dcadata.h: fir_32bands_perfect[] is wrong
author kostya
date Mon, 25 Aug 2008 06:28:52 +0000
parents adcd246127eb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7673
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
1 /*
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
2 * Lowpass IIR filter
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
3 * Copyright (c) 2008 Konstantin Shishkov
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
4 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
5 * This file is part of FFmpeg.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
6 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
11 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
15 * Lesser General Public License for more details.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
16 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
20 */
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
21
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
22 /**
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
23 * @file lowpass.h
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
24 * lowpass filter interface
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
25 */
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
26
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
27 #ifndef FFMPEG_LOWPASS_H
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
28 #define FFMPEG_LOWPASS_H
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
29
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
30 #include "avcodec.h"
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
31
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
32 struct FFLPFilterCoeffs;
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
33 struct FFLPFilterState;
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
34
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
35 /**
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
36 * Initialize filter coefficients.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
37 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
38 * @param order filter order
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
39 * @param cutoff_ratio cutoff to input frequency ratio
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
40 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
41 * @return pointer to filter coefficients structure or NULL if filter cannot be created
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
42 */
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
43 const struct FFLPFilterCoeffs* ff_lowpass_filter_init_coeffs(int order, float cutoff_ratio);
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
44
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
45 /**
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
46 * Create new filter state.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
47 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
48 * @param order filter order
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
49 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
50 * @return pointer to new filter state or NULL if state creation fails
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
51 */
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
52 struct FFLPFilterState* ff_lowpass_filter_init_state(int order);
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
53
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
54 #if 0 //enable with arbitrary order filter implementation, use av_free() for filter state only for now
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
55 /**
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
56 * Free filter coefficients.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
57 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
58 * @param coeffs pointer allocated with ff_lowpass_filter_init_coeffs()
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
59 */
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
60 void ff_lowpass_filter_free_coeffs(struct FFLPFilterCoeffs *coeffs);
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
61
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
62 /**
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
63 * Free filter state.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
64 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
65 * @param state pointer allocated with ff_lowpass_filter_init_state()
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
66 */
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
67 void ff_lowpass_filter_free_state(struct FFLPFilterState *state);
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
68 #endif
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
69
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
70 /**
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
71 * Perform lowpass filtering on input samples.
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
72 *
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
73 * @param coeffs pointer to filter coefficients
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
74 * @param state pointer to filter state
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
75 * @param size input length
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
76 * @param src source samples
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
77 * @param sstep source stride
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
78 * @param dst filtered samples (destination may be the same as input)
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
79 * @param dstep destination stride
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
80 */
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
81 void ff_lowpass_filter(const struct FFLPFilterCoeffs *coeffs, struct FFLPFilterState *state, int size, int16_t *src, int sstep, int16_t *dst, int dstep);
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
82
adcd246127eb Simple lowpass filter implementation.
kostya
parents:
diff changeset
83 #endif /* FFMPEG_LOWPASS_H */