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

流媒体/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_mpeg4.h
  57.    Author:            Jie Liang  (liang@ti.com)
  58.    Functions:         define data structures for interface with other parts 
  59.                       of MPEG4 software
  60.    Revisions:         v1.0 (10/04/98)
  61. *****************************************************************************/
  62. #ifndef PEZW_MPEG4_HPP
  63. #define PEZW_MPEG4_HPP
  64. #include "PEZW_ac.hpp"
  65. #define Maximum_Decomp_Levels   10
  66. #define No_of_states_context0   9
  67. #define No_of_states_context1   1
  68. #define No_of_contexts No_of_states_context0*No_of_states_context1*Maximum_Decomp_Levels
  69. /* data type used for store wavelet coefficients */ 
  70. typedef struct array_2D {
  71.    int width;
  72.    int height;
  73.    void *data;
  74.    unsigned char *mask;
  75. } Array_2D;
  76. typedef struct array_1D {
  77.   int length;
  78.   void *data;
  79. #ifdef _SA_DWT_
  80.    unsigned char *mask;
  81. #endif
  82. } Array_1D;
  83. typedef struct pezw_snr_layer {
  84.   int       Quant;
  85.   int       allzero;
  86.   int       bits_to_go;
  87.   Array_2D  snr_image;
  88.   Array_1D  snr_bitstream;
  89. } PEZW_SNR_LAYER;
  90. typedef struct pezw_spatial_layer {
  91.   int           spatial_bitstream_length;
  92.   int           SNR_scalability_levels;
  93.   PEZW_SNR_LAYER    *SNRlayer;
  94. } PEZW_SPATIAL_LAYER;
  95. /* data structure for the PEZW decoder */
  96. typedef struct pezw_decoder {
  97. short *valueimage;                /* dequantized coeffs */
  98. unsigned char *prev_labelimage;  /* zerotree symbols in previous pass */
  99. unsigned char *labelimage;
  100. unsigned char **labelimage_spa;  
  101. unsigned char *mask;
  102. int *sizes, *SPsizes;            /* decoded sizes */
  103. Ac_decoder *AC_decoder;          /* AC_decoder data structure */
  104. int *currthresh;  /* current thresh */
  105. int bplane;                      /* the SNR levels */
  106. int *budget;                     /* budget for each band */
  107. int levels;  /* levels of decomposition */ 
  108. int hsize;                       /* image height */
  109. int vsize;                       /* image width */
  110. /* models */
  111. Ac_model model_context[No_of_contexts];
  112. Ac_model model_sub, model_sign;
  113. /* debugging information */
  114. int countIZER;
  115. int countIVAL;
  116. int countZTRZ;
  117. int countZTRV;
  118. int cIZ[No_of_contexts];
  119. int cIS[No_of_contexts];
  120. int cZTRZ[No_of_contexts];
  121.     int cZTRS[No_of_contexts];
  122. } PEZW_DECODER;
  123. /* maximum number of zero runs for start code violation checking */
  124. #define MAXRUNZERO    22
  125. #endif
  126.