History

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.

Martin Storsjö committed 12 years ago

Commit d36b10f1 parent ba6bf7d4 files · +15 −20Browse files

Showing the changes to codec/processing/src (4 of 4 files). Show all

Unified · Split

4 files
  1. codec/processing/src/adaptivequantization/AdaptiveQuantization.cpp +6 −6
  2. codec/processing/src/common/typedef.h +0 −5
  3. codec/processing/src/denoise/denoise.h +1 −1
  4. codec/processing/src/downsample/downsamplefuncs.cpp +8 −8
codec/processing/src/adaptivequantization/AdaptiveQuantization.cpp+6−6
@@ -69,12 +69,12 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 68 unmodified lines
6969 SVAACalcResult* pVaaCalcResults = NULL;
7070 int8_t iMotionTextureIndexToDeltaQp = 0;
7171 int32_t iAverMotionTextureIndexToDeltaQp = 0; // double to uint32
72− double_t dAverageMotionIndex = 0.0; // double to float
73− double_t dAverageTextureIndex = 0.0;
72+ double dAverageMotionIndex = 0.0; // double to float
73+ double dAverageTextureIndex = 0.0;
7474
75− double_t dQStep = 0.0;
76− double_t dLumaMotionDeltaQp = 0;
77− double_t dLumaTextureDeltaQp = 0;
75+ double dQStep = 0.0;
76+ double dLumaMotionDeltaQp = 0;
77+ double dLumaTextureDeltaQp = 0;
7878
7979 uint8_t* pRefFrameY = NULL, *pCurFrameY = NULL;
8080 int32_t iRefStride = 0, iCurStride = 0;
@@ -170,7 +170,7 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 89 unmodified lines
170170 pMotionTexture = m_sAdaptiveQuantParam.pMotionTextureUnit;
171171 for (j = 0; j < iMbHeight; j ++) {
172172 for (i = 0; i < iMbWidth; i++) {
173− double_t a = pMotionTexture->uiTextureIndex / dAverageTextureIndex;
173+ double a = pMotionTexture->uiTextureIndex / dAverageTextureIndex;
174174 dQStep = (a - 1) / (a + MODEL_ALPHA);
175175 dLumaTextureDeltaQp = MODEL_TIME * dQStep;// range +- 6
176176
codec/processing/src/common/typedef.h+0−5
@@ -76,11 +76,6 @@ typedef unsigned __int64 uint64_t ; · 75 unmodified lines
7676 typedef char str_t ; // [comment]: specific use plain char only for character parameters
7777 typedef bool bool_t ;
7878
79−#if defined(_WIN32) || defined(_MACH_PLATFORM) || defined(__GNUC__)
80−typedef float float_t ;
81−typedef double double_t ;
82−#endif
83−
8479 enum {
8580 FALSE = 0,
8681 TRUE = !FALSE
codec/processing/src/denoise/denoise.h+1−1
@@ -96,7 +96,7 @@ class CDenoiser : public IStrategy { · 95 unmodified lines
9696 void WaverageDenoiseChroma (uint8_t* pSrcUV, int32_t width, int32_t height, int32_t stride);
9797
9898 private:
99− float_t m_fSigmaGrey; //sigma for grey scale similarity, suggestion 2.5-3
99+ float m_fSigmaGrey; //sigma for grey scale similarity, suggestion 2.5-3
100100 uint32_t m_uiFilterWindow; //filter window diameter
101101 uint16_t m_uiSpaceRadius; //filter windows radius: 1-3x3, 2-5x5,3-7x7. Larger size, slower speed
102102 uint16_t m_uiType; //do denoising on which component 1-Y, 2-U, 4-V; 7-YUV, 3-YU, 5-YV, 6-UV
codec/processing/src/downsample/downsamplefuncs.cpp+8−8
@@ -73,8 +73,8 @@ void GeneralBilinearFastDownsampler_c (uint8_t* pDst, const int32_t kiDstStride, · 72 unmodified lines
7373 uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
7474 const uint32_t kuiScaleBitWidth = 16, kuiScaleBitHeight = 15;
7575 const uint32_t kuiScaleWidth = (1 << kuiScaleBitWidth), kuiScaleHeight = (1 << kuiScaleBitHeight);
76− int32_t fScalex = (int32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kuiScaleWidth);
77− int32_t fScaley = (int32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kuiScaleHeight);
76+ int32_t fScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
77+ int32_t fScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
7878 uint32_t x;
7979 int32_t iYInverse, iXInverse;
8080
@@ -142,8 +142,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr · 61 unmodified lines
142142 uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
143143 const int32_t kiScaleBit = 15;
144144 const int32_t kiScale = (1 << kiScaleBit);
145− int32_t iScalex = (int32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kiScale);
146− int32_t iScaley = (int32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kiScale);
145+ int32_t iScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kiScale);
146+ int32_t iScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kiScale);
147147 int64_t x;
148148 int32_t iYInverse, iXInverse;
149149
@@ -208,8 +208,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr · 58 unmodified lines
208208 // const int32_t kiScaleBitWidth = 16, kiScaleBitHeight = 15;
209209 // const uint32_t kuiScaleWidth = (1 << kiScaleBitWidth), kuiScaleHeight = (1 << kiScaleBitHeight);
210210 //
211−// uint32_t uiScalex = (uint32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kuiScaleWidth);
212−// uint32_t uiScaley = (uint32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kuiScaleHeight);
211+// uint32_t uiScalex = (uint32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
212+// uint32_t uiScaley = (uint32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
213213 //
214214 // GeneralBilinearFastDownsampler_sse2 (pDst, kiDstStride, kiDstWidth, kiDstHeight,
215215 // pSrc, kiSrcStride, kiSrcWidth, kiSrcHeight, uiScalex, uiScaley);
@@ -221,8 +221,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr · 5 unmodified lines
221221 // const int32_t kiScaleBit = 15;
222222 // const uint32_t kuiScale = (1 << kiScaleBit);
223223 //
224−// uint32_t uiScalex = (uint32_t) ((float_t)kiSrcWidth / (float_t)kiDstWidth * kuiScale);
225−// uint32_t uiScaley = (uint32_t) ((float_t)kiSrcHeight / (float_t)kiDstHeight * kuiScale);
224+// uint32_t uiScalex = (uint32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScale);
225+// uint32_t uiScaley = (uint32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScale);
226226 //
227227 // GeneralBilinearAccurateDownsampler_sse2 (pDst, kiDstStride, kiDstWidth, kiDstHeight,
228228 // pSrc, kiSrcStride, kiSrcWidth, kiSrcHeight, uiScalex, uiScaley);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t