diff --git a/res/resource.h b/res/resource.h index 8de0da8..aa23e5d 100644 --- a/res/resource.h +++ b/res/resource.h @@ -1,2 +1,2 @@ -#define APP_VERSION 0,1,4,16 -#define APP_VERSION_STR "0.1.4.16" +#define APP_VERSION 0,1,4,17 +#define APP_VERSION_STR "0.1.4.17" diff --git a/src/debugtool.cpp b/src/debugtool.cpp index 20b8e73..b9797eb 100644 --- a/src/debugtool.cpp +++ b/src/debugtool.cpp @@ -96,12 +96,13 @@ bool convertF32toU8( ImgF32* src, ImgU8 &dst ) if ( fMin < 0.f ) { - printf( "Error @ convertF32toU8(), Min float under zero : %.2f\n", fMin ); + printf( "Warning @ convertF32toU8(), Min float under zero : %.2f\n", + fMin ); fflush( stdout ); - - fMin = 0.f; } + printf( "fMin:fMax=%.2f:%.2f", fMin, fMax ); + #pragma omp parallel for for( unsigned cnt=0; cntY, strFnMap ); // Write Cb + printf("Cb:" ); fflush( stdout ); sprintf( strFnMap, "%s_Cb.png", fnameprefix ); saveImgF32( &refimg->Cb, strFnMap ); // Write Cr + printf("Cr:" ); fflush( stdout ); sprintf( strFnMap, "%s_Cr.png", fnameprefix ); saveImgF32( &refimg->Cr, strFnMap ); diff --git a/src/libsrcnn.cpp b/src/libsrcnn.cpp index 937cd61..4c1d510 100644 --- a/src/libsrcnn.cpp +++ b/src/libsrcnn.cpp @@ -192,9 +192,9 @@ void converImgU8toYCbCr( ImgU8 &src, ImgYCbCr &out ) #pragma omp parallel for for( unsigned cnt=0; cnt Green -> Blue ... - out.buff[( cnt * 3 ) + 0] = (unsigned char)fR; - out.buff[( cnt * 3 ) + 1] = (unsigned char)fG; - out.buff[( cnt * 3 ) + 2] = (unsigned char)fB; + out.buff[( cnt * 3 ) + 0] = (unsigned char)MAX( 0.f, fR ); + out.buff[( cnt * 3 ) + 1] = (unsigned char)MAX( 0.f, fG ); + out.buff[( cnt * 3 ) + 2] = (unsigned char)MAX( 0.f, fB ); } } @@ -528,8 +529,11 @@ int DLL_PUBLIC ProcessSRCNN( const unsigned char* refbuff, discardImgYCbCr( imgYCbCr ); #ifdef DEBUG + printf("rY:"); saveImgF32( &imgResized[0], "resized_Y.png" ); + printf("rCb:"); saveImgF32( &imgResized[1], "resized_Cb.png" ); + printf("rCr:"); saveImgF32( &imgResized[2], "resized_Cr.png" ); #endif @@ -608,4 +612,4 @@ int DLL_PUBLIC ProcessSRCNN( const unsigned char* refbuff, } return -100; -} \ No newline at end of file +}