if(mode == MODE_FAST)
{
+ // FAST: trick from libtxc_dxtn: just get brightest and darkest colors, and encode using these
+
color_t c0 = {0, 0, 0};
c[0].r = rgba[2];
{
if(nrandom > 0)
return s2tc_encode_block_func<dxt, ColorDist, MODE_RANDOM>(refine);
- else if(nrandom == 0)
+ else if(nrandom == 0 || ColorDist == color_dist_normalmap) // MODE_FAST not supported for normalmaps, sorry
return s2tc_encode_block_func<dxt, ColorDist, MODE_NORMAL>(refine);
else
return s2tc_encode_block_func<dxt, ColorDist, MODE_FAST>(refine);
html_rowstart()
{
echo >&3 "<tr><th>$1</th>"
+ deltatime=
}
html()
{
convert "$1" -crop 256x256+192+128 "html/$1.png"
- echo >&3 "<td><img src=\"$1.png\" alt=\"$1\"></td>"
+ echo >&3 "<td><img src=\"$1.png\" alt=\"$1\" title=\"$1$deltatime\"></td>"
}
html2()
{
./s2tc_decompress < "$1" | convert TGA:- -crop 256x256+192+128 "html/$1-s2tc.png"
- echo >&3 "<td><img src=\"$1-s2tc.png\" alt=\"$1\"></td>"
+ echo >&3 "<td><img src=\"$1-s2tc.png\" alt=\"$1\" title=\"$1$deltatime\"></td>"
}
html_rowend()
{
echo >&3 "</table></body></html>"
}
+timing()
+{
+ t0=`date +%s%N`
+ "$@"
+ t1=`date +%s%N`
+ deltatime=`echo "scale=3; ($t1 - $t0) / 1000000000" | bc -l`
+ deltatime=" ($deltatime seconds)"
+}
+
t()
{
in=$1; shift
out=$1; shift
- time "$@" < "$in" > "$out"
+ timing "$@" < "$in" > "$out"
html "$out"
echo "$LD_PRELOAD"
}
html "$i".tga
if $use_compressonator; then
- time wine "c:/Program Files (x86)/AMD/The Compressonator 1.50/TheCompressonator.exe" -convert -overwrite -mipmaps "$i".tga "$i"-amdcompress.dds -codec DXTC.dll +fourCC DXT1 -mipper BoxFilter.dll
+ timing wine "c:/Program Files (x86)/AMD/The Compressonator 1.50/TheCompressonator.exe" -convert -overwrite -mipmaps "$i".tga "$i"-amdcompress.dds -codec DXTC.dll +fourCC DXT1 -mipper BoxFilter.dll
html "$i"-amdcompress.dds
fi
if $use_nvcompress; then
- time nvcompress "$i".tga "$i"-nvcompress.dds
+ timing nvcompress "$i".tga "$i"-nvcompress.dds
html "$i"-nvcompress.dds
fi
( S2TC_COLORDIST_MODE=AVG S2TC_RANDOM_COLORS=64 S2TC_REFINE_COLORS=CHECK t "$i".tga "$i"-rand64-avg-r.dds ./s2tc )
if $use_libtxc_dxtn; then
- ( LD_PRELOAD=/usr/lib/libtxc_dxtn.so t "$i".tga "$i"-libtxc_dxtn.dds ./s2tc )
+ ( LD_PRELOAD=/usr/lib/libtxc_dxtn.so t "$i".tga "$i"-libtxc_dxtn.dds ./s2tc )
fi
( S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=0 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-norand-wavg-r.dds ./s2tc )
( S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=-1 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-faster-wavg-r.dds ./s2tc )