MCPcopy Create free account
hub / github.com/zhuker/lamejs / putbits_noheaders

Method putbits_noheaders

src/main/java/mp3/BitStream.java:133–157  ·  view source on GitHub ↗

write j bits into the bit stream, ignoring frame headers

(final LameInternalFlags gfc, final int val,
			int j)

Source from the content-addressed store, hash-verified

131 * write j bits into the bit stream, ignoring frame headers
132 */
133 private void putbits_noheaders(final LameInternalFlags gfc, final int val,
134 int j) {
135 assert (j < MAX_LENGTH - 2);
136
137 while (j > 0) {
138 int k;
139 if (bufBitIdx == 0) {
140 bufBitIdx = 8;
141 bufByteIdx++;
142 assert (bufByteIdx < Lame.LAME_MAXMP3BUFFER);
143 buf[bufByteIdx] = 0;
144 }
145
146 k = Math.min(j, bufBitIdx);
147 j -= k;
148
149 bufBitIdx -= k;
150
151 assert (j < MAX_LENGTH); /* 32 too large on 32 bit machines */
152 assert (bufBitIdx < MAX_LENGTH);
153
154 buf[bufByteIdx] |= ((val >> j) << bufBitIdx);
155 totbit += k;
156 }
157 }
158
159 /**
160 * Some combinations of bitrate, Fs, and stereo make it impossible to stuff

Callers 1

add_dummy_byteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected