1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 06:03:51 +00:00

Simplify code.

This commit is contained in:
Bartosz Taudul 2019-06-27 22:40:03 +02:00
parent 77c6acbc48
commit 3c066f1527
2 changed files with 5 additions and 5 deletions

View File

@ -179,8 +179,8 @@ static uint64_t ProcessRGB( const uint8_t* src )
tmp += 4;
}
uint32_t range = ( 4 << 13 ) / ( 1 + max[0] - min[0] + max[1] - min[1] + max[2] - min[2] );
uint8_t rmin[3] = { min[0], min[1], min[2] };
const uint32_t range = ( 4 << 13 ) / ( 1 + max[0] - min[0] + max[1] - min[1] + max[2] - min[2] );
const uint32_t rmin = min[0] + min[1] + min[2];
for( int i=0; i<3; i++ )
{
const uint8_t inset = ( max[i] - min[i] ) >> 4;
@ -191,8 +191,8 @@ static uint64_t ProcessRGB( const uint8_t* src )
uint32_t data = 0;
for( int i=0; i<16; i++ )
{
uint32_t c = src[0] - rmin[0] + src[1] - rmin[1] + src[2] - rmin[2];
uint8_t idx = IndexTable[( c * range ) >> 13];
const uint32_t c = src[0] + src[1] + src[2] - rmin;
const uint8_t idx = IndexTable[( c * range ) >> 13];
data |= idx << (i*2);
src += 4;
}

View File

@ -447,7 +447,7 @@ To further reduce image data size, frame images are internally compressed using
\centering
\begin{tabular}[h]{c|c|c}
\textbf{Implementation} & \textbf{Required define} & \textbf{Time} \\ \hline
x86 Reference & --- & 266 \si{\micro\second} \\
x86 Reference & --- & 252 \si{\micro\second} \\
x86 SSE4.1 & \texttt{\_\_SSE4\_1\_\_} & 97 \si{\micro\second} \\
ARM Reference & --- & 1.29 \si{\milli\second}
\end{tabular}