Lines Matching refs:bits
51 static int32_t alac_fill_element (struct BitBuffer * bits) ;
52 static int32_t alac_data_stream_element (struct BitBuffer * bits) ;
137 alac_decode (ALAC_DECODER *p, struct BitBuffer * bits, int32_t * sampleBuffer, uint32_t numSamples, uint32_t * outNumSamples)
168 RequireAction ((bits != NULL) && (sampleBuffer != NULL) && (outNumSamples != NULL), return kALAC_ParamError ;) ;
180 RequireAction (bits->cur < bits->end, status = kALAC_ParamError ; goto Exit ;) ;
186 tag = BitBufferReadSmall (bits, 3) ;
193 elementInstanceTag = BitBufferReadSmall (bits, 4) ;
196 // read the 12 unused header bits
197 unusedHeader = (uint16_t) BitBufferRead (bits, 12) ;
201 headerByte = (uint8_t) BitBufferRead (bits, 4) ;
217 numSamples = BitBufferRead (bits, 16) << 16 ;
218 numSamples |= BitBufferRead (bits, 16) ;
226 mixBits = (uint8_t) BitBufferRead (bits, 8) ;
227 mixRes = (int8_t) BitBufferRead (bits, 8) ;
230 headerByte = (uint8_t) BitBufferRead (bits, 8) ;
234 headerByte = (uint8_t) BitBufferRead (bits, 8) ;
239 coefsU [i] = (int16_t) BitBufferRead (bits, 16) ;
244 shiftBits = *bits ;
245 BitBufferAdvance (bits, (bytesShifted * 8) * numSamples) ;
250 status = dyn_decomp (&agParams, bits, p->u.mPredictor, numSamples, chanBits, &bits1) ;
274 val = (int32_t) BitBufferRead (bits, (uint8_t) chanBits) ;
281 // BitBufferRead () can't read more than 16 bits at a time so break up the reads
285 val = (int32_t) BitBufferRead (bits, 16) ;
287 p->mMixBufferU [i] = val | BitBufferRead (bits, (uint8_t) extraBits) ;
346 elementInstanceTag = BitBufferReadSmall (bits, 4) ;
349 // read the 12 unused header bits
350 unusedHeader = (uint16_t) BitBufferRead (bits, 12) ;
354 headerByte = (uint8_t) BitBufferRead (bits, 4) ;
370 numSamples = BitBufferRead (bits, 16) << 16 ;
371 numSamples |= BitBufferRead (bits, 16) ;
379 mixBits = (uint8_t) BitBufferRead (bits, 8) ;
380 mixRes = (int8_t) BitBufferRead (bits, 8) ;
382 headerByte = (uint8_t) BitBufferRead (bits, 8) ;
386 headerByte = (uint8_t) BitBufferRead (bits, 8) ;
390 coefsU [i] = (int16_t) BitBufferRead (bits, 16) ;
392 headerByte = (uint8_t) BitBufferRead (bits, 8) ;
396 headerByte = (uint8_t) BitBufferRead (bits, 8) ;
400 coefsV [i] = (int16_t) BitBufferRead (bits, 16) ;
405 shiftBits = *bits ;
406 BitBufferAdvance (bits, (bytesShifted * 8) * 2 * numSamples) ;
411 status = dyn_decomp (&agParams, bits, p->u.mPredictor, numSamples, chanBits, &bits1) ;
427 status = dyn_decomp (&agParams, bits, p->u.mPredictor, numSamples, chanBits, &bits2) ;
452 val = (int32_t) BitBufferRead (bits, (uint8_t) chanBits) ;
456 val = (int32_t) BitBufferRead (bits, (uint8_t) chanBits) ;
463 // BitBufferRead () can't read more than 16 bits at a time so break up the reads
467 val = (int32_t) BitBufferRead (bits, 16) ;
469 p->mMixBufferU [i] = val | BitBufferRead (bits, (uint8_t) extraBits) ;
471 val = (int32_t) BitBufferRead (bits, 16) ;
473 p->mMixBufferV [i] = val | BitBufferRead (bits, (uint8_t) extraBits) ;
537 status = alac_data_stream_element (bits) ;
544 status = alac_fill_element (bits) ;
551 BitBufferByteAlign (bits, false) ;
552 //Assert (bits->cur == bits->end) ;
558 // if we've decoded all of our channels, bail (but not in debug b/c we want to know if we're seeing bad bits)
559 // - this also protects us if the config does not match the bitstream or crap data bits follow the audio bits
587 alac_fill_element (struct BitBuffer * bits)
593 count = BitBufferReadSmall (bits, 4) ;
595 count += (int16_t) BitBufferReadSmall (bits, 8) - 1 ;
597 BitBufferAdvance (bits, count * 8) ;
599 RequireAction (bits->cur <= bits->end, return kALAC_ParamError ;) ;
609 alac_data_stream_element (struct BitBuffer * bits)
616 /* element_instance_tag = */ BitBufferReadSmall (bits, 4) ;
618 data_byte_align_flag = BitBufferReadOne (bits) ;
621 count = BitBufferReadSmall (bits, 8) ;
623 count += BitBufferReadSmall (bits, 8) ;
627 BitBufferByteAlign (bits, false) ;
630 BitBufferAdvance (bits, count * 8) ;
632 RequireAction (bits->cur <= bits->end, return kALAC_ParamError ;) ;