upipe-ebur128/ebur128.h header reference

Members  

Types  

Functions  

Macro  

Members detail  

struct <anonymous>  

This struct is declared in upipe-ebur128/ebur128.h source file, line 74.

\brief Contains information about the state of a loudness measurement.

You should not need to modify this struct directly.

FieldDescription
int mode;
unsigned int channels;< The current mode.
unsigned long samplerate;< The number of channels.
struct ebur128_state_internal *d;< The sample rate.

See also ebur128_state typedef.

#define EBUR128_H_  

This macro is declared in upipe-ebur128/ebur128.h source file, line 3.

#define EBUR128_VERSION_MAJOR  

This macro is declared in upipe-ebur128/ebur128.h source file, line 14.

\file ebur128.h \brief libebur128 - a library for loudness measurement according to the EBU R128 standard.

#define EBUR128_VERSION_MINOR  

This macro is declared in upipe-ebur128/ebur128.h source file, line 15.

#define EBUR128_VERSION_PATCH  

This macro is declared in upipe-ebur128/ebur128.h source file, line 16.

enum channel  

This enum is declared in upipe-ebur128/ebur128.h source file, line 24.

\enum channel Use these values when setting the channel map with ebur128_set_channel().

IdentifierValueDescription
EBUR128_UNUSED0
EBUR128_LEFT1< unused channel (for example LFE channel)
EBUR128_RIGHT2< left channel
EBUR128_CENTER3< right channel
EBUR128_LEFT_SURROUND4< center channel
EBUR128_RIGHT_SURROUND5< left surround channel
EBUR128_DUAL_MONO6< a channel that is counted twice

int ebur128_add_frames_double(ebur128_state *st, const double *src, size_t frames)  

This function is declared in upipe-ebur128/ebur128.h source file, line 168.

\brief See \ref ebur128_add_frames_short

int ebur128_add_frames_float(ebur128_state *st, const float *src, size_t frames)  

This function is declared in upipe-ebur128/ebur128.h source file, line 164.

\brief See \ref ebur128_add_frames_short

int ebur128_add_frames_int(ebur128_state *st, const int *src, size_t frames)  

This function is declared in upipe-ebur128/ebur128.h source file, line 160.

\brief See \ref ebur128_add_frames_short

int ebur128_add_frames_short(ebur128_state *st, const short *src, size_t frames)  

This function is declared in upipe-ebur128/ebur128.h source file, line 156.

\brief Add frames to be processed.

Parameters list:

  • st: library state.
  • src: array of source frames. Channels must be interleaved.
  • frames: number of frames. Not number of samples!

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_NOMEM on memory allocation error.

int ebur128_change_parameters(ebur128_state *st, unsigned int channels, unsigned long samplerate)  

This function is declared in upipe-ebur128/ebur128.h source file, line 143.

\brief Change library parameters.

Note that the channel map will be reset when setting a different number of channels. The current unfinished block will be lost.

Parameters list:

  • st: library state.
  • channels: new number of channels.
  • samplerate: new sample rate.

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_NOMEM on memory allocation error. The state will be invalid and must be destroyed. - EBUR128_ERROR_NO_CHANGE if channels and sample rate were not changed.

void ebur128_destroy(ebur128_state **st)  

This function is declared in upipe-ebur128/ebur128.h source file, line 104.

\brief Destroy library state.

Parameters list:

  • st: pointer to a library state.

void ebur128_get_version(int *major, int *minor, int *patch)  

This function is declared in upipe-ebur128/ebur128.h source file, line 87.

\brief Get library version number. Do not pass null pointers here.

Parameters list:

  • major: major version number of library
  • minor: minor version number of library
  • patch: patch version number of library

ebur128_state * ebur128_init(unsigned int channels, unsigned long samplerate, int mode)  

This function is declared in upipe-ebur128/ebur128.h source file, line 98.

\brief Initialize library state.

Parameters list:

  • channels: the number of channels.
  • samplerate: the sample rate.
  • mode: see the mode enum for possible values.

The return value is an initialized library state.

