| audio.h | | audio.h | |
| | | | |
| skipping to change at line 19 | | skipping to change at line 19 | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | |
| * | | * | |
|
| * $Id: audio.h,v 1.9 2000/05/09 17:36:27 rob Exp $ | | * $Id: audio.h,v 1.11 2000/05/24 05:06:24 rob Exp $ | |
| */ | | */ | |
| | | | |
| # ifndef AUDIO_H | | # ifndef AUDIO_H | |
| # define AUDIO_H | | # define AUDIO_H | |
| | | | |
| # include "libmad.h" | | # include "libmad.h" | |
| | | | |
| # define MAX_NSAMPLES 1152 | | # define MAX_NSAMPLES 1152 | |
| | | | |
| enum { | | enum { | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 63 | |
| mad_fixed_t const *samples[2]; | | mad_fixed_t const *samples[2]; | |
| } play; | | } play; | |
| | | | |
| struct audio_finish { | | struct audio_finish { | |
| short command; | | short command; | |
| } finish; | | } finish; | |
| }; | | }; | |
| | | | |
| extern char const *audio_error; | | extern char const *audio_error; | |
| | | | |
|
| typedef int (*audio_ctlfunc_t)(union audio_control *); | | typedef int audio_ctlfunc_t(union audio_control *); | |
| | | | |
|
| audio_ctlfunc_t audio_output(char const **); | | audio_ctlfunc_t *audio_output(char const **); | |
| | | | |
|
| int audio_oss(union audio_control *); | | audio_ctlfunc_t audio_oss; | |
| int audio_sun(union audio_control *); | | audio_ctlfunc_t audio_sun; | |
| int audio_win32(union audio_control *); | | audio_ctlfunc_t audio_win32; | |
| | | | |
|
| int audio_wav(union audio_control *); | | audio_ctlfunc_t audio_wav; | |
| int audio_raw(union audio_control *); | | audio_ctlfunc_t audio_raw; | |
| int audio_hex(union audio_control *); | | audio_ctlfunc_t audio_hex; | |
| int audio_null(union audio_control *); | | audio_ctlfunc_t audio_null; | |
| | | | |
| # endif | | # endif | |
| | | | |
End of changes. 5 change blocks. |
| 10 lines changed or deleted | | 10 lines changed or added | |
|
| frame.h | | frame.h | |
| | | | |
| skipping to change at line 19 | | skipping to change at line 19 | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | |
| * | | * | |
|
| * $Id: frame.h,v 1.5 2000/04/22 04:36:50 rob Exp $ | | * $Id: frame.h,v 1.6 2000/06/03 23:07:41 rob Exp $ | |
| */ | | */ | |
| | | | |
| # ifndef FRAME_H | | # ifndef FRAME_H | |
| # define FRAME_H | | # define FRAME_H | |
| | | | |
| # include "fixed.h" | | # include "fixed.h" | |
| # include "timer.h" | | # include "timer.h" | |
| # include "stream.h" | | # include "stream.h" | |
| | | | |
| struct mad_frame { | | struct mad_frame { | |
| int layer; /* audio layer (1, 2, or 3) */ | | int layer; /* audio layer (1, 2, or 3) */ | |
| int mode; /* channel mode (see below) */ | | int mode; /* channel mode (see below) */ | |
| int mode_ext; /* additional mode info */ | | int mode_ext; /* additional mode info */ | |
| int emphasis; /* de-emphasis to use (see b
elow) */ | | int emphasis; /* de-emphasis to use (see b
elow) */ | |
| | | | |
|
| unsigned int bitrate; /* stream bitrate (bps) */ | | unsigned long bitrate; /* stream bitrate (bps) */ | |
| unsigned int sfreq; /* sampling frequency (Hz) */ | | unsigned int sfreq; /* sampling frequency (Hz) */ | |
| | | | |
|
| struct mad_timer duration; /* audio playing time of frame */ | | int flags; /* flags (below) */ | |
| | | int private; /* private bits (below) */ | |
| | | | |
|
| int flags; /* flags and private bits (below) */ | | struct mad_timer duration; /* audio playing time of frame */ | |
| | | | |
| mad_fixed_t sbsample[2][36][32]; /* synthesis subband filter samples
*/ | | mad_fixed_t sbsample[2][36][32]; /* synthesis subband filter samples
*/ | |
| mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ | | mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ | |
| }; | | }; | |
| | | | |
| # define MAD_NUMCHANNELS(frame) ((frame)->mode ? 2 : 1) | | # define MAD_NUMCHANNELS(frame) ((frame)->mode ? 2 : 1) | |
|
| # define MAD_NUMSBSAMPLES(frame) ((frame)->layer == 1 ? 12 : 36) | | # define MAD_NUMSBSAMPLES(frame) \ | |
| | | ((frame)->layer == 1 ? 12 : \ | |
| | | (((frame)->layer == 3 && ((frame)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36) | |
| | | ) | |
| | | | |
| # define MAD_MODE_SINGLE_CHANNEL 0 | | # define MAD_MODE_SINGLE_CHANNEL 0 | |
| # define MAD_MODE_DUAL_CHANNEL 1 | | # define MAD_MODE_DUAL_CHANNEL 1 | |
| # define MAD_MODE_JOINT_STEREO 2 | | # define MAD_MODE_JOINT_STEREO 2 | |
| # define MAD_MODE_STEREO 3 | | # define MAD_MODE_STEREO 3 | |
| | | | |
| # define MAD_EMPH_NONE 0 /* no emphasis */ | | # define MAD_EMPH_NONE 0 /* no emphasis */ | |
| # define MAD_EMPH_50_15_MS 1 /* 50/15 microseconds */ | | # define MAD_EMPH_50_15_MS 1 /* 50/15 microseconds */ | |
| # define MAD_EMPH_CCITT_J_17 3 /* CCITT J.17 */ | | # define MAD_EMPH_CCITT_J_17 3 /* CCITT J.17 */ | |
| | | | |
|
| # define MAD_FLAG_PROTECTION 0x0100 /* frame has CRC protection */ | | # define MAD_FLAG_III_NPRIVATE 0x0007 /* number of Layer III private bits | |
| # define MAD_FLAG_COPYRIGHT 0x0200 /* frame is copyright */ | | */ | |
| # define MAD_FLAG_ORIGINAL 0x0400 /* frame is original (else copy) */ | | | |
| # define MAD_FLAG_PADDING 0x0800 /* frame has additional slot */ | | | |
| | | | |
|
| # define MAD_FLAG_I_STEREO 0x1000 /* uses intensity joint stereo */ | | # define MAD_FLAG_PROTECTION 0x0010 /* frame has CRC protection */ | |
| # define MAD_FLAG_MS_STEREO 0x2000 /* uses middle/side joint stereo */ | | # define MAD_FLAG_COPYRIGHT 0x0020 /* frame is copyright */ | |
| | | # define MAD_FLAG_ORIGINAL 0x0040 /* frame is original (else copy) */ | |
| | | # define MAD_FLAG_PADDING 0x0080 /* frame has additional slot */ | |
| | | | |
|
| # define MAD_FLAG_PRIVATE 0x0040 /* header private bit */ | | # define MAD_FLAG_I_STEREO 0x0100 /* uses intensity joint stereo */ | |
| # define MAD_FLAG_III_PRIVATE 0x001f /* Layer III private bits */ | | # define MAD_FLAG_MS_STEREO 0x0200 /* uses middle/side joint stereo */ | |
| # define MAD_FLAG_III_5BITPRIV 0x0020 /* 5 bits in III private (else 3) */ | | | |
| | | # define MAD_FLAG_LSF_EXT 0x1000 /* lower sampling freq. extension */ | |
| | | # define MAD_FLAG_MC_EXT 0x2000 /* multichannel audio extension */ | |
| | | | |
| | | # define MAD_PRIV_HEADER 0x0100 /* header private bit */ | |
| | | # define MAD_PRIV_III 0x001f /* Layer III private bits (up to 5) | |
| | | */ | |
| | | | |
| void mad_frame_init(struct mad_frame *); | | void mad_frame_init(struct mad_frame *); | |
| void mad_frame_finish(struct mad_frame *); | | void mad_frame_finish(struct mad_frame *); | |
| | | | |
| void mad_frame_mute(struct mad_frame *); | | void mad_frame_mute(struct mad_frame *); | |
| | | | |
| int mad_frame_header(struct mad_frame *, struct mad_stream *, | | int mad_frame_header(struct mad_frame *, struct mad_stream *, | |
| unsigned short *); | | unsigned short *); | |
| int mad_frame_decode(struct mad_frame *, struct mad_stream *); | | int mad_frame_decode(struct mad_frame *, struct mad_stream *); | |
| | | | |
| | | | |
End of changes. 8 change blocks. |
| 14 lines changed or deleted | | 24 lines changed or added | |
|
| libmad.h | | libmad.h | |
| | | | |
| skipping to change at line 19 | | skipping to change at line 19 | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | |
| * | | * | |
|
| * Id: version.h,v 1.15 2000/05/06 22:31:23 rob Exp | | * Id: version.h,v 1.17 2000/06/03 23:07:41 rob Exp | |
| */ | | */ | |
| | | | |
|
| # define MAD_VERSION "0.10.3 (beta)" | | # define MAD_VERSION "0.11.0 (beta)" | |
| # define MAD_PUBLISHYEAR "2000" | | # define MAD_PUBLISHYEAR "2000" | |
| # define MAD_AUTHOR "Robert Leslie" | | # define MAD_AUTHOR "Robert Leslie" | |
| # define MAD_EMAIL "rob@mars.org" | | # define MAD_EMAIL "rob@mars.org" | |
| | | | |
| extern char const mad_version[]; | | extern char const mad_version[]; | |
| extern char const mad_copyright[]; | | extern char const mad_copyright[]; | |
| extern char const mad_author[]; | | extern char const mad_author[]; | |
| extern char const mad_license[]; | | extern char const mad_license[]; | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 355 | | skipping to change at line 355 | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | |
| * | | * | |
|
| * Id: stream.h,v 1.6 2000/04/22 04:36:51 rob Exp | | * Id: stream.h,v 1.7 2000/06/03 23:07:41 rob Exp | |
| */ | | */ | |
| | | | |
| # ifndef STREAM_H | | # ifndef STREAM_H | |
| # define STREAM_H | | # define STREAM_H | |
| | | | |
| struct mad_stream { | | struct mad_stream { | |
| unsigned char const *buffer; /* input bitstream buffer */ | | unsigned char const *buffer; /* input bitstream buffer */ | |
| unsigned char const *bufend; /* end of buffer */ | | unsigned char const *bufend; /* end of buffer */ | |
| unsigned long skiplen; /* bytes to skip before next frame *
/ | | unsigned long skiplen; /* bytes to skip before next frame *
/ | |
| | | | |
| | | | |
| skipping to change at line 384 | | skipping to change at line 384 | |
| unsigned int anc_bitlen; /* number of ancillary bits */ | | unsigned int anc_bitlen; /* number of ancillary bits */ | |
| | | | |
| unsigned char (*main_data)[1935]; /* Layer III main_data */ | | unsigned char (*main_data)[1935]; /* Layer III main_data */ | |
| unsigned int md_len; /* bytes in main_data */ | | unsigned int md_len; /* bytes in main_data */ | |
| | | | |
| int error; /* error code (see below) */ | | int error; /* error code (see below) */ | |
| }; | | }; | |
| | | | |
| # define MAD_ERR_BUFLEN 0x0001 /* input buffer too small (o
r EOF) */ | | # define MAD_ERR_BUFLEN 0x0001 /* input buffer too small (o
r EOF) */ | |
| # define MAD_ERR_BUFPTR 0x0002 /* invalid (null) buffer poi
nter */ | | # define MAD_ERR_BUFPTR 0x0002 /* invalid (null) buffer poi
nter */ | |
|
| | | | |
| # define MAD_ERR_NOMEM 0x0031 /* not enough memory */ | | # define MAD_ERR_NOMEM 0x0031 /* not enough memory */ | |
| | | | |
| # define MAD_ERR_LOSTSYNC 0x0101 /* lost synchronization */ | | # define MAD_ERR_LOSTSYNC 0x0101 /* lost synchronization */ | |
|
| # define MAD_ERR_BADID 0x0102 /* bad header ID field */ | | # define MAD_ERR_BADLAYER 0x0102 /* reserved header layer value */ | |
| # define MAD_ERR_BADLAYER 0x0103 /* reserved header layer value */ | | # define MAD_ERR_BADBITRATE 0x0103 /* forbidden bitrate value */ | |
| # define MAD_ERR_BADBITRATE 0x0104 /* forbidden bitrate value */ | | # define MAD_ERR_BADSAMPLEFREQ 0x0104 /* reserved sample frequency value * | |
| # define MAD_ERR_BADSAMPLEFREQ 0x0105 /* reserved sample frequency value * | | / | |
| / | | # define MAD_ERR_BADEMPHASIS 0x0105 /* reserved emphasis value */ | |
| # define MAD_ERR_BADEMPHASIS 0x0106 /* reserved emphasis value */ | | | |
| | | | |
| # define MAD_ERR_BADCRC 0x0201 /* CRC check failed */ | | # define MAD_ERR_BADCRC 0x0201 /* CRC check failed */ | |
| # define MAD_ERR_BADBITALLOC 0x0211 /* forbidden bit allocation value */ | | # define MAD_ERR_BADBITALLOC 0x0211 /* forbidden bit allocation value */ | |
| # define MAD_ERR_BADSCALEFACTOR 0x0221 /* bad scalefactor index */ | | # define MAD_ERR_BADSCALEFACTOR 0x0221 /* bad scalefactor index */ | |
| # define MAD_ERR_BADFRAMELEN 0x0231 /* bad frame length */ | | # define MAD_ERR_BADFRAMELEN 0x0231 /* bad frame length */ | |
| # define MAD_ERR_BADBIGVALUES 0x0232 /* bad big_values count */ | | # define MAD_ERR_BADBIGVALUES 0x0232 /* bad big_values count */ | |
| # define MAD_ERR_BADBLOCKTYPE 0x0233 /* reserved block_type */ | | # define MAD_ERR_BADBLOCKTYPE 0x0233 /* reserved block_type */ | |
| # define MAD_ERR_BADDATAPTR 0x0234 /* bad main_data_begin pointer */ | | # define MAD_ERR_BADDATAPTR 0x0234 /* bad main_data_begin pointer */ | |
| # define MAD_ERR_BADDATALEN 0x0235 /* bad main data length */ | | # define MAD_ERR_BADDATALEN 0x0235 /* bad main data length */ | |
| # define MAD_ERR_BADPART3LEN 0x0236 /* bad audio data length */ | | # define MAD_ERR_BADPART3LEN 0x0236 /* bad audio data length */ | |
| | | | |
| skipping to change at line 438 | | skipping to change at line 438 | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | |
| * | | * | |
|
| * Id: frame.h,v 1.5 2000/04/22 04:36:50 rob Exp | | * Id: frame.h,v 1.6 2000/06/03 23:07:41 rob Exp | |
| */ | | */ | |
| | | | |
| # ifndef FRAME_H | | # ifndef FRAME_H | |
| # define FRAME_H | | # define FRAME_H | |
| | | | |
| struct mad_frame { | | struct mad_frame { | |
| int layer; /* audio layer (1, 2, or 3) */ | | int layer; /* audio layer (1, 2, or 3) */ | |
| int mode; /* channel mode (see below) */ | | int mode; /* channel mode (see below) */ | |
| int mode_ext; /* additional mode info */ | | int mode_ext; /* additional mode info */ | |
| int emphasis; /* de-emphasis to use (see b
elow) */ | | int emphasis; /* de-emphasis to use (see b
elow) */ | |
| | | | |
|
| unsigned int bitrate; /* stream bitrate (bps) */ | | unsigned long bitrate; /* stream bitrate (bps) */ | |
| unsigned int sfreq; /* sampling frequency (Hz) */ | | unsigned int sfreq; /* sampling frequency (Hz) */ | |
| | | | |
|
| struct mad_timer duration; /* audio playing time of frame */ | | int flags; /* flags (below) */ | |
| | | int private; /* private bits (below) */ | |
| | | | |
|
| int flags; /* flags and private bits (below) */ | | struct mad_timer duration; /* audio playing time of frame */ | |
| | | | |
| mad_fixed_t sbsample[2][36][32]; /* synthesis subband filter samples
*/ | | mad_fixed_t sbsample[2][36][32]; /* synthesis subband filter samples
*/ | |
| mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ | | mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ | |
| }; | | }; | |
| | | | |
| # define MAD_NUMCHANNELS(frame) ((frame)->mode ? 2 : 1) | | # define MAD_NUMCHANNELS(frame) ((frame)->mode ? 2 : 1) | |
|
| # define MAD_NUMSBSAMPLES(frame) ((frame)->layer == 1 ? 12 : 36) | | # define MAD_NUMSBSAMPLES(frame) \ | |
| | | ((frame)->layer == 1 ? 12 : \ | |
| | | (((frame)->layer == 3 && ((frame)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36) | |
| | | ) | |
| | | | |
| # define MAD_MODE_SINGLE_CHANNEL 0 | | # define MAD_MODE_SINGLE_CHANNEL 0 | |
| # define MAD_MODE_DUAL_CHANNEL 1 | | # define MAD_MODE_DUAL_CHANNEL 1 | |
| # define MAD_MODE_JOINT_STEREO 2 | | # define MAD_MODE_JOINT_STEREO 2 | |
| # define MAD_MODE_STEREO 3 | | # define MAD_MODE_STEREO 3 | |
| | | | |
| # define MAD_EMPH_NONE 0 /* no emphasis */ | | # define MAD_EMPH_NONE 0 /* no emphasis */ | |
| # define MAD_EMPH_50_15_MS 1 /* 50/15 microseconds */ | | # define MAD_EMPH_50_15_MS 1 /* 50/15 microseconds */ | |
| # define MAD_EMPH_CCITT_J_17 3 /* CCITT J.17 */ | | # define MAD_EMPH_CCITT_J_17 3 /* CCITT J.17 */ | |
| | | | |
|
| # define MAD_FLAG_PROTECTION 0x0100 /* frame has CRC protection */ | | # define MAD_FLAG_III_NPRIVATE 0x0007 /* number of Layer III private bits | |
| # define MAD_FLAG_COPYRIGHT 0x0200 /* frame is copyright */ | | */ | |
| # define MAD_FLAG_ORIGINAL 0x0400 /* frame is original (else copy) */ | | | |
| # define MAD_FLAG_PADDING 0x0800 /* frame has additional slot */ | | | |
| | | | |
|
| # define MAD_FLAG_I_STEREO 0x1000 /* uses intensity joint stereo */ | | # define MAD_FLAG_PROTECTION 0x0010 /* frame has CRC protection */ | |
| # define MAD_FLAG_MS_STEREO 0x2000 /* uses middle/side joint stereo */ | | # define MAD_FLAG_COPYRIGHT 0x0020 /* frame is copyright */ | |
| | | # define MAD_FLAG_ORIGINAL 0x0040 /* frame is original (else copy) */ | |
| | | # define MAD_FLAG_PADDING 0x0080 /* frame has additional slot */ | |
| | | | |
|
| # define MAD_FLAG_PRIVATE 0x0040 /* header private bit */ | | # define MAD_FLAG_I_STEREO 0x0100 /* uses intensity joint stereo */ | |
| # define MAD_FLAG_III_PRIVATE 0x001f /* Layer III private bits */ | | # define MAD_FLAG_MS_STEREO 0x0200 /* uses middle/side joint stereo */ | |
| # define MAD_FLAG_III_5BITPRIV 0x0020 /* 5 bits in III private (else 3) */ | | | |
| | | # define MAD_FLAG_LSF_EXT 0x1000 /* lower sampling freq. extension */ | |
| | | # define MAD_FLAG_MC_EXT 0x2000 /* multichannel audio extension */ | |
| | | | |
| | | # define MAD_PRIV_HEADER 0x0100 /* header private bit */ | |
| | | # define MAD_PRIV_III 0x001f /* Layer III private bits (up to 5) | |
| | | */ | |
| | | | |
| void mad_frame_init(struct mad_frame *); | | void mad_frame_init(struct mad_frame *); | |
| void mad_frame_finish(struct mad_frame *); | | void mad_frame_finish(struct mad_frame *); | |
| | | | |
| void mad_frame_mute(struct mad_frame *); | | void mad_frame_mute(struct mad_frame *); | |
| | | | |
| int mad_frame_header(struct mad_frame *, struct mad_stream *, | | int mad_frame_header(struct mad_frame *, struct mad_stream *, | |
| unsigned short *); | | unsigned short *); | |
| int mad_frame_decode(struct mad_frame *, struct mad_stream *); | | int mad_frame_decode(struct mad_frame *, struct mad_stream *); | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 23 lines changed or deleted | | 33 lines changed or added | |
|
| stream.h | | stream.h | |
| | | | |
| skipping to change at line 19 | | skipping to change at line 19 | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | |
| * | | * | |
|
| * $Id: stream.h,v 1.6 2000/04/22 04:36:51 rob Exp $ | | * $Id: stream.h,v 1.7 2000/06/03 23:07:41 rob Exp $ | |
| */ | | */ | |
| | | | |
| # ifndef STREAM_H | | # ifndef STREAM_H | |
| # define STREAM_H | | # define STREAM_H | |
| | | | |
| # include "bit.h" | | # include "bit.h" | |
| | | | |
| struct mad_stream { | | struct mad_stream { | |
| unsigned char const *buffer; /* input bitstream buffer */ | | unsigned char const *buffer; /* input bitstream buffer */ | |
| unsigned char const *bufend; /* end of buffer */ | | unsigned char const *bufend; /* end of buffer */ | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| unsigned int anc_bitlen; /* number of ancillary bits */ | | unsigned int anc_bitlen; /* number of ancillary bits */ | |
| | | | |
| unsigned char (*main_data)[1935]; /* Layer III main_data */ | | unsigned char (*main_data)[1935]; /* Layer III main_data */ | |
| unsigned int md_len; /* bytes in main_data */ | | unsigned int md_len; /* bytes in main_data */ | |
| | | | |
| int error; /* error code (see below) */ | | int error; /* error code (see below) */ | |
| }; | | }; | |
| | | | |
| # define MAD_ERR_BUFLEN 0x0001 /* input buffer too small (o
r EOF) */ | | # define MAD_ERR_BUFLEN 0x0001 /* input buffer too small (o
r EOF) */ | |
| # define MAD_ERR_BUFPTR 0x0002 /* invalid (null) buffer poi
nter */ | | # define MAD_ERR_BUFPTR 0x0002 /* invalid (null) buffer poi
nter */ | |
|
| | | | |
| # define MAD_ERR_NOMEM 0x0031 /* not enough memory */ | | # define MAD_ERR_NOMEM 0x0031 /* not enough memory */ | |
| | | | |
| # define MAD_ERR_LOSTSYNC 0x0101 /* lost synchronization */ | | # define MAD_ERR_LOSTSYNC 0x0101 /* lost synchronization */ | |
|
| # define MAD_ERR_BADID 0x0102 /* bad header ID field */ | | # define MAD_ERR_BADLAYER 0x0102 /* reserved header layer value */ | |
| # define MAD_ERR_BADLAYER 0x0103 /* reserved header layer value */ | | # define MAD_ERR_BADBITRATE 0x0103 /* forbidden bitrate value */ | |
| # define MAD_ERR_BADBITRATE 0x0104 /* forbidden bitrate value */ | | # define MAD_ERR_BADSAMPLEFREQ 0x0104 /* reserved sample frequency value * | |
| # define MAD_ERR_BADSAMPLEFREQ 0x0105 /* reserved sample frequency value * | | / | |
| / | | # define MAD_ERR_BADEMPHASIS 0x0105 /* reserved emphasis value */ | |
| # define MAD_ERR_BADEMPHASIS 0x0106 /* reserved emphasis value */ | | | |
| | | | |
| # define MAD_ERR_BADCRC 0x0201 /* CRC check failed */ | | # define MAD_ERR_BADCRC 0x0201 /* CRC check failed */ | |
| # define MAD_ERR_BADBITALLOC 0x0211 /* forbidden bit allocation value */ | | # define MAD_ERR_BADBITALLOC 0x0211 /* forbidden bit allocation value */ | |
| # define MAD_ERR_BADSCALEFACTOR 0x0221 /* bad scalefactor index */ | | # define MAD_ERR_BADSCALEFACTOR 0x0221 /* bad scalefactor index */ | |
| # define MAD_ERR_BADFRAMELEN 0x0231 /* bad frame length */ | | # define MAD_ERR_BADFRAMELEN 0x0231 /* bad frame length */ | |
| # define MAD_ERR_BADBIGVALUES 0x0232 /* bad big_values count */ | | # define MAD_ERR_BADBIGVALUES 0x0232 /* bad big_values count */ | |
| # define MAD_ERR_BADBLOCKTYPE 0x0233 /* reserved block_type */ | | # define MAD_ERR_BADBLOCKTYPE 0x0233 /* reserved block_type */ | |
| # define MAD_ERR_BADDATAPTR 0x0234 /* bad main_data_begin pointer */ | | # define MAD_ERR_BADDATAPTR 0x0234 /* bad main_data_begin pointer */ | |
| # define MAD_ERR_BADDATALEN 0x0235 /* bad main data length */ | | # define MAD_ERR_BADDATALEN 0x0235 /* bad main data length */ | |
| # define MAD_ERR_BADPART3LEN 0x0236 /* bad audio data length */ | | # define MAD_ERR_BADPART3LEN 0x0236 /* bad audio data length */ | |
| | | | |
End of changes. 3 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|