Research Article
Design and Implementation of an Embedded NIOS II System for JPEG2000 Tier II Encoding
Algorithm 1
A lookup table implementation of a floored binary logarithm of a 32-bit unsigned integer.
begin | result = 0 | if input >= 65536 then input >>= 16; result+ = 16; fi | if input >= 256 then input >>= 8; result+ = 8; fi | if input >= 16 then input >>= 4; result+ = 4; fi | if input >= 4 then input >>= 2; result+ = 2; fi | if input >= 2 then input >>= 1; result+ = 1; fi | return result; | end |
|