home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2004 March / PCWELT_3_2004.ISO / pcwsoft / flaskmpeg_078_39_src.z.exe / flaskmpeg / Misc / ieee1180test.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-10-28  |  2.3 KB  |  82 lines

  1. /* 
  2.  *  IEEE1180Test.h
  3.  *
  4.  *    Copyright (C) Alberto Vigata - July 2000 - ultraflask@yahoo.com
  5.  *
  6.  *  This file is part of FlasKMPEG, a free MPEG to MPEG/AVI converter
  7.  *    
  8.  *  FlasKMPEG is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2, or (at your option)
  11.  *  any later version.
  12.  *   
  13.  *  FlasKMPEG is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *   
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with GNU Make; see the file COPYING.  If not, write to
  20.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  21.  *
  22.  */
  23.  
  24. #if !defined(AFX_IEEE1180TEST_H__894E2496_042A_464F_826F_5E579A46138B__INCLUDED_)
  25. #define AFX_IEEE1180TEST_H__894E2496_042A_464F_826F_5E579A46138B__INCLUDED_
  26.  
  27. #if _MSC_VER > 1000
  28. #pragma once
  29. #endif // _MSC_VER > 1000
  30.  
  31. #define DCTSIZE      (8)
  32. #define DCTSIZE2     (DCTSIZE*DCTSIZE)
  33.  
  34. #define EIGHT_BIT_SAMPLES
  35.  
  36. #include <string>
  37. using namespace std;
  38.  
  39. typedef short DCTELEM;        /* must be at least 16 bits */
  40.  
  41. typedef DCTELEM DCTBLOCK[DCTSIZE2];
  42.  
  43.  
  44. class CIEEE1180Test  
  45. {
  46. public:
  47.     CIEEE1180Test();
  48.     virtual ~CIEEE1180Test();
  49.   bool IsIEEE1180( void (* TestIdct)(DCTELEM *block) );
  50.   int  GetProgress(){return m_nProgress;}
  51.   const char *GetResults(){ return m_strResults.c_str(); }
  52.  
  53. private:
  54.     bool Meets (double val, double limit);
  55.  
  56.     bool DoTest( long minpix, long maxpix, long sign, long niters, void (* TestIdct)(DCTELEM *block) );
  57.     long IEEERand(long L, long H);
  58.     void DCTInit();
  59.     void RefInverseDCT( DCTELEM *block );
  60.     void RefForwardDCT( DCTELEM *block );
  61.  
  62.   /* The cosine lookup table */
  63.   /* coslu[a][b] = C(b)/2 * cos[(2a+1)b*pi/16] */
  64.   double coslu[8][8];
  65.   long sumerrs[DCTSIZE2];
  66.   long sumsqerrs[DCTSIZE2];
  67.   int maxerr[DCTSIZE2];
  68.  
  69.   // Format string
  70.   char m_pTmpStr[1024];
  71.  
  72.   // String to store the reults.
  73.   string m_strResults;
  74.  
  75.   int m_nProgress;
  76.   // Random generator
  77.   long randx;
  78.   double z;
  79. };
  80.  
  81. #endif // !defined(AFX_IEEE1180TEST_H__894E2496_042A_464F_826F_5E579A46138B__INCLUDED_)
  82.