Commit 3a7b2c9b authored by Josh Coalson's avatar Josh Coalson
Browse files

add ..._get_total_samples_estimate()

parent 9b4a014e
......@@ -547,7 +547,7 @@ FLAC__bool FLAC__seekable_stream_encoder_get_loose_mid_side_stereo(const FLAC__S
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_channels().
*/
unsigned FLAC__seekable_stream_encoder_get_channels(const FLAC__SeekableStreamEncoder *encoder);
......@@ -559,7 +559,7 @@ unsigned FLAC__seekable_stream_encoder_get_channels(const FLAC__SeekableStreamEn
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_bits_per_sample().
*/
unsigned FLAC__seekable_stream_encoder_get_bits_per_sample(const FLAC__SeekableStreamEncoder *encoder);
......@@ -571,7 +571,7 @@ unsigned FLAC__seekable_stream_encoder_get_bits_per_sample(const FLAC__SeekableS
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_sample_rate().
*/
unsigned FLAC__seekable_stream_encoder_get_sample_rate(const FLAC__SeekableStreamEncoder *encoder);
......@@ -583,7 +583,7 @@ unsigned FLAC__seekable_stream_encoder_get_sample_rate(const FLAC__SeekableStrea
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_blocksize().
*/
unsigned FLAC__seekable_stream_encoder_get_blocksize(const FLAC__SeekableStreamEncoder *encoder);
......@@ -595,7 +595,7 @@ unsigned FLAC__seekable_stream_encoder_get_blocksize(const FLAC__SeekableStreamE
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_max_lpc_order().
*/
unsigned FLAC__seekable_stream_encoder_get_max_lpc_order(const FLAC__SeekableStreamEncoder *encoder);
......@@ -607,7 +607,7 @@ unsigned FLAC__seekable_stream_encoder_get_max_lpc_order(const FLAC__SeekableStr
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_qlp_coeff_precision().
*/
unsigned FLAC__seekable_stream_encoder_get_qlp_coeff_precision(const FLAC__SeekableStreamEncoder *encoder);
......@@ -655,7 +655,7 @@ FLAC__bool FLAC__seekable_stream_encoder_get_do_exhaustive_model_search(const FL
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_min_residual_partition_order().
*/
unsigned FLAC__seekable_stream_encoder_get_min_residual_partition_order(const FLAC__SeekableStreamEncoder *encoder);
......@@ -667,7 +667,7 @@ unsigned FLAC__seekable_stream_encoder_get_min_residual_partition_order(const FL
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_max_residual_partition_order().
*/
unsigned FLAC__seekable_stream_encoder_get_max_residual_partition_order(const FLAC__SeekableStreamEncoder *encoder);
......@@ -679,11 +679,23 @@ unsigned FLAC__seekable_stream_encoder_get_max_residual_partition_order(const FL
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__seekable_stream_encoder_set_rice_parameter_search_dist().
*/
unsigned FLAC__seekable_stream_encoder_get_rice_parameter_search_dist(const FLAC__SeekableStreamEncoder *encoder);
/** Get the previously set estimate of the total samples to be encoded.
* This is inherited from FLAC__StreamEncoder; see
* FLAC__stream_encoder_get_total_samples_estimate().
*
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__uint64
* See FLAC__seekable_stream_encoder_set_total_samples_estimate().
*/
FLAC__uint64 FLAC__seekable_stream_encoder_get_total_samples_estimate(const FLAC__SeekableStreamEncoder *encoder);
/** Initialize the encoder instance.
* Should be called after FLAC__seekable_stream_encoder_new() and
* FLAC__seekable_stream_encoder_set_*() but before FLAC__seekable_stream_encoder_process()
......
......@@ -687,7 +687,7 @@ FLAC__bool FLAC__stream_encoder_get_loose_mid_side_stereo(const FLAC__StreamEnco
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_channels().
*/
unsigned FLAC__stream_encoder_get_channels(const FLAC__StreamEncoder *encoder);
......@@ -697,7 +697,7 @@ unsigned FLAC__stream_encoder_get_channels(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_bits_per_sample().
*/
unsigned FLAC__stream_encoder_get_bits_per_sample(const FLAC__StreamEncoder *encoder);
......@@ -707,7 +707,7 @@ unsigned FLAC__stream_encoder_get_bits_per_sample(const FLAC__StreamEncoder *enc
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_sample_rate().
*/
unsigned FLAC__stream_encoder_get_sample_rate(const FLAC__StreamEncoder *encoder);
......@@ -717,7 +717,7 @@ unsigned FLAC__stream_encoder_get_sample_rate(const FLAC__StreamEncoder *encoder
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_blocksize().
*/
unsigned FLAC__stream_encoder_get_blocksize(const FLAC__StreamEncoder *encoder);
......@@ -727,7 +727,7 @@ unsigned FLAC__stream_encoder_get_blocksize(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_max_lpc_order().
*/
unsigned FLAC__stream_encoder_get_max_lpc_order(const FLAC__StreamEncoder *encoder);
......@@ -737,7 +737,7 @@ unsigned FLAC__stream_encoder_get_max_lpc_order(const FLAC__StreamEncoder *encod
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_qlp_coeff_precision().
*/
unsigned FLAC__stream_encoder_get_qlp_coeff_precision(const FLAC__StreamEncoder *encoder);
......@@ -777,7 +777,7 @@ FLAC__bool FLAC__stream_encoder_get_do_exhaustive_model_search(const FLAC__Strea
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_min_residual_partition_order().
*/
unsigned FLAC__stream_encoder_get_min_residual_partition_order(const FLAC__StreamEncoder *encoder);
......@@ -787,7 +787,7 @@ unsigned FLAC__stream_encoder_get_min_residual_partition_order(const FLAC__Strea
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_max_residual_partition_order().
*/
unsigned FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__StreamEncoder *encoder);
......@@ -797,11 +797,24 @@ unsigned FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__Strea
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__bool
* \retval unsigned
* See FLAC__stream_encoder_set_rice_parameter_search_dist().
*/
unsigned FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC__StreamEncoder *encoder);
/** Get the previously set estimate of the total samples to be encoded.
* The encoder merely mimics back the value given to
* FLAC__stream_encoder_set_total_samples_estimate() since it has no
* other way of knowing how many samples the user will encode.
*
* \param encoder An encoder instance to set.
* \assert
* \code encoder != NULL \endcode
* \retval FLAC__uint64
* See FLAC__stream_encoder_get_total_samples_estimate().
*/
FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder);
/** Initialize the encoder instance.
* Should be called after FLAC__stream_encoder_new() and
* FLAC__stream_encoder_set_*() but before FLAC__stream_encoder_process()
......
......@@ -244,6 +244,12 @@ namespace FLAC {
return ::FLAC__seekable_stream_encoder_get_rice_parameter_search_dist(encoder_);
}
FLAC__uint64 SeekableStream::get_total_samples_estimate() const
{
FLAC__ASSERT(is_valid());
return ::FLAC__seekable_stream_encoder_get_total_samples_estimate(encoder_);
}
SeekableStream::State SeekableStream::init()
{
FLAC__ASSERT(is_valid());
......
......@@ -238,6 +238,12 @@ namespace FLAC {
return ::FLAC__stream_encoder_get_rice_parameter_search_dist(encoder_);
}
FLAC__uint64 Stream::get_total_samples_estimate() const
{
FLAC__ASSERT(is_valid());
return ::FLAC__stream_encoder_get_total_samples_estimate(encoder_);
}
Stream::State Stream::init()
{
FLAC__ASSERT(is_valid());
......
......@@ -552,6 +552,13 @@ unsigned FLAC__seekable_stream_encoder_get_rice_parameter_search_dist(const FLAC
return FLAC__stream_encoder_get_rice_parameter_search_dist(encoder->private_->stream_encoder);
}
FLAC__uint64 FLAC__seekable_stream_encoder_get_total_samples_estimate(const FLAC__SeekableStreamEncoder *encoder)
{
FLAC__ASSERT(0 != encoder);
FLAC__ASSERT(0 != encoder->private_);
return FLAC__stream_encoder_get_total_samples_estimate(encoder->private_->stream_encoder);
}
FLAC__bool FLAC__seekable_stream_encoder_process(FLAC__SeekableStreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples)
{
FLAC__ASSERT(0 != encoder);
......
......@@ -791,6 +791,12 @@ unsigned FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC__StreamE
return encoder->protected_->rice_parameter_search_dist;
}
FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder)
{
FLAC__ASSERT(0 != encoder);
return encoder->protected_->total_samples_estimate;
}
FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples)
{
unsigned i, j, channel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment