Lines Matching refs:bitstream
55 static int32_t EncodeStereo (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * input, …
56 static int32_t EncodeStereoFast (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * inp…
57 static int32_t EncodeStereoEscape (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * i…
58 static int32_t EncodeMono (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * input, ui…
222 EncodeStereo (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * inputBuffer, uint32_t … in EncodeStereo() argument
225 …BitBuffer startBits = *bitstream ; // squirrel away copy of current state in case we need to go… in EncodeStereo()
404 BitBufferWrite (bitstream, 0, 12) ; in EncodeStereo()
405 BitBufferWrite (bitstream, (partialFrame << 3) | (bytesShifted << 1), 4) ; in EncodeStereo()
407 BitBufferWrite (bitstream, numSamples, 32) ; in EncodeStereo()
408 BitBufferWrite (bitstream, mixBits, 8) ; in EncodeStereo()
409 BitBufferWrite (bitstream, mixRes, 8) ; in EncodeStereo()
415 BitBufferWrite (bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8) ; in EncodeStereo()
416 BitBufferWrite (bitstream, (pbFactor << 5) | numU, 8) ; in EncodeStereo()
418 BitBufferWrite (bitstream, coefsU [numU - 1][indx], 16) ; in EncodeStereo()
420 BitBufferWrite (bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8) ; in EncodeStereo()
421 BitBufferWrite (bitstream, (pbFactor << 5) | numV, 8) ; in EncodeStereo()
423 BitBufferWrite (bitstream, coefsV [numV - 1][indx], 16) ; in EncodeStereo()
437 BitBufferWrite (bitstream, shiftedVal, bitShift * 2) ; in EncodeStereo()
455 status = dyn_comp (&agParams, p->mPredictorU, bitstream, numSamples, chanBits, &bits1) ; in EncodeStereo()
470 status = dyn_comp (&agParams, p->mPredictorV, bitstream, numSamples, chanBits, &bits2) ; in EncodeStereo()
476 minBits = BitBufferGetPosition (bitstream) - BitBufferGetPosition (&startBits) ; in EncodeStereo()
479 *bitstream = startBits ; // reset bitstream state in EncodeStereo()
488 status = EncodeStereoEscape (p, bitstream, inputBuffer, stride, numSamples) ; in EncodeStereo()
504 EncodeStereoFast (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * inputBuffer, uint3… in EncodeStereoFast() argument
506 …BitBuffer startBits = *bitstream ; // squirrel away current bit position in case we decide to u… in EncodeStereoFast()
583 BitBufferWrite (bitstream, 0, 12) ; in EncodeStereoFast()
584 BitBufferWrite (bitstream, (partialFrame << 3) | (bytesShifted << 1), 4) ; in EncodeStereoFast()
586 BitBufferWrite (bitstream, numSamples, 32) ; in EncodeStereoFast()
587 BitBufferWrite (bitstream, mixBits, 8) ; in EncodeStereoFast()
588 BitBufferWrite (bitstream, mixRes, 8) ; in EncodeStereoFast()
594 BitBufferWrite (bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8) ; in EncodeStereoFast()
595 BitBufferWrite (bitstream, (pbFactor << 5) | numU, 8) ; in EncodeStereoFast()
597 BitBufferWrite (bitstream, coefsU [numU - 1][indx], 16) ; in EncodeStereoFast()
599 BitBufferWrite (bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8) ; in EncodeStereoFast()
600 BitBufferWrite (bitstream, (pbFactor << 5) | numV, 8) ; in EncodeStereoFast()
602 BitBufferWrite (bitstream, coefsV [numV - 1][indx], 16) ; in EncodeStereoFast()
616 BitBufferWrite (bitstream, shiftedVal, bitShift * 2) ; in EncodeStereoFast()
625 status = dyn_comp (&agParams, p->mPredictorU, bitstream, numSamples, chanBits, &bits1) ; in EncodeStereoFast()
632 status = dyn_comp (&agParams, p->mPredictorV, bitstream, numSamples, chanBits, &bits2) ; in EncodeStereoFast()
653 minBits = BitBufferGetPosition (bitstream) - BitBufferGetPosition (&startBits) ; in EncodeStereoFast()
667 *bitstream = startBits ; in EncodeStereoFast()
670 status = EncodeStereoEscape (p, bitstream, inputBuffer, stride, numSamples) ; in EncodeStereoFast()
686 EncodeStereoEscape (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * inputBuffer, uin… in EncodeStereoEscape() argument
695 BitBufferWrite (bitstream, 0, 12) ; in EncodeStereoEscape()
696 BitBufferWrite (bitstream, (partialFrame << 3) | 1, 4) ; // LSB = 1 means "frame not compressed" in EncodeStereoEscape()
698 BitBufferWrite (bitstream, numSamples, 32) ; in EncodeStereoEscape()
706 BitBufferWrite (bitstream, inputBuffer [indx + 0] >> 16, 16) ; in EncodeStereoEscape()
707 BitBufferWrite (bitstream, inputBuffer [indx + 1] >> 16, 16) ; in EncodeStereoEscape()
713 BitBufferWrite (bitstream, inputBuffer [indx + 0] >> 12, 16) ; in EncodeStereoEscape()
714 BitBufferWrite (bitstream, inputBuffer [indx + 1] >> 12, 16) ; in EncodeStereoEscape()
722 BitBufferWrite (bitstream, p->mMixBufferU [indx] >> 8, 24) ; in EncodeStereoEscape()
723 BitBufferWrite (bitstream, p->mMixBufferV [indx] >> 8, 24) ; in EncodeStereoEscape()
729 BitBufferWrite (bitstream, inputBuffer [indx + 0], 32) ; in EncodeStereoEscape()
730 BitBufferWrite (bitstream, inputBuffer [indx + 1], 32) ; in EncodeStereoEscape()
743 EncodeMono (ALAC_ENCODER *p, struct BitBuffer * bitstream, const int32_t * inputBuffer, uint32_t st… in EncodeMono() argument
745 …BitBuffer startBits = *bitstream ; // squirrel away copy of current state in case we need to go… in EncodeMono()
869 BitBufferWrite (bitstream, 0, 12) ; in EncodeMono()
870 BitBufferWrite (bitstream, (partialFrame << 3) | (bytesShifted << 1), 4) ; in EncodeMono()
872 BitBufferWrite (bitstream, numSamples, 32) ; in EncodeMono()
873 BitBufferWrite (bitstream, 0, 16) ; // mixBits = mixRes = 0 in EncodeMono()
877 BitBufferWrite (bitstream, (0 << 4) | DENSHIFT_DEFAULT, 8) ; // modeU = 0 in EncodeMono()
878 BitBufferWrite (bitstream, (pbFactor << 5) | numU, 8) ; in EncodeMono()
880 BitBufferWrite (bitstream, coefsU [numU-1][indx], 16) ; in EncodeMono()
886 BitBufferWrite (bitstream, p->mShiftBufferUV [indx], shift) ; in EncodeMono()
894 status = dyn_comp (&agParams, p->mPredictorU, bitstream, numSamples, chanBits, &bits1) ; in EncodeMono()
901 minBits = BitBufferGetPosition (bitstream) - BitBufferGetPosition (&startBits) ; in EncodeMono()
904 *bitstream = startBits ; // reset bitstream state in EncodeMono()
913 BitBufferWrite (bitstream, 0, 12) ; in EncodeMono()
914 BitBufferWrite (bitstream, (partialFrame << 3) | 1, 4) ; // LSB = 1 means "frame not compressed" in EncodeMono()
916 BitBufferWrite (bitstream, numSamples, 32) ; in EncodeMono()
923 BitBufferWrite (bitstream, inputBuffer [indx] >> 16, 16) ; in EncodeMono()
928 BitBufferWrite (bitstream, inputBuffer [indx] >> 12, 20) ; in EncodeMono()
935 BitBufferWrite (bitstream, p->mMixBufferU [indx], 24) ; in EncodeMono()
940 BitBufferWrite (bitstream, inputBuffer [indx], 32) ; in EncodeMono()
965 BitBuffer bitstream ; in alac_encode() local
973 BitBufferInit (&bitstream, theWriteBuffer, p->mMaxOutputBytes) ; in alac_encode()
978 BitBufferWrite (&bitstream, ID_CPE, 3) ; in alac_encode()
979 BitBufferWrite (&bitstream, 0, 4) ; in alac_encode()
983 status = EncodeStereo (p, &bitstream, theReadBuffer, 2, 0, numSamples) ; in alac_encode()
985 status = EncodeStereoFast (p, &bitstream, theReadBuffer, 2, 0, numSamples) ; in alac_encode()
991 BitBufferWrite (&bitstream, ID_SCE, 3) ; in alac_encode()
992 BitBufferWrite (&bitstream, 0, 4) ; in alac_encode()
995 status = EncodeMono (p, &bitstream, theReadBuffer, 1, 0, numSamples) ; in alac_encode()
1017 BitBufferWrite (&bitstream, tag, 3) ; in alac_encode()
1022 BitBufferWrite (&bitstream, monoElementTag, 4) ; in alac_encode()
1024 status = EncodeMono (p, &bitstream, inputBuffer, numChannels, channelIndex, numSamples) ; in alac_encode()
1033 BitBufferWrite (&bitstream, stereoElementTag, 4) ; in alac_encode()
1035 status = EncodeStereo (p, &bitstream, inputBuffer, numChannels, channelIndex, numSamples) ; in alac_encode()
1044 BitBufferWrite (&bitstream, lfeElementTag, 4) ; in alac_encode()
1046 status = EncodeMono (p, &bitstream, inputBuffer, numChannels, channelIndex, numSamples) ; in alac_encode()
1069 bitsLeft = BitBufferGetPosition (&bitstream) - 3 ; // - 3 for ID_END tag in alac_encode()
1070 bytesLeft = bitstream.byteSize - ((bitsLeft + 7) / 8) ; in alac_encode()
1073 AddFiller (&bitstream, bytesLeft) ; in alac_encode()
1078 BitBufferWrite (&bitstream, ID_END, 3) ; in alac_encode()
1081 BitBufferByteAlign (&bitstream, true) ; in alac_encode()
1083 outputSize = BitBufferGetPosition (&bitstream) / 8 ; in alac_encode()