3e12aff909
DXT Testing:
The modified algorithm has been tested on the Kodak test set using 64-bit build with default settings (running on Windows 10, i7-4790, 3.6GHz). All the decompressed test images are identical to the images being compressed and decompressed using original version of Crunch (revision ea9b8d8).
[Compressing Kodak set without mipmaps using DXT1 encoding]
Original: 1582222 bytes / 28.866 sec
Modified: 1468204 bytes / 11.858 sec
Improvement: 7.21% (compression ratio) / 58.92% (compression time)
[Compressing Kodak set with mipmaps using DXT1 encoding]
Original: 2065243 bytes / 36.878 sec
Modified: 1914805 bytes / 15.625 sec
Improvement: 7.28% (compression ratio) / 57.63% (compression time)
ETC Testing:
The modified algorithm has been tested on the Kodak test set using 64-bit build with default settings (running on Windows 10, i7-4790, 3.6GHz). The ETC1 quantization parameters have been selected in such a way, so that ETC1 compression gives approximately the same average Luma PSNR as the corresponding DXT1 compression (which is equal to 34.044 dB for the Kodak test set compressed without mipmaps using DXT1 encoding and default quality settings).
[Compressing Kodak set without mipmaps using ETC1 encoding]
Total size: 1607858 bytes
Total time: 17.181 sec
Average bitrate: 1.363 bpp
Average Luma PSNR: 34.050 dB
65 lines
1.8 KiB
C++
65 lines
1.8 KiB
C++
// File: crn_win32_timer.h
|
|
// See Copyright Notice and license at the end of inc/crnlib.h
|
|
#pragma once
|
|
|
|
namespace crnlib {
|
|
typedef unsigned long long timer_ticks;
|
|
|
|
class timer {
|
|
public:
|
|
timer();
|
|
timer(timer_ticks start_ticks);
|
|
|
|
void start();
|
|
void start(timer_ticks start_ticks);
|
|
|
|
void stop();
|
|
|
|
double get_elapsed_secs() const;
|
|
inline double get_elapsed_ms() const { return get_elapsed_secs() * 1000.0f; }
|
|
timer_ticks get_elapsed_us() const;
|
|
|
|
static void init();
|
|
static inline timer_ticks get_ticks_per_sec() { return g_freq; }
|
|
static timer_ticks get_init_ticks();
|
|
static timer_ticks get_ticks();
|
|
static double ticks_to_secs(timer_ticks ticks);
|
|
static inline double ticks_to_ms(timer_ticks ticks) { return ticks_to_secs(ticks) * 1000.0f; }
|
|
static inline double get_secs() { return ticks_to_secs(get_ticks()); }
|
|
static inline double get_ms() { return ticks_to_ms(get_ticks()); }
|
|
|
|
private:
|
|
static timer_ticks g_init_ticks;
|
|
static timer_ticks g_freq;
|
|
static double g_inv_freq;
|
|
|
|
timer_ticks m_start_time;
|
|
timer_ticks m_stop_time;
|
|
|
|
bool m_started : 1;
|
|
bool m_stopped : 1;
|
|
};
|
|
|
|
// Prints object's lifetime to stdout
|
|
class timed_scope {
|
|
const char* m_pName;
|
|
timer m_tm;
|
|
|
|
public:
|
|
inline timed_scope(const char* pName = "timed_scope")
|
|
: m_pName(pName) { m_tm.start(); }
|
|
|
|
inline double get_elapsed_secs() const { return m_tm.get_elapsed_secs(); }
|
|
inline double get_elapsed_ms() const { return m_tm.get_elapsed_ms(); }
|
|
|
|
const timer& get_timer() const { return m_tm; }
|
|
timer& get_timer() { return m_tm; }
|
|
|
|
inline ~timed_scope() {
|
|
double secs = m_tm.get_elapsed_secs();
|
|
printf("%s: %f secs, %f ms\n", m_pName, secs, secs * 1000.0f);
|
|
}
|
|
};
|
|
|
|
} // namespace crnlib
|