mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
add support for specifying which apodization functions to use to window data before lpc analysis
This commit is contained in:
@@ -314,6 +314,21 @@ FLAC_API FLAC__bool FLAC__file_encoder_set_sample_rate(FLAC__FileEncoder *encode
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__file_encoder_set_blocksize(FLAC__FileEncoder *encoder, unsigned value);
|
||||
|
||||
/** This is inherited from FLAC__SeekableStreamEncoder; see
|
||||
* FLAC__seekable_stream_encoder_set_apodization().
|
||||
*
|
||||
* \default \c 0
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param specification See above.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \code specification != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the encoder is already initialized, else \c true.
|
||||
*/
|
||||
/* @@@@add to unit tests*/
|
||||
FLAC_API FLAC__bool FLAC__file_encoder_set_apodization(FLAC__FileEncoder *encoder, const char *specification);
|
||||
|
||||
/** This is inherited from FLAC__SeekableStreamEncoder; see
|
||||
* FLAC__seekable_stream_encoder_set_max_lpc_order().
|
||||
*
|
||||
|
||||
@@ -315,6 +315,10 @@ typedef struct {
|
||||
|
||||
const FLAC__int32 *residual;
|
||||
/**< The residual signal, length == (blocksize minus order) samples. */
|
||||
|
||||
#ifdef WINDOW_DEBUG_OUTPUT
|
||||
char window_type[64]; //@@@@@@
|
||||
#endif
|
||||
} FLAC__Subframe_LPC;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**< == 4 (bits) */
|
||||
|
||||
@@ -416,6 +416,21 @@ FLAC_API FLAC__bool FLAC__seekable_stream_encoder_set_sample_rate(FLAC__Seekable
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__seekable_stream_encoder_set_blocksize(FLAC__SeekableStreamEncoder *encoder, unsigned value);
|
||||
|
||||
/** This is inherited from FLAC__StreamEncoder; see
|
||||
* FLAC__stream_encoder_set_apodization().
|
||||
*
|
||||
* \default \c 0
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param specification See above.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \code specification != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the encoder is already initialized, else \c true.
|
||||
*/
|
||||
/* @@@@add to unit tests*/
|
||||
FLAC_API FLAC__bool FLAC__seekable_stream_encoder_set_apodization(FLAC__SeekableStreamEncoder *encoder, const char *specification);
|
||||
|
||||
/** This is inherited from FLAC__StreamEncoder; see
|
||||
* FLAC__stream_encoder_set_max_lpc_order().
|
||||
*
|
||||
|
||||
@@ -498,6 +498,52 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *en
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value);
|
||||
|
||||
/** Sets the apodization function(s) the encoder will use when windowing
|
||||
* audio data for LPC analysis.
|
||||
*
|
||||
* The \a specification is a plain ASCII string which specifies exactly
|
||||
* which functions to use. There may be more than one (up to 32),
|
||||
* separated by \c ';' characters. Some functions take one or more
|
||||
* comma-separated arguments in parentheses.
|
||||
*
|
||||
* The available functions are \c bartlett, \c bartlett_hann,
|
||||
* \c blackman, \c blackman_harris_4term_92db, \c connes, \c flattop,
|
||||
* \c gauss(STDDEV), \c hamming, \c hann, \c kaiser_bessel, \c nuttall,
|
||||
* \c rectangle, \c triangle, \c tukey(P), \c welch.
|
||||
*
|
||||
* For \c gauss(STDDEV), STDDEV specifies the standard deviation
|
||||
* (0<STDDEV<=0.5).
|
||||
*
|
||||
* For \c tukey(P), P specifies the fraction of the window that is
|
||||
* tapered (0<=P<=1). P=0 corresponds to \c rectangle and P=1
|
||||
* corresponds to \c hann.
|
||||
*
|
||||
* Example specifications are \c "blackman" or
|
||||
* \c "hann;triangle;tukey(0.5);tukey(0.25);tukey(0.125)"
|
||||
*
|
||||
* Any function that is specified erroneously is silently dropped. Up
|
||||
* to 32 functions are kept, the rest are dropped. If the specification
|
||||
* is empty the encoder defaults to \c "hann".
|
||||
*
|
||||
* When more than one function is specified, then for every subframe the
|
||||
* encoder will try each of them separately and choose the window that
|
||||
* results in the smallest compressed subframe.
|
||||
*
|
||||
* Note that each function specified causes the encoder to occupy a
|
||||
* floating point array in which to store the window.
|
||||
*
|
||||
* \default \c "hann"
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param specification See above.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \code specification != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the encoder is already initialized, else \c true.
|
||||
*/
|
||||
/* @@@@add to unit tests*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_set_apodization(FLAC__StreamEncoder *encoder, const char *specification);
|
||||
|
||||
/** Set the maximum LPC order, or \c 0 to use only the fixed predictors.
|
||||
*
|
||||
* \default \c 0
|
||||
|
||||
@@ -298,6 +298,20 @@ OggFLAC_API FLAC__bool OggFLAC__file_encoder_set_sample_rate(OggFLAC__FileEncode
|
||||
*/
|
||||
OggFLAC_API FLAC__bool OggFLAC__file_encoder_set_blocksize(OggFLAC__FileEncoder *encoder, unsigned value);
|
||||
|
||||
/** This is inherited from OggFLAC__SeekableStreamEncoder; see
|
||||
* OggFLAC__seekable_stream_encoder_set_apodization().
|
||||
*
|
||||
* \default \c 0
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param specification See above.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \code specification != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the encoder is already initialized, else \c true.
|
||||
*/
|
||||
OggFLAC_API FLAC__bool OggFLAC__file_encoder_set_apodization(OggFLAC__FileEncoder *encoder, const char *specification);
|
||||
|
||||
/** This is inherited from OggFLAC__SeekableStreamEncoder; see
|
||||
* OggFLAC__seekable_stream_encoder_set_max_lpc_order().
|
||||
*
|
||||
|
||||
@@ -376,6 +376,19 @@ OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_sample_rate(OggFLAC_
|
||||
*/
|
||||
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_blocksize(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
|
||||
|
||||
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_apodization()
|
||||
*
|
||||
* \default \c 0
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param specification See above.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \code specification != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the encoder is already initialized, else \c true.
|
||||
*/
|
||||
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_apodization(OggFLAC__SeekableStreamEncoder *encoder, const char *specification);
|
||||
|
||||
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_max_lpc_order()
|
||||
*
|
||||
* \default \c 0
|
||||
|
||||
@@ -312,6 +312,19 @@ OggFLAC_API FLAC__bool OggFLAC__stream_encoder_set_sample_rate(OggFLAC__StreamEn
|
||||
*/
|
||||
OggFLAC_API FLAC__bool OggFLAC__stream_encoder_set_blocksize(OggFLAC__StreamEncoder *encoder, unsigned value);
|
||||
|
||||
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_apodization()
|
||||
*
|
||||
* \default \c 0
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param specification See above.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \code specification != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the encoder is already initialized, else \c true.
|
||||
*/
|
||||
OggFLAC_API FLAC__bool OggFLAC__stream_encoder_set_apodization(OggFLAC__StreamEncoder *encoder, const char *specification);
|
||||
|
||||
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_max_lpc_order()
|
||||
*
|
||||
* \default \c 0
|
||||
|
||||
Reference in New Issue
Block a user