Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
6.8 KiB

  1. /*
  2. * Project: Direct Subband about 13000 bps coder and QUATERDECK 4160 bps decoder (LPC10 based)
  3. * Workfile: data.h
  4. * Author: Georges Zanellato, Alfred Wiesen
  5. * Created: 30 August 1995
  6. * Last update: 26 October 1995
  7. * DLL Version: 1.00
  8. * Revision:
  9. * Comment:
  10. *
  11. * (C) Copyright 1993-95 Lernout & Hauspie Speech Products N.V. (TM)
  12. * All rights reserved. Company confidential.
  13. */
  14. // ------------------------------------------------------------------------
  15. // ------------------------------------------------------------------------
  16. // Constant definitions
  17. // ------------------------------------------------------------------------
  18. // ------------------------------------------------------------------------
  19. #define Fil_Lenght 8 // QMF filter lenght
  20. #define L_RES 128 // Subband frame lenght
  21. #define N_SB 3 // power(2,N_SB) = Number subband
  22. #define NETAGES 10 // Filter order
  23. #define NECHFEN 220 // Total window length
  24. #define FACTRECO 60 // Overlap length
  25. #define RECS2 30 // Half overlap length
  26. #define NECHDECAL 160 // Input frame size
  27. #define DECAL 160 // Input frame size
  28. #define SOUDECAL1 54 // First subframe size
  29. #define SOUDECAL 53 // Second and third subframe size
  30. #define LIM_P1 20 // Lowest possible value for PITCH
  31. #define LIM_P2 110 // Highest possible value for PITCH
  32. #define lngEE 148 // Excitation vector length
  33. #include "variable.h"
  34. // ------------------------------------------------------------------------
  35. // ------------------------------------------------------------------------
  36. // Data types definitions
  37. // ------------------------------------------------------------------------
  38. // ------------------------------------------------------------------------
  39. typedef short VAUTOC [NETAGES+1];
  40. typedef short VEE [lngEE];
  41. typedef short VSOU [SOUDECAL1];
  42. // ------------------------------------------------------------------------
  43. // ------------------------------------------------------------------------
  44. // Instance data for coder
  45. // ------------------------------------------------------------------------
  46. // ------------------------------------------------------------------------
  47. typedef struct C16008Data_Tag
  48. {
  49. // PhilF: This field needs to be at the top so that it can be accessed
  50. // by casting to PC16008DATA or PC4808DATA
  51. DWORD dwMaxBitRate;
  52. // Long term
  53. short zx0_i[2];
  54. // Long term
  55. short QMF_MEM_ANAL_I[112]; // Memory of QMF filter during analysis
  56. short memBP[9];
  57. // float Zb[5],Za[5]; // long term decimator
  58. // float mem1[2];
  59. #ifdef _X86_
  60. short imem1[2];
  61. #else
  62. int imem1[23];
  63. unsigned int uiDelayPosition;
  64. int iInputStreamTime;
  65. int iOutputStreamTime;
  66. #endif
  67. long memory[20];
  68. long nbbit[NBFAC];
  69. short nbsb_sp;
  70. short DIV_MAX; // div. factor for the greatest max of a the sb of a sp frame
  71. short MAX_LEVEL; // threshold below which a sb is replaced by white noise
  72. short NBSB_SP_MAX; // max nbr of sb treated as speech
  73. short nbbit_cf; // nber of bits required by the current frame of speech
  74. // PhilF: Since these depend on the bit rate, moved them from global to here...
  75. short quantif[2*NBSB_SP_MAX1_8000_12000]; //={QUANT_LEVELS};
  76. short bits[NBSB_SP_MAX1_8000_12000]; //={CODING_BITS};
  77. short codes_max[8]; // Quantized max. of each subband
  78. long codes_sb[16]; // Two codes for each of the quantified subbands
  79. short indic_sp[8]; // type of subband (0=noise; 1=speech)
  80. short DATA_I[512]; // Intermediate vector = input and output of QMF
  81. char stream[MAX_OUTPUT_BYTES_16000];
  82. } C16008DATA, *PC16008DATA;
  83. #ifdef CELP4800
  84. typedef struct C4808Data_Tag
  85. {
  86. // PhilF: This field needs to be at the top so that it can be accessed
  87. // by casting to PC16008DATA or PC4808DATA
  88. DWORD dwMaxBitRate;
  89. long DMSY[13]; // Synthesis memory filter
  90. short MINV[13]; // Filter memory
  91. short SIG[NECHFEN+SOUDECAL],M_PIT[160]; // Computation signal vectors
  92. VSOU E,E_PE; // Excitation vectors
  93. VEE EE; // Excitation vector
  94. short mem2[2]; // Input filter memory
  95. short mem_pit[2]; // Pitch memory
  96. short LSP0[10]; // LSP memory
  97. short SIG_CALP[380]; // RAM
  98. short UNVOIS,PITCH,SOULONG; // RAM
  99. long a,b; // RAM
  100. short ialf;
  101. long TLSP[24],VMAX[9]; // RAM
  102. long veci1[10],veci2[10],veci3[10]; // RAM
  103. long ttt[11]; // RAM
  104. short SIGPI[2*NECHDECAL+FACTRECO]; // RAM
  105. short zz[12];
  106. VAUTOC A1,A2,A3,Aw,LSP; // RAM
  107. VSOU H; // RAM
  108. short GLTP; // RAM
  109. short code[22]; // RAM
  110. short output_frame[6];
  111. short depl;
  112. short *ptr1; // RAM
  113. } C4808DATA, *PC4808DATA, *LPC4808DATA;
  114. #endif
  115. // ------------------------------------------------------------------------
  116. // ------------------------------------------------------------------------
  117. // Instance data for decoder
  118. // ------------------------------------------------------------------------
  119. // ------------------------------------------------------------------------
  120. typedef struct D16008Data_Tag
  121. {
  122. // PhilF: This field needs to be at the top so that it can be accessed
  123. // by casting to PD16008DATA or PD4808DATA
  124. DWORD dwMaxBitRate;
  125. long memfil[20];
  126. short QMF_MEM_SYNT_I[112]; // Memory of QMF filter during synthesis
  127. // float mem2[2];
  128. #ifdef _X86_
  129. short imem2[2];
  130. #else
  131. int imem2[56];
  132. unsigned int uiDelayPosition;
  133. int iInputStreamTime;
  134. int iOutputStreamTime;
  135. #endif
  136. short out_mem[4];
  137. short out_mem2[20];
  138. long memory[20];
  139. short mem1,mem2;
  140. // PhilF: Since these depend on the bit rate, moved them from global to here...
  141. short quantif[2*NBSB_SP_MAX1_8000_12000]; //={QUANT_LEVELS};
  142. short bits[NBSB_SP_MAX1_8000_12000]; //={CODING_BITS};
  143. long lRand;
  144. short synth_speech[224];
  145. short d_codes_max[8]; // Quantified max. of each subband
  146. long d_codes_sb[16]; // Two codes for each of the quantified subbands
  147. short d_indic_sp[8]; // type of subband (0=noise; 1=speech)
  148. short d_DATA_I[512]; // Intermediate vector = input and output of QMF
  149. char d_stream[MAX_OUTPUT_BYTES_16000];
  150. short d_num_bandes;
  151. } D16008DATA, *PD16008DATA;
  152. #ifdef CELP4800
  153. typedef struct D4808Data_Tag
  154. {
  155. // PhilF: This field needs to be at the top so that it can be accessed
  156. // by casting to PD16008DATA or PD4808DATA
  157. DWORD dwMaxBitRate;
  158. long memfil[32]; // Synthesis filter memory
  159. short MSYNTH[13]; // Filter memory
  160. VSOU E; // Excitation vector
  161. VEE EE,EEE; // Excitation vectors
  162. short LSP0[10]; // LSP memory
  163. short PITCH,SOULONG; // RAM
  164. long TLSP[24]; // RAM
  165. VAUTOC A1,A2,A3,LSP; // RAM
  166. short GLTP;
  167. short ss[DECAL]; // RAM
  168. short code[22]; // RAM
  169. short frame[6]; // RAM
  170. short depl; // RAM
  171. } D4808DATA, *PD4808DATA, *LPD4808DATA;
  172. #endif