MCPcopy
hub / github.com/babysor/MockingBird / writeheader

Function writeheader

web/static/js/mp3-engine.js:2585–2597  ·  view source on GitHub ↗

* write N bits into the header

(gfc, val, j)

Source from the content-addressed store, hash-verified

2583 * write N bits into the header
2584 */
2585 function writeheader(gfc, val, j) {
2586 var ptr = gfc.header[gfc.h_ptr].ptr;
2587
2588 while (j > 0) {
2589 var k = Math.min(j, 8 - (ptr & 7));
2590 j -= k;
2591 /* >> 32 too large for 32 bit machines */
2592
2593 gfc.header[gfc.h_ptr].buf[ptr >> 3] |= ((val >> j)) << (8 - (ptr & 7) - k);
2594 ptr += k;
2595 }
2596 gfc.header[gfc.h_ptr].ptr = ptr;
2597 }
2598
2599 function CRC_update(value, crc) {
2600 value <<= 8;

Callers 1

encodeSideInfo2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected