Direct link to the correct Bit Twiddling Hacks section.
You should just do the math to see why those numbers were chosen.
abcd efgh
* 0000 1000 0000 0010
----------------------------------------------
0abc defg h00a bcde fgh0
& 0010 0010 0001 0001 0000
----------------------------------------------
00b0 00f0 000a 000e 0000
abcd efgh
* 1000 0000 0010 0000
----------------------------------------------
0abc defg h00a bcde fgh0 0000
& 0000 1000 1000 0100 0100 0000
----------------------------------------------
0000 d000 h000 0c00 0g00 0000
00b0 00f0 000a 000e 0000
| 0000 d000 h000 0c00 0g00 0000
----------------------------------------------
d0b0 h0f0 0c0a 0g0e 0000
* 0001 0000 0001 0000 0001
----------------------------------------------
d0b0 h0f0 dcba hgfe dcba hgfe 0c0a 0g0e 0000
>> and convert to 8-bits
----------------------------------------------
hgfe dcba