Home | History | Annotate | Download | only in libFLAC

Lines Matching refs:buffer

74  * The default capacity here doesn't matter too much.  The buffer always grows
76 * a frame or metadata block, then write that out and clear the buffer for the
103 bwword *buffer;
104 bwword accum; /* accumulator; bits are right-justified; when full, accum is appended to buffer */
105 unsigned capacity; /* capacity of buffer in words */
106 unsigned words; /* # of complete words in buffer */
119 /* * WATCHOUT: The current implementation only grows the buffer. */
126 FLAC__ASSERT(0 != bw->buffer);
145 new_buffer = (bwword*)safe_realloc_mul_2op_(bw->buffer, sizeof(bwword), /*times*/new_capacity);
148 bw->buffer = new_buffer;
187 bw->buffer = (bwword*)malloc(sizeof(bwword) * bw->capacity);
188 if(bw->buffer == 0)
198 if(0 != bw->buffer)
199 free(bw->buffer);
200 bw->buffer = 0;
222 fprintf(out, "%01u", bw->buffer[i] & (1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
236 const FLAC__byte *buffer;
241 if(!FLAC__bitwriter_get_buffer(bw, &buffer, &bytes))
244 *crc = (FLAC__uint16)FLAC__crc16(buffer, bytes);
251 const FLAC__byte *buffer;
256 if(!FLAC__bitwriter_get_buffer(bw, &buffer, &bytes))
259 *crc = FLAC__crc8(buffer, bytes);
274 FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **buffer, size_t *bytes)
280 /* if we have bits in the accumulator we have to flush those to the buffer first */
285 /* append bits as complete word to buffer, but don't change bw->accum or bw->bits */
286 bw->buffer[bw->words] = SWAP_BE_WORD_TO_HOST(bw->accum << (FLAC__BITS_PER_WORD-bw->bits));
289 *buffer = (FLAC__byte*)bw->buffer;
307 FLAC__ASSERT(0 != bw->buffer);
321 bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
329 bw->buffer[bw->words++] = 0;
348 FLAC__ASSERT(0 != bw->buffer);
367 bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
373 bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(val);
521 FLAC__ASSERT(0 != bw->buffer);
551 FLAC__ASSERT(0 != bw->buffer);
564 /* ^^^ if bw->bits is 0 then we may have filled the buffer and have no free bwword to work in */
573 bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
575 /* burying the capacity check down here means we have to grow the buffer a little if there are more vals to do */
585 /* ^^^ if bw->bits is 0 then we may have filled the buffer and have no free bwword to work in */
611 bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
617 bw->buffer[bw->words++] = 0;
645 bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
664 FLAC__ASSERT(0 != bw->buffer);
728 FLAC__ASSERT(0 != bw->buffer);
786 FLAC__ASSERT(0 != bw->buffer);
832 FLAC__ASSERT(0 != bw->buffer);