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

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /* $Id: dwt.hpp,v 1.2 2001/04/19 18:32:09 wmay Exp $ */
  2. /****************************************************************************/
  3. /*   MPEG4 Visual Texture Coding (VTC) Mode Software                        */
  4. /*                                                                          */
  5. /*   This software was jointly developed by the following participants:     */
  6. /*                                                                          */
  7. /*   Single-quant,  multi-quant and flow control                            */
  8. /*   are provided by  Sarnoff Corporation                                   */
  9. /*     Iraj Sodagar   (iraj@sarnoff.com)                                    */
  10. /*     Hung-Ju Lee    (hjlee@sarnoff.com)                                   */
  11. /*     Paul Hatrack   (hatrack@sarnoff.com)                                 */
  12. /*     Shipeng Li     (shipeng@sarnoff.com)                                 */
  13. /*     Bing-Bing Chai (bchai@sarnoff.com)                                   */
  14. /*     B.S. Srinivas  (bsrinivas@sarnoff.com)                               */
  15. /*                                                                          */
  16. /*   Bi-level is provided by Texas Instruments                              */
  17. /*     Jie Liang      (liang@ti.com)                                        */
  18. /*                                                                          */
  19. /*   Shape Coding is provided by  OKI Electric Industry Co., Ltd.           */
  20. /*     Zhixiong Wu    (sgo@hlabs.oki.co.jp)                                 */
  21. /*     Yoshihiro Ueda (yueda@hlabs.oki.co.jp)                               */
  22. /*     Toshifumi Kanamaru (kanamaru@hlabs.oki.co.jp)                        */
  23. /*                                                                          */
  24. /*   OKI, Sharp, Sarnoff, TI and Microsoft contributed to bitstream         */
  25. /*   exchange and bug fixing.                                               */
  26. /*                                                                          */
  27. /*                                                                          */
  28. /* In the course of development of the MPEG-4 standard, this software       */
  29. /* module is an implementation of a part of one or more MPEG-4 tools as     */
  30. /* specified by the MPEG-4 standard.                                        */
  31. /*                                                                          */
  32. /* The copyright of this software belongs to ISO/IEC. ISO/IEC gives use     */
  33. /* of the MPEG-4 standard free license to use this  software module or      */
  34. /* modifications thereof for hardware or software products claiming         */
  35. /* conformance to the MPEG-4 standard.                                      */
  36. /*                                                                          */
  37. /* Those intending to use this software module in hardware or software      */
  38. /* products are advised that use may infringe existing  patents. The        */
  39. /* original developers of this software module and their companies, the     */
  40. /* subsequent editors and their companies, and ISO/IEC have no liability    */
  41. /* and ISO/IEC have no liability for use of this software module or         */
  42. /* modification thereof in an implementation.                               */
  43. /*                                                                          */
  44. /* Permission is granted to MPEG members to use, copy, modify,              */
  45. /* and distribute the software modules ( or portions thereof )              */
  46. /* for standardization activity within ISO/IEC JTC1/SC29/WG11.              */
  47. /*                                                                          */
  48. /* Copyright 1995, 1996, 1997, 1998 ISO/IEC                                 */
  49. /****************************************************************************/
  50. /************************************************************/
  51. /*     Sarnoff Very Low Bit Rate Still Image Coder          */
  52. /*     Copyright 1995, 1996, 1997, 1998 Sarnoff Corporation */
  53. /************************************************************/
  54. /* DWT and inverse DWT header file 
  55.    Created by Shipeng Li, Sarnoff Corporation, Jan. 1998
  56.    Copyright (c) Sarnoff Corporation
  57. */
  58. #ifndef _DWT_H_
  59. #define _DWT_H_
  60. #include "basic.hpp"
  61. #define UChar UChar
  62. #ifdef DATA
  63. #undef DATA
  64. #endif
  65. #define DATA Int  
  66. #ifdef INT
  67. #undef INT
  68. #endif
  69. #define INT Int
  70. #define ROUNDDIV(x, y) ((x)>0?(Int)(((Int)(x)+((y)>>1))/(y)):(Int)(((Int)(x)-((y)>>1)) /(y)))
  71. enum {  /* DWT or IDWT return values */
  72.   DWT_OK,
  73.   DWT_FILTER_UNSUPPORTED,
  74.   DWT_MEMORY_FAILED,
  75.   DWT_COEFF_OVERFLOW,
  76.   DWT_INVALID_LEVELS,
  77.   DWT_INVALID_WIDTH,
  78.   DWT_INVALID_HEIGHT,
  79.   DWT_INTERNAL_ERROR,
  80.   DWT_NOVALID_PIXEL
  81. };
  82. #ifdef RECTANGULAR
  83. #undef RECTANGULAR
  84. #endif
  85. #define RECTANGULAR -1
  86. /* Image data type */
  87. enum { 
  88.   UCHAR_ENUM,
  89.   USHORT_ENUM
  90. };
  91. enum { /* filter class */
  92.   ODD_SYMMETRIC,
  93.   EVEN_SYMMETRIC,
  94.   ORTHORGONAL
  95. };
  96. enum {
  97.   EVEN,
  98.   ODD
  99. };
  100. enum {
  101.   HORIZONTAL,
  102.   VERTICAL
  103. };
  104. enum {
  105.   NONZERO_HIGH,
  106.   ZERO_HIGH,
  107.   ALL_ZERO
  108. };
  109. #define  OUT0 0
  110. #define  IN   1
  111. #define  OUT1 2
  112. #define  OUT2 3
  113. #define  OUT3 4
  114. enum { /* filter type */
  115.   INT_TYPE,
  116.   DBL_TYPE
  117. };
  118. typedef struct {
  119.   INT Class; 
  120.   /* 0: Odd Symmetric 1: Even Symmetric 2: Orthogonal (not supported)
  121.    Note: This is not defined by MPEG4-CD syntax but should be, since different 
  122.    wavelets corresponds to different extension. 
  123.    Ref. "Shape Adpative Discrete Wavelet Transform for Arbitrarily-Shaped 
  124.    Visual Object Coding" S. Li and W. Li (submitted to IEEE T-CSVT) 
  125.    */
  126.   INT Type;
  127.   /* 0: Short Coeff; 1: Double Coeff */
  128.   INT HPLength;
  129.   INT LPLength;
  130.   Void *HPCoeff;
  131.   Void *LPCoeff;
  132.   INT Scale;
  133. } FILTER;
  134. #endif /*_DWT_H_ */