The float type is defined in standards and is portably available on all supported compilers and platforms.
Showing the changes to codec/encoder/core/src/utils.cpp (1 of 7 files). Show all
Unified · Split
| @@ -60,12 +60,12 @@ namespace WelsSVCEnc { · 59 unmodified lines | |||
| 60 | void WelsLogDefault (void* pCtx, const int32_t kiLevel, const str_t* kpFmtStr, va_list argv); | 60 | void WelsLogDefault (void* pCtx, const int32_t kiLevel, const str_t* kpFmtStr, va_list argv); |
| 61 | void WelsLogNil (void* pCtx, const int32_t kiLevel, const str_t* kpFmtStr, va_list argv); | 61 | void WelsLogNil (void* pCtx, const int32_t kiLevel, const str_t* kpFmtStr, va_list argv); |
| 62 | 62 | ||
| 63 | real32_t WelsCalcPsnr (const void* kpTarPic, | 63 | float WelsCalcPsnr (const void* kpTarPic, |
| 64 | const int32_t kiTarStride, | 64 | const int32_t kiTarStride, |
| 65 | const void* kpRefPic, | 65 | const void* kpRefPic, |
| 66 | const int32_t kiRefStride, | 66 | const int32_t kiRefStride, |
| 67 | const int32_t kiWidth, | 67 | const int32_t kiWidth, |
| 68 | const int32_t kiHeight); | 68 | const int32_t kiHeight); |
| 69 | 69 | ||
| 70 | // to fill default routines | 70 | // to fill default routines |
| 71 | #ifdef ENABLE_TRACE_FILE | 71 | #ifdef ENABLE_TRACE_FILE |
| @@ -343,7 +343,7 @@ void WelsLog (void* pCtx, int32_t iLevel, const str_t* kpFmt, ...) { · 271 unmodified lines | |||
| 343 | 343 | ||
| 344 | #ifndef CALC_PSNR | 344 | #ifndef CALC_PSNR |
| 345 | #define CONST_FACTOR_PSNR (10.0 / log(10.0)) // for good computation | 345 | #define CONST_FACTOR_PSNR (10.0 / log(10.0)) // for good computation |
| 346 | #define CALC_PSNR(w, h, s) ((real32_t)(CONST_FACTOR_PSNR * log( 65025.0 * w * h / iSqe ))) | 346 | #define CALC_PSNR(w, h, s) ((float)(CONST_FACTOR_PSNR * log( 65025.0 * w * h / iSqe ))) |
| 347 | #endif//CALC_PSNR | 347 | #endif//CALC_PSNR |
| 348 | 348 | ||
| 349 | /* | 349 | /* |
| @@ -365,12 +365,12 @@ void WelsLog (void* pCtx, int32_t iLevel, const str_t* kpFmt, ...) { · 15 unmodified lines | |||
| 365 | * \note N/A | 365 | * \note N/A |
| 366 | ************************************************************************************* | 366 | ************************************************************************************* |
| 367 | */ | 367 | */ |
| 368 | real32_t WelsCalcPsnr (const void* kpTarPic, | 368 | float WelsCalcPsnr (const void* kpTarPic, |
| 369 | const int32_t kiTarStride, | 369 | const int32_t kiTarStride, |
| 370 | const void* kpRefPic, | 370 | const void* kpRefPic, |
| 371 | const int32_t kiRefStride, | 371 | const int32_t kiRefStride, |
| 372 | const int32_t kiWidth, | 372 | const int32_t kiWidth, |
| 373 | const int32_t kiHeight) { | 373 | const int32_t kiHeight) { |
| 374 | int64_t iSqe = 0; | 374 | int64_t iSqe = 0; |
| 375 | int32_t x, y; | 375 | int32_t x, y; |
| 376 | uint8_t* pTar = (uint8_t*)kpTarPic; | 376 | uint8_t* pTar = (uint8_t*)kpTarPic; |