926 0x0504, 0x0504, 0x0504, 0x0504));
930 0x1110, 0x2220, 0x4440, 0x8880));
936 0x0504, 0x0504, 0x0504, 0x0504));
954 inc_sum, 7, 8, 9, 10, 11, 12, 13, 14);
962 inc_sum, 7, 8, 9, 10, 11, 12, 13, 14);
970 0x0808, 0x0A0A, 0x0C0C, 0x0E0E));
981 -1, 127, 63, 31, 15, 7, 3, 1),
bit_idx);
1052 ui32 missing_msbs,
ui32 num_passes,
1061 if (num_passes > 1 &&
lengths2 == 0)
1063 OJPH_WARN(0x00010001,
"A malformed codeblock that has more than "
1064 "one coding pass, but zero length for "
1065 "2nd and potential 3rd pass.\n");
1071 OJPH_WARN(0x00010002,
"We do not support more than 3 coding passes; "
1072 "This codeblocks has %d passes.\n",
1077 if (missing_msbs > 30)
1082 OJPH_WARN(0x00010003,
"32 bits are not enough to decode this "
1083 "codeblock. This message will not be "
1084 "displayed again.\n");
1088 else if (missing_msbs == 30)
1092 OJPH_WARN(0x00010004,
"Not enough precision to decode the cleanup "
1093 "pass. The code can be modified to support "
1094 "this case. This message will not be "
1095 "displayed again.\n");
1099 else if (missing_msbs == 29)
1101 if (num_passes > 1) {
1105 OJPH_WARN(0x00010005,
"Not enough precision to decode the SgnProp "
1106 "nor MagRef passes; both will be skipped. "
1107 "This message will not be displayed "
1112 ui32 p = 30 - missing_msbs;
1118 OJPH_WARN(0x00010006,
"Wrong codeblock length.\n");
1145 ui16 scratch[8 * 513] = {0};
1153 ui32 sstr = ((width + 2u) + 7u) & ~7u;
1155 assert((stride & 0x3) == 0);
1181 for (
ui32 x = 0; x < width;
sp += 4)
1200 t0 = (run == -1) ?
t0 : 0;
1214 c_q = ((
t0 & 0x10U) << 3) | ((
t0 & 0xE0U) << 2);
1226 if (
c_q == 0 && x < width)
1231 t1 = (run == -1) ?
t1 : 0;
1236 t1 = x < width ?
t1 : 0;
1245 c_q = ((
t1 & 0x10U) << 3) | ((
t1 & 0xE0U) << 2);
1290 for (
ui32 y = 2; y < height; y += 2)
1295 for (
ui32 x = 0; x < width;
sp += 4)
1318 t0 = (run == -1) ?
t0 : 0;
1333 c_q = ((
t0 & 0x40U) << 2) | ((
t0 & 0x80U) << 1);
1350 if (
c_q == 0 && x < width)
1355 t1 = (run == -1) ?
t1 : 0;
1360 t1 = x < width ?
t1 : 0;
1370 c_q = ((
t1 & 0x40U) << 2) | ((
t1 & 0x80U) << 1);
1430 for (
ui32 x = 0; x < width; x += 4,
sp += 4,
vp += 2,
dp += 4)
1465 for (
ui32 y = 2; y < height; y += 2)
1471 31, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4
1474 31, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
1480 for (
ui32 x = 0; x <= width; x += 8,
vp += 4)
1509 for (
ui32 x = 0; x < width; x += 4,
sp += 4,
vp += 2,
dp += 4)
1583 for (
ui32 x = 0; x < width; x += 4,
sp += 4,
vp += 2,
dp += 4)
1609 -1, 0x0908, -1, 0x0D0C));
1613 -1, 0x0B0A, -1, 0x0F0E));
1618 for (
ui32 y = 2; y < height; y += 2)
1624 15, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4
1627 15, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
1632 for (
ui32 x = 0; x <= width; x += 16,
vp += 8)
1657 for (
ui32 x = 0; x < width; x += 4,
sp += 4,
vp += 2,
dp += 4)
1679 0x0504, -1, 0x0706, -1));
1703 -1, 0x0908, -1, 0x0D0C));
1707 -1, 0x0B0A, -1, 0x0F0E));
1737 for (y = 0; y < height; y += 4)
1741 for (
ui32 x = 0; x < width; x += 8,
sp += 8,
dp += 2)
1769 for (
ui32 x = 0; x < width; x += 32,
dp += 8)
1791 for (
ui32 y = 0; y < height; y += 4)
1794 if (height - y < 4) {
1796 if (height - y < 3) {
1830 ui32 u = (
ps & 0x88888888) >> 3;
1832 u |= (
ns & 0x11111111) << 3;
1837 mbr |= (
cs & 0x77777777) << 1;
1838 mbr |= (
cs & 0xEEEEEEEE) >> 1;
1921 wasm_i8x16_const(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1));
1932 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30);
1935 7, 8, 9, 10, 11, 12, 13, 14);
1946 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30);
1952 wasm_i8x16_const(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1));
1965 0,-1,-1,-1,4,-1,-1,-1,8,-1,-1,-1,12,-1,-1,-1);
1968 for (
int c = 0;
c < 4; ++
c) {
2018 for (
ui32 y = 0; y < height; y += 4)
2022 for (
ui32 i = 0;
i < width;
i += 4,
dpp += 4)
2037 wasm_i8x16_const(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1));
2048 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30);
2051 7, 8, 9, 10, 11, 12, 13, 14);
2062 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30);
2071 wasm_i8x16_const(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1));
2084 8,-1,-1,-1,12,-1,-1,-1);
2086 for (
int c = 0;
c < 4; ++
c) {