mpglib.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. #include "lame.h"
  24. #ifndef plotting_data_defined
  25. #define plotting_data_defined
  26. struct plotting_data;
  27. typedef struct plotting_data plotting_data;
  28. #endif
  29. extern void lame_report_fnc(lame_report_function f, const char *format, ...);
  30. struct buf {
  31. unsigned char *pnt;
  32. long size;
  33. long pos;
  34. struct buf *next;
  35. struct buf *prev;
  36. };
  37. struct framebuf {
  38. struct buf *buf;
  39. long pos;
  40. struct frame *next;
  41. struct frame *prev;
  42. };
  43. typedef struct mpstr_tag {
  44. struct buf *head, *tail; /* buffer linked list pointers, tail points to oldest buffer */
  45. int vbr_header; /* 1 if valid Xing vbr header detected */
  46. int num_frames; /* set if vbr header present */
  47. int enc_delay; /* set if vbr header present */
  48. int enc_padding; /* set if vbr header present */
  49. /* header_parsed, side_parsed and data_parsed must be all set 1
  50. before the full frame has been parsed */
  51. int header_parsed; /* 1 = header of current frame has been parsed */
  52. int side_parsed; /* 1 = header of sideinfo of current frame has been parsed */
  53. int data_parsed;
  54. int free_format; /* 1 = free format frame */
  55. int old_free_format; /* 1 = last frame was free format */
  56. int bsize;
  57. int framesize;
  58. int ssize; /* number of bytes used for side information, including 2 bytes for CRC-16 if present */
  59. int dsize;
  60. int fsizeold; /* size of previous frame, -1 for first */
  61. int fsizeold_nopadding;
  62. struct frame fr; /* holds the parameters decoded from the header */
  63. struct III_sideinfo sideinfo;
  64. unsigned char bsspace[2][MAXFRAMESIZE + 1024]; /* bit stream space used ???? */ /* MAXFRAMESIZE */
  65. real hybrid_block[2][2][SBLIMIT * SSLIMIT];
  66. int hybrid_blc[2];
  67. unsigned long header;
  68. int bsnum;
  69. real synth_buffs[2][2][0x110];
  70. int synth_bo;
  71. int sync_bitstream; /* 1 = bitstream is yet to be synchronized */
  72. int bitindex;
  73. unsigned char *wordpointer;
  74. plotting_data *pinfo;
  75. lame_report_function report_msg;
  76. lame_report_function report_dbg;
  77. lame_report_function report_err;
  78. } MPSTR, *PMPSTR;
  79. #define MP3_ERR -1
  80. #define MP3_OK 0
  81. #define MP3_NEED_MORE 1
  82. #endif /* _MPGLIB_H_ */