This is how I got my head around how they are packed:
bytes is left to right, pixels is down, numbers are bits in the pixel value
0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
0 10 98765432
1 987654 3210
2 543210 9876
3 98 76543210
4 98765432 10
5 3210 987654
6 9876 543210
7 76543210 98
If you reverse the bytes, it makes more sense
EDIT: I.e. this is how it would be arranged in memory if it was big endian, which it isn't!
0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
0 9876543210
1 9876543210
2 9876543210
3 9876543210
4 9876543210
5 9876543210
6 9876543210
7 9876543210
Edit:
Newer cameras are 12 bpp
0 |1 |2 |3 |4 |5 |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
0 3210 BA987654
1 BA98 76543210
2 BA987654 3210
3 76543210 BA98