mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibGfx/JPEGWriter: Rename y<=>x, u<=>v
Usually x and u go horizontally and y and v go vertically. No behavior change.
This commit is contained in:
parent
08a3c562f3
commit
494fc1234e
|
@ -162,19 +162,19 @@ public:
|
||||||
|
|
||||||
auto const sum_xy = [&](u8 u, u8 v) {
|
auto const sum_xy = [&](u8 u, u8 v) {
|
||||||
double sum {};
|
double sum {};
|
||||||
for (u8 x {}; x < 8; ++x) {
|
for (u8 y {}; y < 8; ++y) {
|
||||||
for (u8 y {}; y < 8; ++y)
|
for (u8 x {}; x < 8; ++x)
|
||||||
sum += component[x * 8 + y] * cosine_table[u * 8 + x] * cosine_table[v * 8 + y];
|
sum += component[y * 8 + x] * cosine_table[u * 8 + x] * cosine_table[v * 8 + y];
|
||||||
}
|
}
|
||||||
return sum;
|
return sum;
|
||||||
};
|
};
|
||||||
|
|
||||||
for (u8 u {}; u < 8; ++u) {
|
for (u8 v {}; v < 8; ++v) {
|
||||||
double const cu = u == 0 ? inverse_sqrt_2 : 1;
|
double const cv = v == 0 ? inverse_sqrt_2 : 1;
|
||||||
for (u8 v {}; v < 8; ++v) {
|
for (u8 u {}; u < 8; ++u) {
|
||||||
auto const table_index = u * 8 + v;
|
auto const table_index = v * 8 + u;
|
||||||
|
|
||||||
double const cv = v == 0 ? inverse_sqrt_2 : 1;
|
double const cu = u == 0 ? inverse_sqrt_2 : 1;
|
||||||
|
|
||||||
// A.3.3 - FDCT and IDCT
|
// A.3.3 - FDCT and IDCT
|
||||||
double const fdct = cu * cv * sum_xy(u, v) / 4;
|
double const fdct = cu * cv * sum_xy(u, v) / 4;
|
||||||
|
|
Loading…
Reference in a new issue