Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
8b311b5a
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8b311b5a
编写于
7月 08, 2021
作者:
T
tickduan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
inline other modify
上级
98898dc5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
25 addition
and
33 deletion
+25
-33
deps/SZ/sz/src/CompressElement.c
deps/SZ/sz/src/CompressElement.c
+11
-11
deps/SZ/sz/src/DynamicByteArray.c
deps/SZ/sz/src/DynamicByteArray.c
+4
-3
deps/SZ/sz/src/DynamicIntArray.c
deps/SZ/sz/src/DynamicIntArray.c
+2
-1
deps/SZ/sz/src/TypeManager.c
deps/SZ/sz/src/TypeManager.c
+1
-1
deps/SZ/sz/src/dataCompression.c
deps/SZ/sz/src/dataCompression.c
+5
-5
deps/SZ/sz/src/sz.c
deps/SZ/sz/src/sz.c
+1
-11
deps/SZ/sz/src/sz_double.c
deps/SZ/sz/src/sz_double.c
+1
-1
未找到文件。
deps/SZ/sz/src/CompressElement.c
浏览文件 @
8b311b5a
...
...
@@ -19,7 +19,7 @@
#include "CompressElement.h"
inline
short
computeGroupNum_float
(
float
value
)
INLINE
short
computeGroupNum_float
(
float
value
)
{
short
expo
=
getExponent_float
(
value
);
if
(
expo
<
0
)
...
...
@@ -27,7 +27,7 @@ inline short computeGroupNum_float(float value)
return
expo
;
}
inline
short
computeGroupNum_double
(
double
value
)
INLINE
short
computeGroupNum_double
(
double
value
)
{
short
expo
=
getExponent_double
(
value
);
if
(
expo
<
0
)
...
...
@@ -40,35 +40,35 @@ inline short computeGroupNum_double(double value)
* @param last3CmprsData buffer
* @param value the value to be added to the buffer
* */
inline
void
listAdd_double
(
double
last3CmprsData
[
3
],
double
value
)
INLINE
void
listAdd_double
(
double
last3CmprsData
[
3
],
double
value
)
{
last3CmprsData
[
2
]
=
last3CmprsData
[
1
];
last3CmprsData
[
1
]
=
last3CmprsData
[
0
];
last3CmprsData
[
0
]
=
value
;
}
inline
void
listAdd_float
(
float
last3CmprsData
[
3
],
float
value
)
INLINE
void
listAdd_float
(
float
last3CmprsData
[
3
],
float
value
)
{
last3CmprsData
[
2
]
=
last3CmprsData
[
1
];
last3CmprsData
[
1
]
=
last3CmprsData
[
0
];
last3CmprsData
[
0
]
=
value
;
}
inline
void
listAdd_int
(
int64_t
last3CmprsData
[
3
],
int64_t
value
)
INLINE
void
listAdd_int
(
int64_t
last3CmprsData
[
3
],
int64_t
value
)
{
last3CmprsData
[
2
]
=
last3CmprsData
[
1
];
last3CmprsData
[
1
]
=
last3CmprsData
[
0
];
last3CmprsData
[
0
]
=
value
;
}
inline
void
listAdd_int32
(
int32_t
last3CmprsData
[
3
],
int32_t
value
)
INLINE
void
listAdd_int32
(
int32_t
last3CmprsData
[
3
],
int32_t
value
)
{
last3CmprsData
[
2
]
=
last3CmprsData
[
1
];
last3CmprsData
[
1
]
=
last3CmprsData
[
0
];
last3CmprsData
[
0
]
=
value
;
}
inline
void
listAdd_float_group
(
float
*
groups
,
int
*
flags
,
char
groupNum
,
float
oriValue
,
float
decValue
,
char
*
curGroupID
)
INLINE
void
listAdd_float_group
(
float
*
groups
,
int
*
flags
,
char
groupNum
,
float
oriValue
,
float
decValue
,
char
*
curGroupID
)
{
if
(
groupNum
>=
0
)
{
...
...
@@ -88,7 +88,7 @@ inline void listAdd_float_group(float *groups, int *flags, char groupNum, float
*
curGroupID
=
-
(
groupNum
+
2
);
//-[-1,0,1,2,3,....,16] is mapped to [-1,-2,....,-18]
}
inline
void
listAdd_double_group
(
double
*
groups
,
int
*
flags
,
char
groupNum
,
double
oriValue
,
double
decValue
,
char
*
curGroupID
)
INLINE
void
listAdd_double_group
(
double
*
groups
,
int
*
flags
,
char
groupNum
,
double
oriValue
,
double
decValue
,
char
*
curGroupID
)
{
if
(
groupNum
>=
0
)
{
...
...
@@ -112,7 +112,7 @@ inline void listAdd_double_group(double *groups, int *flags, char groupNum, doub
* Determine whether the prediction value minErr is valid.
*
* */
inline
int
validPrediction_double
(
double
minErr
,
double
precision
)
INLINE
int
validPrediction_double
(
double
minErr
,
double
precision
)
{
if
(
minErr
<=
precision
)
return
1
;
...
...
@@ -120,7 +120,7 @@ inline int validPrediction_double(double minErr, double precision)
return
0
;
}
inline
int
validPrediction_float
(
float
minErr
,
float
precision
)
INLINE
int
validPrediction_float
(
float
minErr
,
float
precision
)
{
if
(
minErr
<=
precision
)
return
1
;
...
...
@@ -204,7 +204,7 @@ void updateLossyCompElement_Double(unsigned char* curBytes, unsigned char* preBy
lce
->
residualMidBits
=
resiBits
;
}
inline
void
updateLossyCompElement_Float
(
unsigned
char
*
diffBytes
,
unsigned
char
*
preDiffBytes
,
INLINE
void
updateLossyCompElement_Float
(
unsigned
char
*
diffBytes
,
unsigned
char
*
preDiffBytes
,
int
reqBytesLength
,
int
resiBitsLength
,
LossyCompressionElement
*
lce
)
{
int
resiIndex
,
intMidBytes_Length
=
0
;
...
...
deps/SZ/sz/src/DynamicByteArray.c
浏览文件 @
8b311b5a
...
...
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <string.h>
#include "DynamicByteArray.h"
#include "sz.h"
void
new_DBA
(
DynamicByteArray
**
dba
,
size_t
cap
)
{
*
dba
=
(
DynamicByteArray
*
)
malloc
(
sizeof
(
DynamicByteArray
));
...
...
@@ -35,7 +36,7 @@ void free_DBA(DynamicByteArray *dba)
free
(
dba
);
}
inline
unsigned
char
getDBA_Data
(
DynamicByteArray
*
dba
,
size_t
pos
)
INLINE
unsigned
char
getDBA_Data
(
DynamicByteArray
*
dba
,
size_t
pos
)
{
if
(
pos
>=
dba
->
size
)
{
...
...
@@ -45,7 +46,7 @@ inline unsigned char getDBA_Data(DynamicByteArray *dba, size_t pos)
return
dba
->
array
[
pos
];
}
inline
void
addDBA_Data
(
DynamicByteArray
*
dba
,
unsigned
char
value
)
INLINE
void
addDBA_Data
(
DynamicByteArray
*
dba
,
unsigned
char
value
)
{
if
(
dba
->
size
==
dba
->
capacity
)
{
...
...
@@ -56,7 +57,7 @@ inline void addDBA_Data(DynamicByteArray *dba, unsigned char value)
dba
->
size
++
;
}
inline
void
memcpyDBA_Data
(
DynamicByteArray
*
dba
,
unsigned
char
*
data
,
size_t
length
)
INLINE
void
memcpyDBA_Data
(
DynamicByteArray
*
dba
,
unsigned
char
*
data
,
size_t
length
)
{
if
(
dba
->
size
+
length
>
dba
->
capacity
)
{
...
...
deps/SZ/sz/src/DynamicIntArray.c
浏览文件 @
8b311b5a
...
...
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <string.h>
#include "DynamicIntArray.h"
#include "sz.h"
void
new_DIA
(
DynamicIntArray
**
dia
,
size_t
cap
)
{
*
dia
=
(
DynamicIntArray
*
)
malloc
(
sizeof
(
DynamicIntArray
));
...
...
@@ -45,7 +46,7 @@ int getDIA_Data(DynamicIntArray *dia, size_t pos)
return
dia
->
array
[
pos
];
}
inline
void
addDIA_Data
(
DynamicIntArray
*
dia
,
int
value
)
INLINE
void
addDIA_Data
(
DynamicIntArray
*
dia
,
int
value
)
{
if
(
dia
->
size
==
dia
->
capacity
)
{
...
...
deps/SZ/sz/src/TypeManager.c
浏览文件 @
8b311b5a
...
...
@@ -151,7 +151,7 @@ size_t convertIntArray2ByteArray_fast_2b(unsigned char* timeStepType, size_t tim
return
byteLength
;
}
inline
int
getLeftMovingSteps
(
size_t
k
,
unsigned
char
resiBitLength
)
INLINE
int
getLeftMovingSteps
(
size_t
k
,
unsigned
char
resiBitLength
)
{
return
8
-
k
%
8
-
resiBitLength
;
}
...
...
deps/SZ/sz/src/dataCompression.c
浏览文件 @
8b311b5a
...
...
@@ -177,14 +177,14 @@ void symTransform_8bytes(unsigned char data[8])
data
[
4
]
=
tmp
;
}
inline
void
symTransform_2bytes
(
unsigned
char
data
[
2
])
INLINE
void
symTransform_2bytes
(
unsigned
char
data
[
2
])
{
unsigned
char
tmp
=
data
[
0
];
data
[
0
]
=
data
[
1
];
data
[
1
]
=
tmp
;
}
inline
void
symTransform_4bytes
(
unsigned
char
data
[
4
])
INLINE
void
symTransform_4bytes
(
unsigned
char
data
[
4
])
{
unsigned
char
tmp
=
data
[
0
];
data
[
0
]
=
data
[
3
];
...
...
@@ -195,7 +195,7 @@ inline void symTransform_4bytes(unsigned char data[4])
data
[
2
]
=
tmp
;
}
inline
void
compressSingleFloatValue
(
FloatValueCompressElement
*
vce
,
float
oriValue
,
float
precision
,
float
medianValue
,
INLINE
void
compressSingleFloatValue
(
FloatValueCompressElement
*
vce
,
float
oriValue
,
float
precision
,
float
medianValue
,
int
reqLength
,
int
reqBytesLength
,
int
resiBitsLength
)
{
lfloat
diffVal
;
...
...
@@ -255,7 +255,7 @@ int compIdenticalLeadingBytesCount_double(unsigned char* preBytes, unsigned char
return
n
;
}
inline
int
compIdenticalLeadingBytesCount_float
(
unsigned
char
*
preBytes
,
unsigned
char
*
curBytes
)
INLINE
int
compIdenticalLeadingBytesCount_float
(
unsigned
char
*
preBytes
,
unsigned
char
*
curBytes
)
{
int
i
,
n
=
0
;
for
(
i
=
0
;
i
<
4
;
i
++
)
...
...
@@ -268,7 +268,7 @@ inline int compIdenticalLeadingBytesCount_float(unsigned char* preBytes, unsigne
}
//TODO double-check the correctness...
inline
void
addExactData
(
DynamicByteArray
*
exactMidByteArray
,
DynamicIntArray
*
exactLeadNumArray
,
INLINE
void
addExactData
(
DynamicByteArray
*
exactMidByteArray
,
DynamicIntArray
*
exactLeadNumArray
,
DynamicIntArray
*
resiBitArray
,
LossyCompressionElement
*
lce
)
{
int
i
;
...
...
deps/SZ/sz/src/sz.c
浏览文件 @
8b311b5a
...
...
@@ -163,18 +163,8 @@ void SZ_Finalize()
#ifdef WINDOWS
#include <windows.h>
int
gettimeofday
(
struct
timeval
*
tv
,
struct
timezone
*
tz
);
int
gettimeofday
(
struct
timeval
*
tv
,
struct
timezone
*
tz
)
{
time_t
t
;
t
=
time
(
NULL
);
SYSTEMTIME
st
;
GetLocalTime
(
&
st
);
tv
->
tv_sec
=
(
long
)
t
;
tv
->
tv_usec
=
st
.
wMilliseconds
*
1000
;
return
0
;
}
#else
#include <sys/time.h>
#endif
...
...
deps/SZ/sz/src/sz_double.c
浏览文件 @
8b311b5a
...
...
@@ -30,7 +30,7 @@ unsigned char* SZ_skip_compress_double(double* data, size_t dataLength, size_t*
return
out
;
}
inline
void
computeReqLength_double
(
double
realPrecision
,
short
radExpo
,
int
*
reqLength
,
double
*
medianValue
)
INLINE
void
computeReqLength_double
(
double
realPrecision
,
short
radExpo
,
int
*
reqLength
,
double
*
medianValue
)
{
short
reqExpo
=
getPrecisionReqLength_double
(
realPrecision
);
*
reqLength
=
12
+
radExpo
-
reqExpo
;
//radExpo-reqExpo == reqMantiLength
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录