- // At this stage, we now have a bitstream of "01" ("1") or "10" ("0"), parse it into final decoded bitstream\r
- // Actually, we overwrite BitStream with the new decoded bitstream, we just need to be careful\r
- // to stop output at the final bitidx2 value, not bitidx\r
- for (i = 0; i < bitidx; i += 2) {\r
- if ((BitStream[i] == 0) && (BitStream[i+1] == 1)) {\r
- BitStream[bit2idx++] = 1;\r
+ // At this stage, we now have a bitstream of "01" ("1") or "10" ("0"), parse it into final decoded bitstream\r
+ // Actually, we overwrite BitStream with the new decoded bitstream, we just need to be careful\r
+ // to stop output at the final bitidx2 value, not bitidx\r
+ for (i = 0; i < bitidx; i += 2) {\r
+ if ((BitStream[i] == 0) && (BitStream[i+1] == 1)) {\r
+ BitStream[bit2idx++] = 1 ^ invert;\r