wvtpezw_tree_codec.hpp
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:6k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /****************************************************************************/
  2. /*   MPEG4 Visual Texture Coding (VTC) Mode Software                        */
  3. /*                                                                          */
  4. /*   This software was jointly developed by the following participants:     */
  5. /*                                                                          */
  6. /*   Single-quant,  multi-quant and flow control                            */
  7. /*   are provided by  Sarnoff Corporation                                   */
  8. /*     Iraj Sodagar   (iraj@sarnoff.com)                                    */
  9. /*     Hung-Ju Lee    (hjlee@sarnoff.com)                                   */
  10. /*     Paul Hatrack   (hatrack@sarnoff.com)                                 */
  11. /*     Shipeng Li     (shipeng@sarnoff.com)                                 */
  12. /*     Bing-Bing Chai (bchai@sarnoff.com)                                   */
  13. /*     B.S. Srinivas  (bsrinivas@sarnoff.com)                               */
  14. /*                                                                          */
  15. /*   Bi-level is provided by Texas Instruments                              */
  16. /*     Jie Liang      (liang@ti.com)                                        */
  17. /*                                                                          */
  18. /*   Shape Coding is provided by  OKI Electric Industry Co., Ltd.           */
  19. /*     Zhixiong Wu    (sgo@hlabs.oki.co.jp)                                 */
  20. /*     Yoshihiro Ueda (yueda@hlabs.oki.co.jp)                               */
  21. /*     Toshifumi Kanamaru (kanamaru@hlabs.oki.co.jp)                        */
  22. /*                                                                          */
  23. /*   OKI, Sharp, Sarnoff, TI and Microsoft contributed to bitstream         */
  24. /*   exchange and bug fixing.                                               */
  25. /*                                                                          */
  26. /*                                                                          */
  27. /* In the course of development of the MPEG-4 standard, this software       */
  28. /* module is an implementation of a part of one or more MPEG-4 tools as     */
  29. /* specified by the MPEG-4 standard.                                        */
  30. /*                                                                          */
  31. /* The copyright of this software belongs to ISO/IEC. ISO/IEC gives use     */
  32. /* of the MPEG-4 standard free license to use this  software module or      */
  33. /* modifications thereof for hardware or software products claiming         */
  34. /* conformance to the MPEG-4 standard.                                      */
  35. /*                                                                          */
  36. /* Those intending to use this software module in hardware or software      */
  37. /* products are advised that use may infringe existing  patents. The        */
  38. /* original developers of this software module and their companies, the     */
  39. /* subsequent editors and their companies, and ISO/IEC have no liability    */
  40. /* and ISO/IEC have no liability for use of this software module or         */
  41. /* modification thereof in an implementation.                               */
  42. /*                                                                          */
  43. /* Permission is granted to MPEG members to use, copy, modify,              */
  44. /* and distribute the software modules ( or portions thereof )              */
  45. /* for standardization activity within ISO/IEC JTC1/SC29/WG11.              */
  46. /*                                                                          */
  47. /* Copyright 1995, 1996, 1997, 1998 ISO/IEC                                 */
  48. /****************************************************************************/
  49. /****************************************************************************/
  50. /*     Texas Instruments Predictive Embedded Zerotree (PEZW) Image Codec    */
  51. /*    Developed by Jie Liang (liang@ti.com)                                */
  52. /*                         */ 
  53. /*     Copyright 1996, 1997, 1998 Texas Instruments                    */
  54. /****************************************************************************/
  55. /****************************************************************************
  56.    File name:         wvtpezw_tree_codec.h
  57.    Author:            Jie Liang  (liang@ti.com)
  58.    Functions:         Header file for definition of global variables used 
  59.                       inside the PEZW module code.
  60.    Revisions:         v1.0 (10/04/98)
  61. *****************************************************************************/
  62. #include <stdio.h>
  63. #include <wvtPEZW.hpp>
  64. #include "PEZW_ac.hpp"
  65. #define MAX_BITPLANE   16
  66. #define MIN_BITPLANE   0
  67. /* the wavelet tree buffer */
  68. extern WINT *the_wvt_tree;
  69. /* data structure for storing the maximum value of the
  70.    wavelet coefficients */
  71. extern WINT *wvt_tree_maxval; 
  72. extern WINT MaxValue; 
  73. /* weighting for different band */
  74. extern int *snr_weight;
  75. /* length of the tree structure */
  76. extern int len_tree_struct;
  77. /* the absolute value of the wavelet coefficients */
  78. extern WINT *abs_wvt_tree;
  79. /* location map for converting wavelets from blocks
  80.    to trees */
  81. extern int *vloc_map, *hloc_map;
  82. /* data structure for information for zerotree coefficients
  83.    that need to be coded */
  84. extern short *ScanTrees;
  85. extern short *next_ScanTrees;
  86. /* the depth of the tree, or decomposition level */  
  87. extern int tree_depth;
  88. /* position and layer of all significant coefficients */
  89. extern short *sig_pos;
  90. extern char *sig_layer;
  91. /* number of significant coefficients */
  92. extern int num_Sig;
  93. /* addition block of memory to allocate if the initial
  94.    buffer is not enough */
  95. #define Initial_Bufsize  100
  96. /* arithmetic encoder data structure for each decomposition
  97.    depth and bitplane */
  98. extern Ac_encoder **Encoder;
  99. extern Ac_decoder **Decoder;
  100. extern unsigned char ***buffer_ptr;
  101. extern unsigned char bptemp;
  102. /* position of the starting point for each depth */
  103. extern short *level_pos;
  104. /* status of previous zerotree */
  105. extern unsigned char *prev_label;
  106. /* sign bit for decoder */
  107. extern char *sign_bit;
  108. /* models */
  109. extern Ac_model *context_model;
  110. extern Ac_model *model_sign;
  111. extern Ac_model *model_sub;
  112. /* mask */
  113. extern unsigned int *maskbit;
  114. extern unsigned char *bitplane;
  115. /* the adaptation mode of the arithmetic coder:
  116.    1- adaptive, 0- fixed  */
  117. #define ADAPTATION_MODE   1