| 171 | } |
| 172 | |
| 173 | __ri static u8 getBits8(u8 *address, bool advance) |
| 174 | { |
| 175 | if (!g_BP.FillBuffer(8)) return 0; |
| 176 | |
| 177 | const u8* readpos = &g_BP.internal_qwc[0]._u8[g_BP.BP/8]; |
| 178 | |
| 179 | if (uint shift = (g_BP.BP & 7)) |
| 180 | { |
| 181 | uint mask = (0xff >> shift); |
| 182 | *(u8*)address = (((~mask) & readpos[1]) >> (8 - shift)) | (((mask) & *readpos) << shift); |
| 183 | } |
| 184 | else |
| 185 | { |
| 186 | *(u8*)address = *(u8*)readpos; |
| 187 | } |
| 188 | |
| 189 | if (advance) g_BP.Advance(8); |
| 190 | |
| 191 | return 1; |
| 192 | } |
| 193 | |
| 194 | |
| 195 | #define W1 2841 /* 2048*sqrt (2)*cos (1*pi/16) */ |
no test coverage detected