Chris@0: /* Chris@0: * libmad - MPEG audio decoder library Chris@0: * Copyright (C) 2000-2004 Underbit Technologies, Inc. Chris@0: * Chris@0: * This program is free software; you can redistribute it and/or modify Chris@0: * it under the terms of the GNU General Public License as published by Chris@0: * the Free Software Foundation; either version 2 of the License, or Chris@0: * (at your option) any later version. Chris@0: * Chris@0: * This program is distributed in the hope that it will be useful, Chris@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of Chris@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Chris@0: * GNU General Public License for more details. Chris@0: * Chris@0: * You should have received a copy of the GNU General Public License Chris@0: * along with this program; if not, write to the Free Software Chris@0: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Chris@0: * Chris@0: * $Id: synth.h,v 1.15 2004/01/23 09:41:33 rob Exp $ Chris@0: */ Chris@0: Chris@0: # ifndef LIBMAD_SYNTH_H Chris@0: # define LIBMAD_SYNTH_H Chris@0: Chris@0: # include "fixed.h" Chris@0: # include "frame.h" Chris@0: Chris@0: struct mad_pcm { Chris@0: unsigned int samplerate; /* sampling frequency (Hz) */ Chris@0: unsigned short channels; /* number of channels */ Chris@0: unsigned short length; /* number of samples per channel */ Chris@0: mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */ Chris@0: }; Chris@0: Chris@0: struct mad_synth { Chris@0: mad_fixed_t filter[2][2][2][16][8]; /* polyphase filterbank outputs */ Chris@0: /* [ch][eo][peo][s][v] */ Chris@0: Chris@0: unsigned int phase; /* current processing phase */ Chris@0: Chris@0: struct mad_pcm pcm; /* PCM output */ Chris@0: }; Chris@0: Chris@0: /* single channel PCM selector */ Chris@0: enum { Chris@0: MAD_PCM_CHANNEL_SINGLE = 0 Chris@0: }; Chris@0: Chris@0: /* dual channel PCM selector */ Chris@0: enum { Chris@0: MAD_PCM_CHANNEL_DUAL_1 = 0, Chris@0: MAD_PCM_CHANNEL_DUAL_2 = 1 Chris@0: }; Chris@0: Chris@0: /* stereo PCM selector */ Chris@0: enum { Chris@0: MAD_PCM_CHANNEL_STEREO_LEFT = 0, Chris@0: MAD_PCM_CHANNEL_STEREO_RIGHT = 1 Chris@0: }; Chris@0: Chris@0: void mad_synth_init(struct mad_synth *); Chris@0: Chris@0: # define mad_synth_finish(synth) /* nothing */ Chris@0: Chris@0: void mad_synth_mute(struct mad_synth *); Chris@0: Chris@0: void mad_synth_frame(struct mad_synth *, struct mad_frame const *); Chris@0: Chris@0: # endif