fluffy has asked for the wisdom of the Perl Monks concerning the following question:
Now, I wish to decode the 7-bit data to 8-bit data, and back again. The question is, what's the most efficient approach? I'm sure something using unpack & vec should be in order, but I'm unsure which is the most (time-)efficient approach. I'm gonna be doing this a fair bit, so I'm willing to trade readability for speed. Ideas gratefully received, Thanks.+--------------------------------------------------------- | Internal 7byte data <--convert--> MIDI 8 byte data + | | example: Internal data(bit image) MIDI data(bit image) + | | Aaaaaaaa 0GFEDCBA + | | Bbbbbbbb 0aaaaaaa + | | Cccccccc 0bbbbbbb + | | Dddddddd 0ccccccc + | | Eeeeeeee 0ddddddd + | | Ffffffff 0eeeeeee + | | Gggggggg 0fffffff + | | Hhhhhhhh 0ggggggg + | | Iiiiiiii 0NMLKJIH + | | : 0hhhhhhh + | | : : + | | Vvvvvvvv 000000WV + | | Wwwwwwww 0vvvvvvv + | | 0wwwwwww + | | 11110111 (EOX=F7H) + | +---------------------------------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting 7 & 8-bit values
by BrowserUk (Patriarch) on Dec 03, 2006 at 16:45 UTC | |
by fluffy (Scribe) on Dec 03, 2006 at 17:14 UTC | |
|
Re: Converting 7 & 8-bit values
by GrandFather (Saint) on Dec 03, 2006 at 21:24 UTC | |
by BrowserUk (Patriarch) on Dec 04, 2006 at 04:13 UTC | |
by GrandFather (Saint) on Dec 04, 2006 at 04:24 UTC | |
by fluffy (Scribe) on Dec 09, 2006 at 07:00 UTC | |
|
Re: Converting 7 & 8-bit values
by Corion (Patriarch) on Dec 03, 2006 at 15:40 UTC | |
by fluffy (Scribe) on Dec 03, 2006 at 15:52 UTC | |
|
Re: Converting 7 & 8-bit values
by aufflick (Deacon) on Dec 04, 2006 at 03:42 UTC | |
|
Re: Converting 7 & 8-bit values
by Anonymous Monk on Dec 03, 2006 at 19:33 UTC |