int ebur128_loudness_global(ebur128_state *st, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 179.

\brief Get global integrated loudness in LUFS.

Parameters list:

  • st: library state.
  • out: integrated loudness in LUFS. -HUGE_VAL if result is negative infinity.

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_I" has not been set.

int ebur128_loudness_global_multiple(ebur128_state **sts, size_t size, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 192.

\brief Get global integrated loudness in LUFS across multiple instances.

Parameters list:

  • sts: array of library states.
  • size: length of sts
  • out: integrated loudness in LUFS. -HUGE_VAL if result is negative infinity.

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_I" has not been set.

int ebur128_loudness_momentary(ebur128_state *st, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 202.

\brief Get momentary loudness (last 400ms) in LUFS.

Parameters list:

  • st: library state.
  • out: momentary loudness in LUFS. -HUGE_VAL if result is negative infinity.

The return value is - EBUR128_SUCCESS on success.

int ebur128_loudness_range(ebur128_state *st, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 227.

\brief Get loudness range (LRA) of programme in LU.

Calculates loudness range according to EBU 3342.

Parameters list:

  • st: library state.
  • out: loudness range (LRA) in LU. Will not be changed in case of error. EBUR128_ERROR_NOMEM or EBUR128_ERROR_INVALID_MODE will be returned in this case.

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_NOMEM in case of memory allocation error. - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_LRA" has not been set.

int ebur128_loudness_range_multiple(ebur128_state **sts, size_t size, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 244.

\brief Get loudness range (LRA) in LU across multiple instances.

Calculates loudness range according to EBU 3342.

Parameters list:

  • sts: array of library states.
  • size: length of sts
  • out: loudness range (LRA) in LU. Will not be changed in case of error. EBUR128_ERROR_NOMEM or EBUR128_ERROR_INVALID_MODE will be returned in this case.

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_NOMEM in case of memory allocation error. - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_LRA" has not been set.

int ebur128_loudness_shortterm(ebur128_state *st, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 212.

\brief Get short-term loudness (last 3s) in LUFS.

Parameters list:

  • st: library state.
  • out: short-term loudness in LUFS. -HUGE_VAL if result is negative infinity.

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_S" has not been set.

int ebur128_sample_peak(ebur128_state *st, unsigned int channel_number, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 259.

\brief Get maximum sample peak of selected channel in float format.

Parameters list:

  • st: library state
  • channel_number: channel to analyse
  • out: maximum sample peak in float format (1.0 is 0 dBFS)

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_SAMPLE_PEAK" has not been set. - EBUR128_ERROR_INVALID_CHANNEL_INDEX if invalid channel index.

int ebur128_set_channel(ebur128_state *st, unsigned int channel_number, int value)  

This function is declared in upipe-ebur128/ebur128.h source file, line 125.

\brief Set channel type.

The default is: - 0 -> EBUR128_LEFT - 1 -> EBUR128_RIGHT - 2 -> EBUR128_CENTER - 3 -> EBUR128_UNUSED - 4 -> EBUR128_LEFT_SURROUND - 5 -> EBUR128_RIGHT_SURROUND

Parameters list:

  • st: library state.
  • channel_number: zero based channel index.
  • value: channel type from the "channel" enum.

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_INVALID_CHANNEL_INDEX if invalid channel index.

typedef struct <anonymous> ebur128_state  

This typedef is declared in upipe-ebur128/ebur128.h source file, line 79.

< Internal state.

int ebur128_true_peak(ebur128_state *st, unsigned int channel_number, double *out)  

This function is declared in upipe-ebur128/ebur128.h source file, line 282.

\brief Get maximum true peak of selected channel in float format.

Uses an implementation defined algorithm to calculate the true peak. Do not try to compare resulting values across different versions of the library, as the algorithm may change.

The current implementation uses the Speex resampler with quality level 8 to calculate true peak. Will oversample 4x for sample rates < 96000 Hz, 2x for sample rates < 192000 Hz and leave the signal unchanged for 192000 Hz.

Parameters list:

  • st: library state
  • channel_number: channel to analyse
  • out: maximum true peak in float format (1.0 is 0 dBFS)

The return value is - EBUR128_SUCCESS on success. - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_TRUE_PEAK" has not been set. - EBUR128_ERROR_INVALID_CHANNEL_INDEX if invalid channel index.

enum error  

This enum is declared in upipe-ebur128/ebur128.h source file, line 37.

\enum error Error return values.

IdentifierValueDescription
EBUR128_SUCCESS0
EBUR128_ERROR_NOMEM1
EBUR128_ERROR_INVALID_MODE2
EBUR128_ERROR_INVALID_CHANNEL_INDEX3
EBUR128_ERROR_NO_CHANGE4

enum mode  

This enum is declared in upipe-ebur128/ebur128.h source file, line 49.

\enum mode Use these values in ebur128_init (or'ed). Try to use the lowest possible modes that suit your needs, as performance will be better.

IdentifierValueDescription
EBUR128_MODE_M(1<<0)can call ebur128_loudness_momentary
EBUR128_MODE_S(1<<1)|EBUR128_MODE_Mcan call ebur128_loudness_shortterm
EBUR128_MODE_I(1<<2)|EBUR128_MODE_Mcan call ebur128_gated_loudness_*
EBUR128_MODE_LRA(1<<3)|EBUR128_MODE_Scan call ebur128_loudness_range
EBUR128_MODE_SAMPLE_PEAK(1<<4)|EBUR128_MODE_Mcan call ebur128_sample_peak
EBUR128_MODE_TRUE_PEAK(1<<5)|EBUR128_MODE_M|EBUR128_MODE_SAMPLE_PEAKcan call ebur128_true_peak
EBUR128_MODE_HISTOGRAM(1<<6)uses histogram algorithm to calculate loudness

Valid XHTML 1.0 StrictGenerated by cmassiot on Thu Nov 6 12:15:19 2014 using MkDoc