Created
January 6, 2015 04:35
-
-
Save sandeen/823ceb55083dacd2d9bc to your computer and use it in GitHub Desktop.
fix for non-8-bit-multiples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Packet is 1 bit per byte, pack to 8-bits per byte. | |
for pIdx := 0; pIdx < len(d.pkt)*8; pIdx++ { | |
d.pkt[pIdx>>3] <<= 1 | |
if pIdx < d.Cfg.PacketSymbols { | |
d.pkt[pIdx>>3] |= d.Quantized[qIdx+(pIdx*d.Cfg.SymbolLength2)] | |
} else { // zero out last bits past PacketSymbols | |
d.pkt[pIdx>>3] |= 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment