codec_internal.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
  5. * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
  6. * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
  9. * by Monty <monty@xiph.org> and the XIPHOPHORUS Company *
  10. * http://www.xiph.org/ *
  11. * *
  12. ********************************************************************
  13. function: libvorbis codec headers
  14. last mod: $Id: codec_internal.h,v 1.1.2.2 2000/11/04 06:21:43 xiphmont Exp $
  15. ********************************************************************/
  16. #ifndef _V_CODECI_H_
  17. #define _V_CODECI_H_
  18. #include "envelope.h"
  19. #include "codebook.h"
  20. #include "psy.h"
  21. typedef void vorbis_look_time;
  22. typedef void vorbis_look_mapping;
  23. typedef void vorbis_look_floor;
  24. typedef void vorbis_look_residue;
  25. typedef void vorbis_look_transform;
  26. typedef struct backend_lookup_state {
  27. /* local lookup storage */
  28. envelope_lookup *ve; /* envelope lookup */
  29. float **window[2][2][2]; /* block, leadin, leadout, type */
  30. vorbis_look_transform **transform[2]; /* block, type */
  31. codebook *fullbooks;
  32. /* backend lookups are tied to the mode, not the backend or naked mapping */
  33. int modebits;
  34. vorbis_look_mapping **mode;
  35. /* local storage, only used on the encoding side. This way the
  36. application does not need to worry about freeing some packets'
  37. memory and not others'; packet storage is always tracked.
  38. Cleared next call to a _dsp_ function */
  39. unsigned char *header;
  40. unsigned char *header1;
  41. unsigned char *header2;
  42. } backend_lookup_state;
  43. /* mode ************************************************************/
  44. typedef struct {
  45. int blockflag;
  46. int windowtype;
  47. int transformtype;
  48. int mapping;
  49. } vorbis_info_mode;
  50. typedef void vorbis_info_time;
  51. typedef void vorbis_info_floor;
  52. typedef void vorbis_info_residue;
  53. typedef void vorbis_info_mapping;
  54. /* vorbis_info contains all the setup information specific to the
  55. specific compression/decompression mode in progress (eg,
  56. psychoacoustic settings, channel setup, options, codebook
  57. etc).
  58. *********************************************************************/
  59. typedef struct codec_setup_info {
  60. /* Vorbis supports only short and long blocks, but allows the
  61. encoder to choose the sizes */
  62. long blocksizes[2];
  63. /* modes are the primary means of supporting on-the-fly different
  64. blocksizes, different channel mappings (LR or mid-side),
  65. different residue backends, etc. Each mode consists of a
  66. blocksize flag and a mapping (along with the mapping setup */
  67. int modes;
  68. int maps;
  69. int times;
  70. int floors;
  71. int residues;
  72. int books;
  73. int psys; /* encode only */
  74. vorbis_info_mode *mode_param[64];
  75. int map_type[64];
  76. vorbis_info_mapping *map_param[64];
  77. int time_type[64];
  78. vorbis_info_time *time_param[64];
  79. int floor_type[64];
  80. vorbis_info_floor *floor_param[64];
  81. int residue_type[64];
  82. vorbis_info_residue *residue_param[64];
  83. static_codebook *book_param[256];
  84. vorbis_info_psy *psy_param[64]; /* encode only */
  85. /* for block long/sort tuning; encode only */
  86. int envelopesa;
  87. float preecho_thresh;
  88. float preecho_clamp;
  89. float preecho_minenergy;
  90. } codec_setup_info;
  91. #endif