1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Compare commits

...

2 Commits

Author SHA1 Message Date
0d44663570 Cosmetics 2024-08-21 08:38:13 +02:00
92bd37c481 Code cleanup 2024-08-21 08:24:37 +02:00

View File

@ -3,8 +3,6 @@
using namespace IMG; using namespace IMG;
#define max(a, b) ((a) > (b) ? (a) : (b))
static const quint8 Z[] = { static const quint8 Z[] = {
8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
@ -27,9 +25,9 @@ JLS::JLS(quint16 maxval, quint16 near)
_near = near; _near = near;
_range = ((_maxval + _near * 2) / (_near * 2 + 1)) + 1; _range = ((_maxval + _near * 2) / (_near * 2 + 1)) + 1;
_qbpp = ceil(log2(_range)); _qbpp = qCeil(log2(_range));
quint8 bpp = max(2, ceil(log2(_maxval + 1))); quint8 bpp = qMax(2, qCeil(log2(_maxval + 1)));
quint8 LIMIT = 2 * (bpp + max(8, bpp)); quint8 LIMIT = 2 * (bpp + qMax(8u, bpp));
_limit = LIMIT - _qbpp - 1; _limit = LIMIT - _qbpp - 1;
} }
@ -312,7 +310,7 @@ bool JLS::decode(const SubFile *file, SubFile::Handle &hdl, Matrix<qint16> &img)
_rg = 1; _rg = 1;
_lrk = 0; _lrk = 0;
quint16 A = max(2, (_range + 32) / 64); quint16 A = qMax(2, (_range + 32) / 64);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
_a[i] = A; _a[i] = A;
_b[i] = 0; _b[i] = 0;