Lines Matching refs:stream

8     this.probe = function(stream) {  argument
9 var offset = stream.offset;
12 while (stream.available(2)) {
13 if ((stream.readUInt16() & 0xfff6) === 0xfff0) {
14 stream.seek(offset);
19 stream.seek(offset);
24 this.bitstream = new AV.Bitstream(this.stream);
29 this.readHeader = function(stream) { argument
30 if (stream.read(12) !== 0xfff)
34 stream.advance(3); // mpeg version and layer
35 var protectionAbsent = !!stream.read(1);
37 ret.profile = stream.read(2) + 1;
38 ret.samplingIndex = stream.read(4);
40 stream.advance(1); // private
41 ret.chanConfig = stream.read(3);
42 stream.advance(4); // original/copy, home, copywrite, and copywrite start
44 ret.frameLength = stream.read(13);
45 stream.advance(11); // fullness
47 ret.numFrames = stream.read(2) + 1;
50 stream.advance(16);
57 var offset = this.stream.offset;
73 this.stream.seek(offset);
77 while (this.stream.available(1)) {
78 var buffer = this.stream.readSingleBuffer(this.stream.remainingBytes());
128 decode: function(stream, config) { argument
133 this.couplingPoint = 2 * stream.read(1);
134 this.coupledCount = stream.read(3);
139 channelPair[i] = stream.read(1);
140 idSelect[i] = stream.read(4);
143 chSelect[i] = stream.read(2);
152 this.couplingPoint += stream.read(1);
155 var sign = stream.read(1),
156 scale = CCE_SCALE[stream.read(2)];
158 this.ics.decode(stream, config, false);
171 cge = this.couplingPoint === CCEElement.AFTER_IMDCT ? 1 : stream.read(1);
172 gain = cge ? Huffman.decodeScaleFactor(stream) - 60 : 0;
185 var t = Huffman.decodeScaleFactor(stream) - 60;
283 CPEElement.prototype.decode = function(stream, config) { argument
288 if (this.commonWindow = !!stream.read(1)) {
289 left.info.decode(stream, config, true);
292 var mask = stream.read(2);
299 ms_used[i] = !!stream.read(1);
319 left.decode(stream, config, this.commonWindow);
320 right.decode(stream, config, this.commonWindow);
380 stream = new AV.Bitstream(data);
384 this.config.profile = stream.read(5);
386 this.config.profile = 32 + stream.read(6);
388 this.config.sampleIndex = stream.read(4);
390 this.config.sampleRate = stream.read(24);
401 this.config.chanConfig = stream.read(4);
408 if (stream.read(1)) // frameLengthFlag
413 if (stream.read(1)) // dependsOnCoreCoder
414 stream.advance(14); // coreCoderDelay
416 if (stream.read(1)) { // extensionFlag
418 this.config.sectionDataResilience = stream.read(1);
419 this.config.scalefactorResilience = stream.read(1);
420 this.config.spectralDataResilience = stream.read(1);
423 stream.advance(1);
427 stream.advance(4) // element_instance_tag
454 var stream = this.bitstream;
457 if (stream.peek(12) === 0xfff)
458 ADTSDemuxer.readHeader(stream);
466 while ((elementType = stream.read(3)) !== END_ELEMENT) {
467 var id = stream.read(4);
476 ics.decode(stream, config, false);
484 cpe.decode(stream, config);
491 cce.decode(stream, config);
496 var align = stream.read(1),
497 count = stream.read(8);
500 count += stream.read(8);
503 stream.align();
506 stream.advance(count * 8);
517 id += stream.read(8) - 1;
520 stream.advance(id * 8);
528 stream.align();
2597 findOffset: function(stream, table) { argument
2600 cw = stream.read(len);
2606 cw |= stream.read(j);
2612 signValues: function(stream, data, off, len) { argument
2614 if (data[i] && stream.read(1))
2619 getEscape: function(stream, s) { argument
2621 while (stream.read(1))
2624 var j = stream.read(i) | (1 << i);
2628 decodeScaleFactor: function(stream) { argument
2629 var offset = this.findOffset(stream, HCB_SF);
2633 decodeSpectralData: function(stream, cb, data, off) { argument
2635 offset = this.findOffset(stream, HCB);
2648 this.signValues(stream, data, off, cb < 5 ? QUAD_LEN : PAIR_LEN);
2651 this.signValues(stream, data, off, cb < 5 ? QUAD_LEN : PAIR_LEN);
2654 data[off] = this.getEscape(stream, data[off]);
2657 data[off + 1] = this.getEscape(stream, data[off + 1]);
2722 decode: function(stream, config, commonWindow) { argument
2723 this.globalGain = stream.read(8);
2726 this.info.decode(stream, config, commonWindow);
2728 this.decodeBandTypes(stream, config);
2729 this.decodeScaleFactors(stream);
2731 if (this.pulsePresent = stream.read(1)) {
2735 this.decodePulseData(stream);
2738 if (this.tnsPresent = stream.read(1)) {
2739 this.tns.decode(stream, this.info);
2742 if (this.gainPresent = stream.read(1)) {
2746 this.decodeSpectralData(stream);
2749 decodeBandTypes: function(stream, config) { argument
2762 bandType = stream.read(4);
2768 while ((incr = stream.read(bits)) === escape)
2784 decodeScaleFactors: function(stream) { argument
2808 offset[2] += Huffman.decodeScaleFactor(stream) - SF_DELTA;
2817 offset[1] += stream.read(9) - 256;
2820 offset[1] += Huffman.decodeScaleFactor(stream) - SF_DELTA;
2829 offset[0] += Huffman.decodeScaleFactor(stream) - SF_DELTA;
2841 decodePulseData: function(stream) { argument
2842 var pulseCount = stream.read(2) + 1,
2843 pulseSWB = stream.read(6);
2854 this.pulseOffset[0] = this.info.swbOffsets[pulseSWB] + stream.read(5);
2855 this.pulseAmp[0] = stream.read(4);
2861 this.pulseOffset[i] = stream.read(5) + this.pulseOffset[i - 1];
2865 this.pulseAmp[i] = stream.read(4);
2869 decodeSpectralData: function(stream) { argument
2914 Huffman.decodeSpectralData(stream, hcb, buf, 0);
2945 decode: function(stream, config, commonWindow) { argument
2946 stream.advance(1); // reserved
2948 this.windowSequence = stream.read(2);
2950 this.windowShape[1] = stream.read(1);
2956 this.maxSFB = stream.read(4);
2958 if (stream.read(1)) {
2971 this.maxSFB = stream.read(6);
2975 this.predictorPresent = !!stream.read(1);
2978 this.decodePrediction(stream, config, commonWindow);
2982 decodePrediction: function(stream, config, commonWindow) { argument
4535 TNS.prototype.decode = function(stream, info) { argument
4540 if (this.nFilt[w] = stream.read(bits[0])) {
4541 var coefRes = stream.read(1),
4549 length_w[filt] = stream.read(bits[1]);
4551 if ((order_w[filt] = stream.read(bits[2])) > 20)
4555 direction_w[filt] = !!stream.read(1);
4556 var coefCompress = stream.read(1),
4564 coef_w_filt[i] = table[stream.read(coefLen)];