PEZW_zerotree.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:         PEZW_zerotree.h
  57.    Author:            Jie Liang  (liang@ti.com)
  58.    Functions:         Header file for definition of symbols and variables
  59.                       used in PEZW coder.
  60.    Revisions:         v1.0 (10/04/98)
  61. *****************************************************************************/
  62. #ifndef PEZW_ZEROTREE_HPP
  63. #define PEZW_ZEROTREE_HPP
  64. #include "PEZW_ac.hpp"
  65. /* declarations for zerotree coding */
  66. #define ABS(x) (((x)<0)?-(x):(x))
  67. /* symbols actuallry used for AC coding */
  68. #define IZER   0             /* isolated zero */
  69. #define IVAL   1             /* isolated valued coefficient */
  70. #define ZTRZ   2             /* zero tree root: zero */
  71. #define ZTRV   3             /* valued zerotree root */
  72. /* for internal use only, not sent as zerotree symbols  */
  73. #define DZ     4               /* descendant of a ZTRV */
  74. #define DS     4               /* descendant of a ZTRS */
  75. #define SKIP   13 /* out of shape */
  76. #define SKPZTR 14 /* out of shape and zero tree root */
  77. #define No_of_states_context0   9
  78. #define No_of_states_context1   1
  79. #define No_of_contexts No_of_states_context0*No_of_states_context1*Maximum_Decomp_Levels
  80. #define NumBands               3
  81. #define NumContext_per_pixel   6
  82. #define NumContexts            NumBands*NumContext_per_pixel
  83. /* SYMBOLS FOR INTERNAL USE */
  84. #define MAXSIZE      1000000    /* maximum bitstream size handled */
  85. /* Models for arithmetic coding */
  86. /* THE SET OF SYMBOLS THAT MAY BE ENCODED. */
  87. #define No_of_chars 4 /* Number of character symbols */
  88. #define No_of_symbols (No_of_chars+1) 
  89. /* maxmum frequence count */
  90. #define Max_frequency_TI 127
  91. /* context models */
  92. extern int freq_dom_ZTRZ[No_of_symbols]; 
  93. extern int freq_dom2_IZER[No_of_symbols];
  94. /* debugging parameters */
  95. #define DEBUG_BILEVEL       0
  96. #define DEBUG_DEC_BS        0
  97. #define DEBUG_BS            0
  98. #define DEBUG_BS_DETAIL     0
  99. #ifdef DEBUG_FILE
  100. /* debugging variable */
  101. FILE    *fp_debug;
  102. #define DEBUG_BITSTREAM   0
  103. #define DEBUG_SYMBOL      1
  104. #define DEBUG_VALUE       1
  105. #endif
  106. #endif