00001 #ifndef QUALITY2SE_HEADER_
00002 #define QUALITY2SE_HEADER_
00003
00004 #include "../headers.h"
00005
00006
00008
00009 class MQuality2SE_std: public IQuality2SE {
00010
00011 DECLARE_TypeInfo_noSettings( MQuality2SE_std, "Constant square error"
00012 , "Holds the same <b>square error</b> (SE) for all block sizes" )
00013
00014 public:
00017 float rangeSE(float quality,int ) {
00018 ASSERT( quality>=0 && quality<=1 );
00019 float maxSE= 4
00020 , doubles= 6;
00021 return maxSE/exp2(doubles) * ( exp2((1-quality)*doubles) - 1 );
00022 }
00024 };
00025
00026
00028
00029 class MQuality2SE_alt: public IQuality2SE {
00030
00031 DECLARE_TypeInfo_noSettings( MQuality2SE_alt, "Constant mean square error"
00032 , "Holds the same <b>mean square error</b> (MSE) for all block sizes" )
00033
00034 public:
00037 float rangeSE(float quality,int pixelCount) {
00038 ASSERT( quality>=0 && quality<=1 );
00039 float maxSE= 4
00040 , doubles= 6;
00041 float sizeQuot= pixelCount/sqr(9.0);
00042 return maxSE/exp2(doubles) * ( exp2((1-quality)*doubles) - 1 ) * sizeQuot;
00043 }
00045 };
00046
00047
00048 #endif // QUALITY2SE_HEADER_