codec_internal.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
  9. * by the XIPHOPHORUS Company http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: libvorbis codec headers
  13. last mod: $Id: codec_internal.h,v 1.15 2002/06/28 22:19:35 xiphmont Exp $
  14. ********************************************************************/
  15. #ifndef _V_CODECI_H_
  16. #define _V_CODECI_H_
  17. #include "envelope.h"
  18. #include "codebook.h"
  19. #define BLOCKTYPE_IMPULSE 0
  20. #define BLOCKTYPE_PADDING 1
  21. #define BLOCKTYPE_TRANSITION 0
  22. #define BLOCKTYPE_LONG 1
  23. #define PACKETBLOBS 15
  24. typedef struct vorbis_block_internal{
  25. float **pcmdelay; /* this is a pointer into local storage */
  26. float ampmax;
  27. int blocktype;
  28. ogg_uint32_t packetblob_markers[PACKETBLOBS];
  29. } vorbis_block_internal;
  30. typedef void vorbis_look_floor;
  31. typedef void vorbis_look_residue;
  32. typedef void vorbis_look_transform;
  33. /* mode ************************************************************/
  34. typedef struct {
  35. int blockflag;
  36. int windowtype;
  37. int transformtype;
  38. int mapping;
  39. } vorbis_info_mode;
  40. typedef void vorbis_info_floor;
  41. typedef void vorbis_info_residue;
  42. typedef void vorbis_info_mapping;
  43. #include "psy.h"
  44. #include "bitrate.h"
  45. typedef struct backend_lookup_state {
  46. /* local lookup storage */
  47. envelope_lookup *ve; /* envelope lookup */
  48. float *window[2];
  49. vorbis_look_transform **transform[2]; /* block, type */
  50. drft_lookup fft_look[2];
  51. int modebits;
  52. vorbis_look_floor **flr;
  53. vorbis_look_residue **residue;
  54. vorbis_look_psy *psy;
  55. vorbis_look_psy_global *psy_g_look;
  56. /* local storage, only used on the encoding side. This way the
  57. application does not need to worry about freeing some packets'
  58. memory and not others'; packet storage is always tracked.
  59. Cleared next call to a _dsp_ function */
  60. unsigned char *header;
  61. unsigned char *header1;
  62. unsigned char *header2;
  63. bitrate_manager_state bms;
  64. } backend_lookup_state;
  65. /* codec_setup_info contains all the setup information specific to the
  66. specific compression/decompression mode in progress (eg,
  67. psychoacoustic settings, channel setup, options, codebook
  68. etc).
  69. *********************************************************************/
  70. #include "highlevel.h"
  71. typedef struct codec_setup_info {
  72. /* Vorbis supports only short and long blocks, but allows the
  73. encoder to choose the sizes */
  74. long blocksizes[2];
  75. /* modes are the primary means of supporting on-the-fly different
  76. blocksizes, different channel mappings (LR or M/A),
  77. different residue backends, etc. Each mode consists of a
  78. blocksize flag and a mapping (along with the mapping setup */
  79. int modes;
  80. int maps;
  81. int floors;
  82. int residues;
  83. int books;
  84. int psys; /* encode only */
  85. vorbis_info_mode *mode_param[64];
  86. int map_type[64];
  87. vorbis_info_mapping *map_param[64];
  88. int floor_type[64];
  89. vorbis_info_floor *floor_param[64];
  90. int residue_type[64];
  91. vorbis_info_residue *residue_param[64];
  92. static_codebook *book_param[256];
  93. codebook *fullbooks;
  94. vorbis_info_psy *psy_param[4]; /* encode only */
  95. vorbis_info_psy_global psy_g_param;
  96. bitrate_manager_info bi;
  97. highlevel_encode_setup hi; /* used only by vorbisenc.c. It's a
  98. highly redundant structure, but
  99. improves clarity of program flow. */
  100. } codec_setup_info;
  101. extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
  102. extern void _vp_global_free(vorbis_look_psy_global *look);
  103. #endif