mhead.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef MHEAD_H
  2. #define MHEAD_H
  3. /*____________________________________________________________________________
  4. FreeAmp - The Free MP3 Player
  5. MP3 Decoder originally Copyright (C) 1995-1997 Xing Technology
  6. Corp. http://www.xingtech.com
  7. Portions Copyright (C) 1998 EMusic.com
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. $Id: mhead.h,v 1.3 1999/10/19 07:13:08 elrod Exp $
  20. ____________________________________________________________________________*/
  21. /* portable copy of eco\mhead.h */
  22. /* mpeg audio header */
  23. typedef struct
  24. {
  25. int sync; /* 1 if valid sync */
  26. int id;
  27. int option;
  28. int prot;
  29. int br_index;
  30. int sr_index;
  31. int pad;
  32. int private_bit;
  33. int mode;
  34. int mode_ext;
  35. int cr;
  36. int original;
  37. int emphasis;
  38. }
  39. MPEG_HEAD;
  40. /* portable mpeg audio decoder, decoder functions */
  41. #ifndef IN_OUT
  42. #include "small_header.h"
  43. #endif
  44. typedef struct
  45. {
  46. int channels;
  47. int outvalues;
  48. long samprate;
  49. int bits;
  50. int framebytes;
  51. int type;
  52. }
  53. DEC_INFO;
  54. #ifdef __cplusplus
  55. extern "C"
  56. {
  57. #endif
  58. int head_info(unsigned char *buf, unsigned int n, MPEG_HEAD * h);
  59. int head_info2(unsigned char *buf,
  60. unsigned int n, MPEG_HEAD * h, int *br);
  61. int head_info3(unsigned char *buf, unsigned int n, MPEG_HEAD *h, int*br, unsigned int *searchForward);
  62. /* head_info returns framebytes > 0 for success */
  63. /* audio_decode_init returns 1 for success, 0 for fail */
  64. /* audio_decode returns in_bytes = 0 on sync loss */
  65. int audio_decode_init(MPEG_HEAD * h, int framebytes_arg,
  66. int reduction_code, int transform_code, int convert_code,
  67. int freq_limit);
  68. void audio_decode_info(DEC_INFO * info);
  69. IN_OUT audio_decode(unsigned char *bs, short *pcm, unsigned char *pNextByteAfterData);
  70. int audio_decode8_init(MPEG_HEAD * h, int framebytes_arg,
  71. int reduction_code, int transform_code, int convert_code,
  72. int freq_limit);
  73. void audio_decode8_info(DEC_INFO * info);
  74. IN_OUT audio_decode8(unsigned char *bs, short *pcmbuf);
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #pragma warning(disable:4711) // function 'xxxx' selected for automatic inline expansion
  79. #endif // #ifndef MHEAD_H