=========================================================================== * Reverse the first len bits of a code, using straightforward code (a faster * method would use a table) * IN assertion: 1 <= len <= 15 */
| 152 | * IN assertion: 1 <= len <= 15 |
| 153 | */ |
| 154 | local unsigned bi_reverse(unsigned code, int len) { |
| 155 | register unsigned res = 0; |
| 156 | do { |
| 157 | res |= code & 1; |
| 158 | code >>= 1, res <<= 1; |
| 159 | } while (--len > 0); |
| 160 | return res >> 1; |
| 161 | } |
| 162 | |
| 163 | /* =========================================================================== |
| 164 | * Flush the bit buffer, keeping at most 7 bits in it. |
no outgoing calls
no test coverage detected