Remove typedefs for float_t and double_t
The actual float and double data types are defined in C89 and are usable as such without any extra typedefs. Removing the extra typedefs simplifies the compatibility typedef headers, simplifies portability and makes the code base easier to work with for people new to the library.
This commit is contained in:
parent
ba6bf7da18
commit
d36b10fac5
@ -69,12 +69,12 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix
|
||||
SVAACalcResult* pVaaCalcResults = NULL;
|
||||
int8_t iMotionTextureIndexToDeltaQp = 0;
|
||||
int32_t iAverMotionTextureIndexToDeltaQp = 0; // double to uint32
|
||||
double_t dAverageMotionIndex = 0.0; // double to float
|
||||
double_t dAverageTextureIndex = 0.0;
|
||||
double dAverageMotionIndex = 0.0; // double to float
|
||||
double dAverageTextureIndex = 0.0;
|
||||
|
||||
double_t dQStep = 0.0;
|
||||
double_t dLumaMotionDeltaQp = 0;
|
||||
double_t dLumaTextureDeltaQp = 0;
|
||||
double dQStep = 0.0;
|
||||
double dLumaMotionDeltaQp = 0;
|
||||
double dLumaTextureDeltaQp = 0;
|
||||
|
||||
uint8_t* pRefFrameY = NULL, *pCurFrameY = NULL;
|
||||
int32_t iRefStride = 0, iCurStride = 0;
|
||||
@ -170,7 +170,7 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix
|
||||
pMotionTexture = m_sAdaptiveQuantParam.pMotionTextureUnit;
|
||||
for (j = 0; j < iMbHeight; j ++) {
|
||||
for (i = 0; i < iMbWidth; i++) {
|
||||
double_t a = pMotionTexture->uiTextureIndex / dAverageTextureIndex;
|
||||
double a = pMotionTexture->uiTextureIndex / dAverageTextureIndex;
|
||||
dQStep = (a - 1) / (a + MODEL_ALPHA);
|
||||
dLumaTextureDeltaQp = MODEL_TIME * dQStep;// range +- 6
|
||||
|
||||
|
@ -76,11 +76,6 @@ typedef unsigned __int64 uint64_t ;
|
||||
typedef char str_t ; // [comment]: specific use plain char only for character parameters
|
||||
typedef bool bool_t ;
|
||||
|
||||
#if defined(_WIN32) || defined(_MACH_PLATFORM) || defined(__GNUC__)
|
||||
typedef float float_t ;
|
||||
typedef double double_t ;
|
||||
#endif
|
||||
|
||||
enum {
|
||||
FALSE = 0,
|
||||
TRUE = !FALSE
|
||||
|
@ -96,7 +96,7 @@ class CDenoiser : public IStrategy {
|
||||
void WaverageDenoiseChroma (uint8_t* pSrcUV, int32_t width, int32_t height, int32_t stride);
|
||||
|
||||
private:
|
||||
float_t m_fSigmaGrey; //sigma for grey scale similarity, suggestion 2.5-3
|
||||
float m_fSigmaGrey; //sigma for grey scale similarity, suggestion 2.5-3
|
||||
uint32_t m_uiFilterWindow; //filter window diameter
|
||||
uint16_t m_uiSpaceRadius; //filter windows radius: 1-3x3, 2-5x5,3-7x7. Larger size, slower speed
|
||||
uint16_t m_uiType; //do denoising on which component 1-Y, 2-U, 4-V; 7-YUV, 3-YU, 5-YV, 6-UV
|
||||
|
@ -73,8 +73,8 @@ void GeneralBilinearFastDownsampler_c (uint8_t* pDst, const int32_t kiDstStride,
|
||||
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
||||
const uint32_t kuiScaleBitWidth = 16, kuiScaleBitHeight = 15;
|
||||
const uint32_t kuiScaleWidth = (1 << kuiScaleBitWidth), kuiScaleHeight = (1 << kuiScaleBitHeight);
|
||||
int32_t fScalex = (int32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kuiScaleWidth);
|
||||
int32_t fScaley = (int32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kuiScaleHeight);
|
||||
int32_t fScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
|
||||
int32_t fScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
|
||||
uint32_t x;
|
||||
int32_t iYInverse, iXInverse;
|
||||
|
||||
@ -142,8 +142,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr
|
||||
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
||||
const int32_t kiScaleBit = 15;
|
||||
const int32_t kiScale = (1 << kiScaleBit);
|
||||
int32_t iScalex = (int32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kiScale);
|
||||
int32_t iScaley = (int32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kiScale);
|
||||
int32_t iScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kiScale);
|
||||
int32_t iScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kiScale);
|
||||
int64_t x;
|
||||
int32_t iYInverse, iXInverse;
|
||||
|
||||
@ -208,8 +208,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr
|
||||
// const int32_t kiScaleBitWidth = 16, kiScaleBitHeight = 15;
|
||||
// const uint32_t kuiScaleWidth = (1 << kiScaleBitWidth), kuiScaleHeight = (1 << kiScaleBitHeight);
|
||||
//
|
||||
// uint32_t uiScalex = (uint32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kuiScaleWidth);
|
||||
// uint32_t uiScaley = (uint32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kuiScaleHeight);
|
||||
// uint32_t uiScalex = (uint32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
|
||||
// uint32_t uiScaley = (uint32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
|
||||
//
|
||||
// GeneralBilinearFastDownsampler_sse2 (pDst, kiDstStride, kiDstWidth, kiDstHeight,
|
||||
// pSrc, kiSrcStride, kiSrcWidth, kiSrcHeight, uiScalex, uiScaley);
|
||||
@ -221,8 +221,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr
|
||||
// const int32_t kiScaleBit = 15;
|
||||
// const uint32_t kuiScale = (1 << kiScaleBit);
|
||||
//
|
||||
// uint32_t uiScalex = (uint32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kuiScale);
|
||||
// uint32_t uiScaley = (uint32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kuiScale);
|
||||
// uint32_t uiScalex = (uint32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScale);
|
||||
// uint32_t uiScaley = (uint32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScale);
|
||||
//
|
||||
// GeneralBilinearAccurateDownsampler_sse2 (pDst, kiDstStride, kiDstWidth, kiDstHeight,
|
||||
// pSrc, kiSrcStride, kiSrcWidth, kiSrcHeight, uiScalex, uiScaley);
|
||||
|
Loading…
Reference in New Issue
Block a user