jcmp: My image compression format (w/ wavelets)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
|
|
|
|
namespace wvlt {
|
|
|
|
// first row of the matrix Wn
|
|
|
|
static double const evn_coef[] = {
|
|
|
|
(1.0 + std::sqrt(3.0))/(std::sqrt(32.0)),
|
|
|
|
(3.0 + std::sqrt(3.0))/(std::sqrt(32.0)),
|
|
|
|
(3.0 - std::sqrt(3.0))/(std::sqrt(32.0)),
|
|
|
|
(1.0 - std::sqrt(3.0))/(std::sqrt(32.0))
|
|
|
|
};
|
|
|
|
|
|
|
|
// second row of the matrix Wn
|
|
|
|
static double const odd_coef[] = {
|
|
|
|
evn_coef[3],
|
|
|
|
-evn_coef[2],
|
|
|
|
evn_coef[1],
|
|
|
|
-evn_coef[0]
|
|
|
|
};
|
|
|
|
|
|
|
|
// first (shifted) row of the matrix Wn^-1
|
|
|
|
static double const evn_coef_inv[] = {
|
|
|
|
evn_coef[2],
|
|
|
|
evn_coef[1],
|
|
|
|
evn_coef[0],
|
|
|
|
evn_coef[3]
|
|
|
|
};
|
|
|
|
|
|
|
|
// second (shifted) row of the matrix Wn^-1
|
|
|
|
static double const odd_coef_inv[] = {
|
|
|
|
evn_coef[3],
|
|
|
|
-evn_coef[0],
|
|
|
|
evn_coef[1],
|
|
|
|
-evn_coef[2]
|
|
|
|
};
|
|
|
|
}
|