home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / opus / v5 / amipeg / source / decoders.c < prev    next >
C/C++ Source or Header  |  1977-12-31  |  14KB  |  390 lines

  1. /*
  2.  * decoders.c
  3.  *
  4.  * This file contains all the routines for Huffman decoding required in MPEG
  5.  *
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include "decoders.h"
  10. #include "util.h" 
  11. #include "video.h"
  12. #include "proto.h"
  13.  
  14. /* Decoding table for macroblock_address_increment */
  15. mb_addr_inc_entry     mb_addr_inc[2048];
  16.  
  17. /* Decoding table for macroblock_type in intra-coded pictures */
  18. mb_type_entry         mb_type_I[4] = { {ERROR,0}, {17,2}, {1,1}, {1,1} };
  19.  
  20. /* Decoding table for macroblock_type in predictive-coded pictures */
  21. mb_type_entry         mb_type_P[64];
  22.  
  23. /* Decoding table for macroblock_type in bidirectionally-coded pictures */
  24. mb_type_entry         mb_type_B[64];
  25.  
  26. /* Decoding table for motion vectors */
  27. motion_vectors_entry  motion_vectors[2048];
  28.  
  29.  
  30. /* DCT coeff tables. */
  31.  
  32. unsigned short int dct_coeff_tbl_0[256] = {
  33. 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 
  34. 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 
  35. 0x052f, 0x051f, 0x050f, 0x04ff, 0x183f, 0x402f, 0x3c2f, 0x382f, 
  36. 0x342f, 0x302f, 0x2c2f, 0x7c1f, 0x781f, 0x741f, 0x701f, 0x6c1f, 
  37. 0x028e, 0x028e, 0x027e, 0x027e, 0x026e, 0x026e, 0x025e, 0x025e, 
  38. 0x024e, 0x024e, 0x023e, 0x023e, 0x022e, 0x022e, 0x021e, 0x021e, 
  39. 0x020e, 0x020e, 0x04ee, 0x04ee, 0x04de, 0x04de, 0x04ce, 0x04ce, 
  40. 0x04be, 0x04be, 0x04ae, 0x04ae, 0x049e, 0x049e, 0x048e, 0x048e, 
  41. 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 
  42. 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01cd, 0x01cd, 0x01cd, 0x01cd, 
  43. 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01ad, 0x01ad, 0x01ad, 0x01ad, 
  44. 0x019d, 0x019d, 0x019d, 0x019d, 0x018d, 0x018d, 0x018d, 0x018d, 
  45. 0x017d, 0x017d, 0x017d, 0x017d, 0x016d, 0x016d, 0x016d, 0x016d, 
  46. 0x015d, 0x015d, 0x015d, 0x015d, 0x014d, 0x014d, 0x014d, 0x014d, 
  47. 0x013d, 0x013d, 0x013d, 0x013d, 0x012d, 0x012d, 0x012d, 0x012d, 
  48. 0x011d, 0x011d, 0x011d, 0x011d, 0x010d, 0x010d, 0x010d, 0x010d, 
  49. 0x282c, 0x282c, 0x282c, 0x282c, 0x282c, 0x282c, 0x282c, 0x282c, 
  50. 0x242c, 0x242c, 0x242c, 0x242c, 0x242c, 0x242c, 0x242c, 0x242c, 
  51. 0x143c, 0x143c, 0x143c, 0x143c, 0x143c, 0x143c, 0x143c, 0x143c, 
  52. 0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, 
  53. 0x085c, 0x085c, 0x085c, 0x085c, 0x085c, 0x085c, 0x085c, 0x085c, 
  54. 0x047c, 0x047c, 0x047c, 0x047c, 0x047c, 0x047c, 0x047c, 0x047c, 
  55. 0x046c, 0x046c, 0x046c, 0x046c, 0x046c, 0x046c, 0x046c, 0x046c, 
  56. 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 
  57. 0x00ec, 0x00ec, 0x00ec, 0x00ec, 0x00ec, 0x00ec, 0x00ec, 0x00ec, 
  58. 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 
  59. 0x00cc, 0x00cc, 0x00cc, 0x00cc, 0x00cc, 0x00cc, 0x00cc, 0x00cc, 
  60. 0x681c, 0x681c, 0x681c, 0x681c, 0x681c, 0x681c, 0x681c, 0x681c, 
  61. 0x641c, 0x641c, 0x641c, 0x641c, 0x641c, 0x641c, 0x641c, 0x641c, 
  62. 0x601c, 0x601c, 0x601c, 0x601c, 0x601c, 0x601c, 0x601c, 0x601c, 
  63. 0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, 
  64. 0x581c, 0x581c, 0x581c, 0x581c, 0x581c, 0x581c, 0x581c, 0x581c
  65. };
  66.  
  67. unsigned short int dct_coeff_tbl_1[16] = {
  68. 0x00bb, 0x202b, 0x103b, 0x00ab, 0x084b, 0x1c2b, 0x541b, 0x501b, 
  69. 0x009b, 0x4c1b, 0x481b, 0x045b, 0x0c3b, 0x008b, 0x182b, 0x441b
  70. };
  71.  
  72. unsigned short int dct_coeff_tbl_2[4] = {
  73. 0x4019, 0x1429, 0x0079, 0x0839
  74. };
  75.  
  76. unsigned short int dct_coeff_tbl_3[4] = {
  77. 0x0449, 0x3c19, 0x3819, 0x1029
  78. };
  79.  
  80. unsigned short int dct_coeff_next[256] = {
  81. 0xffff, 0xffff, 0xffff, 0xffff, 0xf7d5, 0xf7d5, 0xf7d5, 0xf7d5, 
  82. 0x0826, 0x0826, 0x2416, 0x2416, 0x0046, 0x0046, 0x2016, 0x2016, 
  83. 0x1c15, 0x1c15, 0x1c15, 0x1c15, 0x1815, 0x1815, 0x1815, 0x1815, 
  84. 0x0425, 0x0425, 0x0425, 0x0425, 0x1415, 0x1415, 0x1415, 0x1415, 
  85. 0x3417, 0x0067, 0x3017, 0x2c17, 0x0c27, 0x0437, 0x0057, 0x2817, 
  86. 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 
  87. 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 
  88. 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 
  89. 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 
  90. 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 
  91. 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 
  92. 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 
  93. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  94. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  95. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  96. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  97. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  98. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  99. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  100. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  101. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  102. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  103. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  104. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  105. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 
  106. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 
  107. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 
  108. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 
  109. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 
  110. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 
  111. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 
  112. 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011
  113. };
  114.  
  115. unsigned short int dct_coeff_first[256] = {
  116. 0xffff, 0xffff, 0xffff, 0xffff, 0xf7d5, 0xf7d5, 0xf7d5, 0xf7d5, 
  117. 0x0826, 0x0826, 0x2416, 0x2416, 0x0046, 0x0046, 0x2016, 0x2016, 
  118. 0x1c15, 0x1c15, 0x1c15, 0x1c15, 0x1815, 0x1815, 0x1815, 0x1815, 
  119. 0x0425, 0x0425, 0x0425, 0x0425, 0x1415, 0x1415, 0x1415, 0x1415, 
  120. 0x3417, 0x0067, 0x3017, 0x2c17, 0x0c27, 0x0437, 0x0057, 0x2817, 
  121. 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 
  122. 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 0x1014, 
  123. 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 0x0c14, 
  124. 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 
  125. 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 
  126. 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 
  127. 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 0x0813, 
  128. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  129. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  130. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  131. 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 0x0412, 
  132. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  133. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  134. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  135. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  136. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  137. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  138. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  139. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  140. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  141. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  142. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  143. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  144. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  145. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  146. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 
  147. 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010
  148. };
  149.  
  150.  
  151.  
  152. /*
  153.  *--------------------------------------------------------------
  154.  *
  155.  * init_mb_addr_inc --
  156.  *
  157.  *    Initialize the VLC decoding table for macro_block_address_increment
  158.  *
  159.  * Results:
  160.  *    The decoding table for macro_block_address_increment will
  161.  *      be filled; illegal values will be filled as ERROR.
  162.  *
  163.  * Side effects:
  164.  *    The global array mb_addr_inc will be filled.
  165.  *
  166.  *--------------------------------------------------------------
  167.  */
  168.  
  169. /* Macro for filling up the decoding table for mb_addr_inc */
  170. #define ASSIGN1(start, end, step, val, num) \
  171.   for (i = start; i < end; i+= step) { \
  172.     for (j = 0; j < step; j++) { \
  173.       mb_addr_inc[i+j].value = val; \
  174.       mb_addr_inc[i+j].num_bits = num; \
  175.     } \
  176.     val--; \
  177.     }
  178.  
  179. static void init_mb_addr_inc(void)
  180. {
  181.   int i, j, val;
  182.  
  183.   for (i = 0; i < 8; i++) {
  184.     mb_addr_inc[i].value = ERROR;
  185.     mb_addr_inc[i].num_bits = 0;
  186.   }
  187.  
  188.   mb_addr_inc[8].value = MACRO_BLOCK_ESCAPE;
  189.   mb_addr_inc[8].num_bits = 11;
  190.  
  191.   for (i = 9; i < 15; i++) {
  192.     mb_addr_inc[i].value = ERROR;
  193.     mb_addr_inc[i].num_bits = 0;
  194.   }
  195.  
  196.   mb_addr_inc[15].value = MACRO_BLOCK_STUFFING;
  197.   mb_addr_inc[15].num_bits = 11;
  198.  
  199.   for (i = 16; i < 24; i++) {
  200.     mb_addr_inc[i].value = ERROR;
  201.     mb_addr_inc[i].num_bits = 0;
  202.   }
  203.  
  204.   val = 33;
  205.  
  206.   ASSIGN1(24, 36, 1, val, 11);
  207.   ASSIGN1(36, 48, 2, val, 10);
  208.   ASSIGN1(48, 96, 8, val, 8);
  209.   ASSIGN1(96, 128, 16, val, 7);
  210.   ASSIGN1(128, 256, 64, val, 5);
  211.   ASSIGN1(256, 512, 128, val, 4);
  212.   ASSIGN1(512, 1024, 256, val, 3);
  213.   ASSIGN1(1024, 2048, 1024, val, 1);
  214. }
  215.  
  216.  
  217.      
  218. /*
  219.  *--------------------------------------------------------------
  220.  *
  221.  * init_mb_type_P --
  222.  *
  223.  *    Initialize the VLC decoding table for macro_block_type in
  224.  *      predictive-coded pictures.
  225.  *
  226.  * Results:
  227.  *    The decoding table for macro_block_type in predictive-coded
  228.  *      pictures will be filled; illegal values will be filled as ERROR.
  229.  *
  230.  * Side effects:
  231.  *    The global array mb_type_P will be filled.
  232.  *
  233.  *--------------------------------------------------------------
  234.  */
  235.  
  236. /* Macro for filling up the decoding table for mb_type */
  237. #define ASSIGN2(start, end, quant, motion_forward, motion_backward, pattern, intra, num, mb_type) \
  238.   for (i = start; i < end; i ++) { \
  239.     mb_type[i].data = (quant<<4)|(motion_forward<<3)|(motion_backward<<2)|(pattern<<1)|(intra); \
  240.     mb_type[i].num_bits = num; \
  241.   }
  242.  
  243. static void init_mb_type_P(void)
  244. {
  245.   int i;
  246.  
  247.   mb_type_P[0].data = ERROR;
  248.   mb_type_P[0].num_bits = 0;
  249.  
  250.   ASSIGN2(1, 2, 1, 0, 0, 0, 1, 6, mb_type_P)
  251.   ASSIGN2(2, 4, 1, 0, 0, 1, 0, 5, mb_type_P)
  252.   ASSIGN2(4, 6, 1, 1, 0, 1, 0, 5, mb_type_P);
  253.   ASSIGN2(6, 8, 0, 0, 0, 0, 1, 5, mb_type_P);
  254.   ASSIGN2(8, 16, 0, 1, 0, 0, 0, 3, mb_type_P);
  255.   ASSIGN2(16, 32, 0, 0, 0, 1, 0, 2, mb_type_P);
  256.   ASSIGN2(32, 64, 0, 1, 0, 1, 0, 1, mb_type_P);
  257. }
  258.  
  259. /*
  260.  *--------------------------------------------------------------
  261.  *
  262.  * init_mb_type_B --
  263.  *
  264.  *    Initialize the VLC decoding table for macro_block_type in
  265.  *      bidirectionally-coded pictures.
  266.  *
  267.  * Results:
  268.  *    The decoding table for macro_block_type in bidirectionally-coded
  269.  *      pictures will be filled; illegal values will be filled as ERROR.
  270.  *
  271.  * Side effects:
  272.  *    The global array mb_type_B will be filled.
  273.  *
  274.  *--------------------------------------------------------------
  275.  */
  276. static void init_mb_type_B(void)
  277. {
  278.   int i;
  279.  
  280.   mb_type_B[0].data = ERROR;
  281.   mb_type_B[0].num_bits = 0;
  282.  
  283.   ASSIGN2(1, 2, 1, 0, 0, 0, 1, 6, mb_type_B);
  284.   ASSIGN2(2, 3, 1, 0, 1, 1, 0, 6, mb_type_B);
  285.   ASSIGN2(3, 4, 1, 1, 0, 1, 0, 6, mb_type_B);
  286.   ASSIGN2(4, 6, 1, 1, 1, 1, 0, 5, mb_type_B);
  287.   ASSIGN2(6, 8, 0, 0, 0, 0, 1, 5, mb_type_B);
  288.   ASSIGN2(8, 12, 0, 1, 0, 0, 0, 4, mb_type_B);
  289.   ASSIGN2(12, 16, 0, 1, 0, 1, 0, 4, mb_type_B);
  290.   ASSIGN2(16, 24, 0, 0, 1, 0, 0, 3, mb_type_B);
  291.   ASSIGN2(24, 32, 0, 0, 1, 1, 0, 3, mb_type_B);
  292.   ASSIGN2(32, 48, 0, 1, 1, 0, 0, 2, mb_type_B);
  293.   ASSIGN2(48, 64, 0, 1, 1, 1, 0, 2, mb_type_B);
  294. }
  295.  
  296.  
  297.  
  298.  
  299.  
  300. /*
  301.  *--------------------------------------------------------------
  302.  *
  303.  * init_motion_vectors --
  304.  *
  305.  *    Initialize the VLC decoding table for the various motion
  306.  *      vectors, including motion_horizontal_forward_code, 
  307.  *      motion_vertical_forward_code, motion_horizontal_backward_code,
  308.  *      and motion_vertical_backward_code.
  309.  *
  310.  * Results:
  311.  *    The decoding table for the motion vectors will be filled;
  312.  *      illegal values will be filled as ERROR.
  313.  *
  314.  * Side effects:
  315.  *    The global array motion_vector will be filled.
  316.  *
  317.  *--------------------------------------------------------------
  318.  */
  319.  
  320. /* Macro for filling up the decoding tables for motion_vectors */
  321. #define ASSIGN3(start, end, step, val, num) \
  322.   for (i = start; i < end; i+= step) { \
  323.     for (j = 0; j < step / 2; j++) { \
  324.       motion_vectors[i+j].code = val; \
  325.       motion_vectors[i+j].num_bits = num; \
  326.     } \
  327.     for (j = step / 2; j < step; j++) { \
  328.       motion_vectors[i+j].code = -val; \
  329.       motion_vectors[i+j].num_bits = num; \
  330.     } \
  331.     val--; \
  332.   }
  333.  
  334. static void init_motion_vectors(void)
  335. {
  336.   int i, j, val = 16;
  337.  
  338.   for (i = 0; i < 24; i++) {
  339.     motion_vectors[i].code = ERROR;
  340.     motion_vectors[i].num_bits = 0;
  341.   }
  342.  
  343.   ASSIGN3(24, 36, 2, val, 11);
  344.   ASSIGN3(36, 48, 4, val, 10);
  345.   ASSIGN3(48, 96, 16, val, 8);
  346.   ASSIGN3(96, 128, 32, val, 7);
  347.   ASSIGN3(128, 256, 128, val, 5);
  348.   ASSIGN3(256, 512, 256, val, 4);
  349.   ASSIGN3(512, 1024, 512, val, 3);
  350.   ASSIGN3(1024, 2048, 1024, val, 1);
  351. }
  352.  
  353.  
  354.  
  355.  
  356. /*
  357.  *--------------------------------------------------------------
  358.  *
  359.  * init_tables --
  360.  *
  361.  *    Initialize all the tables for VLC decoding; this must be
  362.  *      called when the system is set up before any decoding can
  363.  *      take place.
  364.  *
  365.  * Results:
  366.  *    All the decoding tables will be filled accordingly.
  367.  *
  368.  * Side effects:
  369.  *    The corresponding global array for each decoding table 
  370.  *      will be filled.
  371.  *
  372.  *--------------------------------------------------------------
  373.  */    
  374. void init_tables(void)
  375. {
  376. //  extern void init_pre_idct();
  377.  
  378.   init_mb_addr_inc();
  379.   init_mb_type_P();
  380.   init_mb_type_B();
  381.   init_motion_vectors();
  382. //  init_pre_idct();
  383.  
  384. #ifdef ANALYSIS
  385.   {
  386.     init_stats();
  387.   }
  388. #endif
  389. }
  390.