1 /* 2 * Copyright (C) 1999-2010 The L.A.M.E. project 3 * 4 * Initially written by Michael Hipp, see also AUTHORS and README. 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library 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 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 * Boston, MA 02111-1307, USA. 20 */ 21 #ifndef _MPGLIB_H_ 22 #define _MPGLIB_H_ 23 24 #include "lame.h" 25 26 #ifndef plotting_data_defined 27 #define plotting_data_defined 28 struct plotting_data; 29 typedef struct plotting_data plotting_data; 30 #endif 31 32 33 extern void lame_report_fnc(lame_report_function f, const char *format, ...); 34 35 struct buf { 36 unsigned char *pnt; 37 long size; 38 long pos; 39 struct buf *next; 40 struct buf *prev; 41 }; 42 43 struct framebuf { 44 struct buf *buf; 45 long pos; 46 struct frame *next; 47 struct frame *prev; 48 }; 49 50 typedef struct mpstr_tag { 51 struct buf *head, *tail; /* buffer linked list pointers, tail points to oldest buffer */ 52 int vbr_header; /* 1 if valid Xing vbr header detected */ 53 int num_frames; /* set if vbr header present */ 54 int enc_delay; /* set if vbr header present */ 55 int enc_padding; /* set if vbr header present */ 56 /* header_parsed, side_parsed and data_parsed must be all set 1 57 before the full frame has been parsed */ 58 int header_parsed; /* 1 = header of current frame has been parsed */ 59 int side_parsed; /* 1 = header of sideinfo of current frame has been parsed */ 60 int data_parsed; 61 int free_format; /* 1 = free format frame */ 62 int old_free_format; /* 1 = last frame was free format */ 63 int bsize; 64 int framesize; 65 int ssize; /* number of bytes used for side information, including 2 bytes for CRC-16 if present */ 66 int dsize; 67 int fsizeold; /* size of previous frame, -1 for first */ 68 int fsizeold_nopadding; 69 struct frame fr; /* holds the parameters decoded from the header */ 70 struct III_sideinfo sideinfo; 71 unsigned char bsspace[2][MAXFRAMESIZE + 1024]; /* bit stream space used ???? */ /* MAXFRAMESIZE */ 72 real hybrid_block[2][2][SBLIMIT * SSLIMIT]; 73 int hybrid_blc[2]; 74 unsigned long header; 75 int bsnum; 76 real synth_buffs[2][2][0x110]; 77 int synth_bo; 78 int sync_bitstream; /* 1 = bitstream is yet to be synchronized */ 79 80 int bitindex; 81 unsigned char *wordpointer; 82 plotting_data *pinfo; 83 84 lame_report_function report_msg; 85 lame_report_function report_dbg; 86 lame_report_function report_err; 87 } MPSTR, *PMPSTR; 88 89 90 #define MP3_ERR -1 91 #define MP3_OK 0 92 #define MP3_NEED_MORE 1 93 94 95 96 #endif /* _MPGLIB_H_ */ 97