]>
code.delx.au - pulseaudio/blob - src/pulsecore/ffmpeg/avcodec.h
2 * copyright (c) 2001 Fabrice Bellard
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 /* Just a heavily bastardized version of the original file from
25 * ffmpeg, just enough to get resample2.c to compile without
26 * modification -- Lennart */
28 #if !defined(PACKAGE) && defined(HAVE_CONFIG_H)
32 #include <sys/types.h>
39 #define av_mallocz(l) calloc(1, (l))
40 #define av_malloc(l) malloc(l)
41 #define av_realloc(p,l) realloc((p),(l))
42 #define av_free(p) free(p)
44 static inline void av_freep(void *k
) {
53 static inline int av_clip(int a
, int amin
, int amax
)
55 if (a
< amin
) return amin
;
56 else if (a
> amax
) return amax
;
62 #define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
63 #define FFSIGN(a) ((a) > 0 ? 1 : -1)
65 #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
66 #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
68 struct AVResampleContext
;
69 struct AVResampleContext
*av_resample_init(int out_rate
, int in_rate
, int filter_length
, int log2_phase_count
, int linear
, double cutoff
);
70 int av_resample(struct AVResampleContext
*c
, short *dst
, short *src
, int *consumed
, int src_size
, int dst_size
, int update_ctx
);
71 void av_resample_compensate(struct AVResampleContext
*c
, int sample_delta
, int compensation_distance
);
72 void av_resample_close(struct AVResampleContext
*c
);
73 void av_build_filter(int16_t *filter
, double factor
, int tap_count
, int phase_count
, int scale
, int type
);
76 * crude lrintf for non-C99 systems.
79 #define lrintf(x) ((long int)(x))
82 #endif /* AVCODEC_H */