Advertisement
art_sta

Untitled

Feb 27th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. /***************************************************************************************************
  2. Project:
  3. Project desc.: Software MP3 decoder for dsPIC33
  4. Author:
  5.  
  6. ***************************************************************************************************
  7. Distribution:
  8.  
  9. libmad - MPEG audio decoder library
  10. -----------------------------------
  11.  
  12. Copyright (C) 2000-2004 Underbit Technologies, Inc.
  13.  
  14. This program is free software; you can redistribute it and/or modify it under the terms of the
  15. GNU General Public License as published by the Free Software Foundation; either version 2 of
  16. the License, or (at your option) any later version.
  17.  
  18. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  19. without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. See the GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License along with this program; if
  23. not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. MA 02111-1307 USA
  25.  
  26. ***************************************************************************************************
  27. Compiled Using: Microchip C30 V.3.1
  28. Processor: dsPIC33 Family
  29.  
  30. **************************************************************************************************
  31. File: mad_decoder.h
  32. Description:
  33.  
  34. ***************************************************************************************************
  35. History: 2007/12/11 [GS] File created
  36.  
  37.  
  38. **************************************************************************************************/
  39.  
  40. #ifndef __MAD_DECODER_H
  41. #define __MAD_DECODER_H
  42.  
  43. /***************************************************************************************************
  44. Included Files
  45. **************************************************************************************************/
  46.  
  47. /***************************************************************************************************
  48. Definitions
  49. **************************************************************************************************/
  50.  
  51. /***************************************************************************************************
  52. Public Types
  53. **************************************************************************************************/
  54.  
  55. typedef enum __MAD_DECODER_MODE
  56. {
  57. MAD_DECODER_MODE_SYNC = 0,
  58. MAD_DECODER_MODE_ASYNC = 1
  59. } MAD_DECODER_MODE;
  60.  
  61. typedef enum __MAD_FLOW
  62. {
  63. MAD_FLOW_CONTINUE = 0x0000, /* continue normally */
  64. MAD_FLOW_STOP = 0x0010, /* stop decoding normally */
  65. MAD_FLOW_BREAK = 0x0011, /* stop decoding and signal an error */
  66. MAD_FLOW_IGNORE = 0x0020 /* ignore the current frame */
  67. } MAD_FLOW;
  68.  
  69. typedef struct __MAD_ASYNC
  70. {
  71. S32 pid;
  72. SWORD in;
  73. SWORD out;
  74. } MAD_ASYNC;
  75.  
  76. typedef struct __MAD_SYNC
  77. {
  78. MAD_STREAM stream;
  79. MAD_FRAME frame;
  80. MAD_SYNTH synth;
  81. } MAD_SYNC;
  82.  
  83. typedef struct __MAD_DECODER
  84. {
  85. MAD_OPTION options;
  86. MAD_SYNC *sync;
  87. void *cb_data;
  88.  
  89. MAD_FLOW (*input_func) (void *, MAD_STREAM *);
  90. MAD_FLOW (*header_func) (void *, MAD_HEADER *);
  91. MAD_FLOW (*filter_func) (void *, MAD_STREAM *, MAD_FRAME *);
  92. MAD_FLOW (*output_func) (void *, MAD_HEADER *, MAD_PCM *);
  93. MAD_FLOW (*error_func) (void *, MAD_STREAM *, MAD_FRAME *);
  94. MAD_FLOW (*message_func)(void *, void *, UWORD *);
  95. } MAD_DECODER;
  96.  
  97. /* private message buffer */
  98.  
  99. typedef struct __BUFFER
  100. {
  101. U08 *start;
  102. U32 length;
  103. } BUFFER;
  104.  
  105. /***************************************************************************************************
  106. Global Variables
  107. **************************************************************************************************/
  108.  
  109. /***************************************************************************************************
  110. Public Function Prototypes
  111. **************************************************************************************************/
  112.  
  113. void mad_decoder_init(MAD_DECODER *decoder,
  114. void *data,
  115. MAD_FLOW (*input_func) (void *, MAD_STREAM *),
  116. MAD_FLOW (*header_func) (void *, MAD_HEADER *),
  117. MAD_FLOW (*filter_func) (void *, MAD_STREAM *, MAD_FRAME *),
  118. MAD_FLOW (*output_func) (void *, MAD_HEADER *, MAD_PCM *),
  119. MAD_FLOW (*error_func) (void *, MAD_STREAM *, MAD_FRAME *),
  120. MAD_FLOW (*message_func)(void *, void *, UWORD *)
  121. );
  122.  
  123. MAD_RETVAL mad_decoder_run(MAD_DECODER *decoder);
  124. MAD_RETVAL mad_decoder_finish(MAD_DECODER *decoder);
  125.  
  126. #endif /* __MAD_DECODER_H */
  127. /***************************************************************************************************
  128. end of file: mad_decoder.h
  129. **************************************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement