18 typedef struct AVEncodeContext {
20 int rate; /* frames per sec or samples per sec */
24 int gop_size; /* 0 = intra only */
29 /* the following data should not be initialized */
30 int frame_size; /* in samples, initialized when calling 'init' */
31 int frame_number; /* audio or video frame number */
32 int key_frame; /* true if the previous compressed frame was
33 a key frame (intra, or seekable) */
34 struct AVEncoder *codec;
38 typedef struct AVEncoder {
43 int (*init)(AVEncodeContext *);
44 int (*encode)(AVEncodeContext *, UINT8 *buf, int buf_size, void *data);
45 int (*close)(AVEncodeContext *);
46 struct AVEncoder *next;
49 extern AVEncoder ac3_encoder;
50 extern AVEncoder mp2_encoder;
51 extern AVEncoder mpeg1video_encoder;
52 extern AVEncoder h263_encoder;
53 extern AVEncoder rv10_encoder;
54 extern AVEncoder mjpeg_encoder;
59 /* fractional resampling */
60 UINT32 incr; /* fractional increment */
63 /* integer down sample */
64 int iratio; /* integer divison ratio */
67 } ReSampleChannelContext;
70 ReSampleChannelContext channel_ctx[2];
73 int input_channels, output_channels;
76 int audio_resample_init(ReSampleContext *s,
77 int output_channels, int input_channels,
78 int output_rate, int input_rate);
79 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);