Lines Matching defs:samples
104 unsigned size; /* of each data[] in samples */
153 static FLAC__bool write_bitbuffer_(FLAC__StreamEncoder *encoder, unsigned samples, FLAC__bool is_last_block);
154 static FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, FLAC__bool is_last_block);
295 static unsigned get_wasted_bits_(FLAC__int32 signal[], unsigned samples);
322 static FLAC__StreamEncoderWriteStatus file_write_callback_(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data);
333 unsigned input_capacity; /* current size (in samples) of the signal and residual buffers */
504 /* Number of samples that will be overread to watch for end of stream. By
506 * always try to read blocksize+1 samples before encoding a block, so that
1979 FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples)
1990 const unsigned n = min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j);
2001 for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) {
2017 /* move unprocessed overread samples to beginnings of arrays */
2026 } while(j < samples);
2031 FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples)
2053 append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j));
2056 for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) {
2071 /* move unprocessed overread samples to beginnings of arrays */
2080 } while(j < samples);
2088 append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j));
2091 for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) {
2100 /* move unprocessed overread samples to beginnings of arrays */
2107 } while(j < samples);
2388 FLAC__bool write_bitbuffer_(FLAC__StreamEncoder *encoder, unsigned samples, FLAC__bool is_last_block)
2417 if(write_frame_(encoder, buffer, bytes, samples, is_last_block) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) {
2427 if(samples > 0) {
2435 FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, FLAC__bool is_last_block)
2449 if(samples == 0) {
2497 samples,
2507 status = encoder->private_->write_callback(encoder, buffer, bytes, samples, encoder->private_->current_frame_number, encoder->private_->client_data);
2511 encoder->private_->samples_written += samples;
2529 const FLAC__uint64 samples = metadata->data.stream_info.total_samples;
2571 * Write total samples
2587 b[0] = ((FLAC__byte)(bps-1) << 4) | (FLAC__byte)((samples >> 32) & 0x0F);
2588 b[1] = (FLAC__byte)((samples >> 24) & 0xFF);
2589 b[2] = (FLAC__byte)((samples >> 16) & 0xFF);
2590 b[3] = (FLAC__byte)((samples >> 8) & 0xFF);
2591 b[4] = (FLAC__byte)(samples & 0xFF);
2694 const FLAC__uint64 samples = metadata->data.stream_info.total_samples;
2749 * Write total samples
2772 b[0] |= (FLAC__byte)((samples >> 32) & 0x0F);
2773 b[1] = (FLAC__byte)((samples >> 24) & 0xFF);
2774 b[2] = (FLAC__byte)((samples >> 16) & 0xFF);
2775 b[3] = (FLAC__byte)((samples >> 8) & 0xFF);
2776 b[4] = (FLAC__byte)(samples & 0xFF);
3227 /* the above means it's possible all samples are the same value; now double-check it: */
4117 unsigned get_wasted_bits_(FLAC__int32 signal[], unsigned samples)
4122 for(i = 0; i < samples && !(x&1); i++)
4134 for(i = 0; i < samples; i++)
4309 FLAC__StreamEncoderWriteStatus file_write_callback_(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data)
4316 /* We would like to be able to use 'samples > 0' in the
4318 * Ogg writing implementation, 'samples' is always 0 (see
4324 samples > 0
4327 /* NOTE: We have to add +bytes, +samples, and +1 to the stats
4332 encoder->private_->progress_callback(encoder, encoder->private_->bytes_written+bytes, encoder->private_->samples_written+samples, encoder->private_->frames_written+(samples?1:0), encoder->private_->total_frames_estimate, encoder->private_->client_data);