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

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /*************************************************************************
  2. This software module was originally developed by 
  3. Ming-Chieh Lee (mingcl@microsoft.com), Microsoft Corporation
  4. Wei-ge Chen (wchen@microsoft.com), Microsoft Corporation
  5. Bruce Lin (blin@microsoft.com), Microsoft Corporation
  6. Chuang Gu (chuanggu@microsoft.com), Microsoft Corporation
  7. (date: March, 1996)
  8. and edited by
  9.         Wei Wu (weiwu@stallion.risc.rockwell.com) Rockwell Science Center
  10. in the course of development of the MPEG-4 Video (ISO/IEC 14496-2). 
  11. This software module is an implementation of a part of one or more MPEG-4 Video tools 
  12. as specified by the MPEG-4 Video. 
  13. ISO/IEC gives users of the MPEG-4 Video free license to this software module or modifications 
  14. thereof for use in hardware or software products claiming conformance to the MPEG-4 Video. 
  15. Those intending to use this software module in hardware or software products are advised that its use may infringe existing patents. 
  16. The original developer of this software module and his/her company, 
  17. the subsequent editors and their companies, 
  18. and ISO/IEC have no liability for use of this software module or modifications thereof in an implementation. 
  19. Copyright is not released for non MPEG-4 Video conforming products. 
  20. Microsoft retains full right to use the code for his/her own purpose, 
  21. assign or donate the code to a third party and to inhibit third parties from using the code for non <MPEG standard> conforming products. 
  22. This copyright notice must be included in all copies or derivative works. 
  23. Copyright (c) 1996, 1997.
  24. Module Name:
  25. dct.hpp
  26. Abstract:
  27. DCT and inverse DCT
  28. Revision History:
  29. *************************************************************************/
  30. #ifndef __DCT_HPP_
  31. #define __DCT_HPP_
  32. Class CTransform;
  33. Class CBlockDCT// : public CTransform
  34. {
  35. public:
  36. // Constructors
  37. virtual ~CBlockDCT ();
  38. /* NBIT: change
  39. CBlockDCT ();
  40. */
  41. CBlockDCT (UInt nBits); // NBIT
  42. // Operations
  43. Void apply (const PixelC* rgiSrc, Int nColSrc, Int* rgiDst, Int nColDst);
  44. Void apply (const Int* rgiSrc, Int nColSrc, PixelC* rgchDst, Int nColDst);
  45. Void apply (const Int* rgiSrc, Int nColSrc, Int* rgchDst, Int nColDst);
  46.    
  47. ///////////////// implementation /////////////////
  48. protected:
  49. UInt m_nBits; // NBIT
  50. // only used for 8x8 case
  51. Float m_c0; //xformation costants
  52. Float m_c1;
  53. Float m_c2;
  54. Float m_c3;
  55. Float m_c4;
  56. Float m_c5;
  57. Float m_c6;
  58. Float m_c7;
  59. PixelC* m_rgchClipTbl;
  60. Float m_rgfltBuf1[8]; //buffers
  61. Float  m_rgfltBuf2[8];
  62. Float  m_rgfltAfter1dXform[8]; //results of 1dDCT
  63. Float  m_rgfltAfterRowXform[8][8]; //intermediate results
  64. Void xformRow (const PixelC* ppxlcRowSrc, CoordI i);
  65. Void xformRow (const PixelI* ppxlfRowSrc, CoordI i);//transform a row
  66. Void xformColumn (PixelC* ppxlcColDst, CoordI i, Int nColDst);
  67. Void xformColumn (PixelI* ppxlfColDst, CoordI i, Int nColDst); //transfrom a col
  68. virtual Void oneDimensionalDCT () = 0; //1d DCT
  69. };
  70. Class CFwdBlockDCT: public CBlockDCT //forward DCT
  71. {
  72. public:
  73. // Constructors
  74. ~CFwdBlockDCT () {}
  75. /* NBIT: change
  76. CFwdBlockDCT ();
  77. */
  78. CFwdBlockDCT (UInt nBits=8);
  79.    
  80. ///////////////// implementation /////////////////
  81. protected:
  82. Void oneDimensionalDCT ();
  83. };
  84. Class CInvBlockDCT: public CBlockDCT //inverse DCT
  85. {
  86. public:
  87. // Constructors
  88. ~CInvBlockDCT () {}
  89. /* NBIT: change
  90. CInvBlockDCT ();
  91. */
  92. CInvBlockDCT (UInt nBits=8);
  93.    
  94. ///////////////// implementation /////////////////
  95. protected:
  96. Void oneDimensionalDCT ();
  97. };
  98. #endif 
  99. // __DCT_HPP_