openshot-audio
0.1.6
|
#include "codec.h"
Go to the source code of this file.
Classes | |
struct | ovectl_ratemanage_arg |
struct | ovectl_ratemanage2_arg |
Macros | |
vorbis_encode_ctl() codes | |
These values are passed as the | |
#define | OV_ECTL_RATEMANAGE2_GET 0x14 |
#define | OV_ECTL_RATEMANAGE2_SET 0x15 |
#define | OV_ECTL_LOWPASS_GET 0x20 |
#define | OV_ECTL_LOWPASS_SET 0x21 |
#define | OV_ECTL_IBLOCK_GET 0x30 |
#define | OV_ECTL_IBLOCK_SET 0x31 |
#define | OV_ECTL_COUPLING_GET 0x40 |
#define | OV_ECTL_COUPLING_SET 0x41 |
#define | OV_ECTL_RATEMANAGE_GET 0x10 |
#define | OV_ECTL_RATEMANAGE_SET 0x11 |
#define | OV_ECTL_RATEMANAGE_AVG 0x12 |
#define | OV_ECTL_RATEMANAGE_HARD 0x13 |
Functions | |
int | vorbis_encode_init (vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate) |
int | vorbis_encode_setup_managed (vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate) |
int | vorbis_encode_setup_vbr (vorbis_info *vi, long channels, long rate, float quality) |
int | vorbis_encode_init_vbr (vorbis_info *vi, long channels, long rate, float base_quality) |
int | vorbis_encode_setup_init (vorbis_info *vi) |
int | vorbis_encode_ctl (vorbis_info *vi, int number, void *arg) |
Libvorbisenc is a convenient API for setting up an encoding environment using libvorbis. Libvorbisenc encapsulates the actions needed to set up the encoder properly.
#define OV_ECTL_COUPLING_GET 0x40 |
Returns the current encoder coupling setting in the int pointed to by arg.
Argument: int *
#define OV_ECTL_COUPLING_SET 0x41 |
Enables/disables channel coupling in multichannel encoding according to arg.
Argument: int *
Zero disables channel coupling for multichannel inputs, nonzer enables channel coupling. Setting has no effect on monophonic encoding or multichannel counts that do not offer coupling. At present, coupling is available for stereo and 5.1 encoding.
#define OV_ECTL_IBLOCK_GET 0x30 |
Returns the current encoder impulse block setting in the double pointed to by arg.
Argument: double *
#define OV_ECTL_IBLOCK_SET 0x31 |
Sets the impulse block bias to the the value pointed to by arg.
Argument: double *
Valid range is -15.0 to 0.0 [default]. A negative impulse block bias will direct to encoder to use more bits when incoding short blocks that contain strong impulses, thus improving the accuracy of impulse encoding.
#define OV_ECTL_LOWPASS_GET 0x20 |
Returns the current encoder hard-lowpass setting (kHz) in the double pointed to by arg.
Argument: double *
#define OV_ECTL_LOWPASS_SET 0x21 |
Sets the encoder hard-lowpass to the value (kHz) pointed to by arg. Valid lowpass settings range from 2 to 99.
Argument: double *
#define OV_ECTL_RATEMANAGE2_GET 0x14 |
Query the current encoder bitrate management setting.
Argument: struct ovectl_ratemanage2_arg *
Used to query the current encoder bitrate management setting. Also used to initialize fields of an ovectl_ratemanage2_arg structure for use with OV_ECTL_RATEMANAGE2_SET.
#define OV_ECTL_RATEMANAGE2_SET 0x15 |
Set the current encoder bitrate management settings.
Argument: struct ovectl_ratemanage2_arg *
Used to set the current encoder bitrate management settings to the values listed in the ovectl_ratemanage2_arg. Passing a NULL pointer will disable bitrate management.
#define OV_ECTL_RATEMANAGE_AVG 0x12 |
Old interface to setting average-bitrate encoding mode.
Deprecated after move to bit-reservoir style management in 1.1 rendered this interface partially obsolete.
Argument: struct ovectl_ratemanage_arg *
#define OV_ECTL_RATEMANAGE_GET 0x10 |
Old interface to querying bitrate management settings.
Deprecated after move to bit-reservoir style management in 1.1 rendered this interface partially obsolete.
Argument: struct ovectl_ratemanage_arg *
#define OV_ECTL_RATEMANAGE_HARD 0x13 |
Old interface to setting bounded-bitrate encoding modes.
deprecated after move to bit-reservoir style management in 1.1 rendered this interface partially obsolete.
Argument: struct ovectl_ratemanage_arg *
#define OV_ECTL_RATEMANAGE_SET 0x11 |
Old interface to modifying bitrate management settings.
deprecated after move to bit-reservoir style management in 1.1 rendered this interface partially obsolete.
Argument: struct ovectl_ratemanage_arg *
int vorbis_encode_ctl | ( | vorbis_info * | vi, |
int | number, | ||
void * | arg | ||
) |
This function implements a generic interface to miscellaneous encoder settings similar to the classic UNIX 'ioctl()' system call. Applications may use vorbis_encode_ctl() to query or set bitrate management or quality mode details by using one of several request arguments detailed below. vorbis_encode_ctl() must be called after one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr(). When used to modify settings, vorbis_encode_ctl() must be called before vorbis_encode_setup_init().
vi | Pointer to an initialized vorbis_info struct. |
number | Specifies the desired action; See the listof available requests". |
arg | void * pointing to a data structure matching the request argument. |
0 | Success. Any further return information (such as the result of a query) is placed into the storage pointed to by *arg. |
OV_EINVAL | Invalid argument, or an attempt to modify a setting after calling vorbis_encode_setup_init(). |
OV_EIMPL | Unimplemented or unknown request |
int vorbis_encode_init | ( | vorbis_info * | vi, |
long | channels, | ||
long | rate, | ||
long | max_bitrate, | ||
long | nominal_bitrate, | ||
long | min_bitrate | ||
) |
This is the primary function within libvorbisenc for setting up managed bitrate modes.
Before this function is called, the vorbis_info struct should be initialized by using vorbis_info_init() from the libvorbis API. After encoding, vorbis_info_clear() should be called.
The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set constraints for the encoded file. This function uses these settings to select the appropriate encoding mode and set it up.
vi | Pointer to an initialized vorbis_info struct. |
channels | The number of channels to be encoded. |
rate | The sampling rate of the source audio. |
max_bitrate | Desired maximum bitrate (limit). -1 indicates unset. |
nominal_bitrate | Desired average, or central, bitrate. -1 indicates unset. |
min_bitrate | Desired minimum bitrate. -1 indicates unset. |
0 | Success. |
OV_EFAULT | Internal logic fault; indicates a bug or heap/stack corruption. |
OV_EINVAL | Invalid setup request, eg, out of range argument. |
OV_EIMPL | Unimplemented mode; unable to comply with bitrate request. |
int vorbis_encode_init_vbr | ( | vorbis_info * | vi, |
long | channels, | ||
long | rate, | ||
float | base_quality | ||
) |
This is the primary function within libvorbisenc for setting up variable bitrate ("quality" based) modes.
Before this function is called, the vorbis_info struct should be initialized by using vorbis_info_init() from the libvorbis API. After encoding, vorbis_info_clear() should be called.
vi | Pointer to an initialized vorbis_info struct. |
channels | The number of channels to be encoded. |
rate | The sampling rate of the source audio. |
base_quality | Desired quality level, currently from -0.1 to 1.0 (lo to hi). |
0 | Success |
OV_EFAULT | Internal logic fault; indicates a bug or heap/stack corruption. |
OV_EINVAL | Invalid setup request, eg, out of range argument. |
OV_EIMPL | Unimplemented mode; unable to comply with quality level request. |
int vorbis_encode_setup_init | ( | vorbis_info * | vi | ) |
This function performs the last stage of three-step encoding setup, as described in the API overview under managed bitrate modes.
Before this function is called, the vorbis_info struct should be initialized by using vorbis_info_init() from the libvorbis API, one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr() called to initialize the high-level encoding setup, and vorbis_encode_ctl() called if necessary to make encoding setup changes. vorbis_encode_setup_init() finalizes the highlevel encoding structure into a complete encoding setup after which the application may make no further setup changes.
After encoding, vorbis_info_clear() should be called.
vi | Pointer to an initialized vorbis_info struct. |
0 | Success. |
OV_EFAULT | Internal logic fault; indicates a bug or heap/stack corruption. |
OV_EINVAL | Attempt to use vorbis_encode_setup_init() without first calling one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr() to initialize the high-level encoding setup |
int vorbis_encode_setup_managed | ( | vorbis_info * | vi, |
long | channels, | ||
long | rate, | ||
long | max_bitrate, | ||
long | nominal_bitrate, | ||
long | min_bitrate | ||
) |
This function performs step-one of a three-step bitrate-managed encode setup. It functions similarly to the one-step setup performed by vorbis_encode_init but allows an application to make further encode setup tweaks using vorbis_encode_ctl before finally calling vorbis_encode_setup_init to complete the setup process.
Before this function is called, the vorbis_info struct should be initialized by using vorbis_info_init() from the libvorbis API. After encoding, vorbis_info_clear() should be called.
The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set constraints for the encoded file. This function uses these settings to select the appropriate encoding mode and set it up.
vi | Pointer to an initialized vorbis_info struct. |
channels | The number of channels to be encoded. |
rate | The sampling rate of the source audio. |
max_bitrate | Desired maximum bitrate (limit). -1 indicates unset. |
nominal_bitrate | Desired average, or central, bitrate. -1 indicates unset. |
min_bitrate | Desired minimum bitrate. -1 indicates unset. |
0 | Success |
OV_EFAULT | Internal logic fault; indicates a bug or heap/stack corruption. |
OV_EINVAL | Invalid setup request, eg, out of range argument. |
OV_EIMPL | Unimplemented mode; unable to comply with bitrate request. |
int vorbis_encode_setup_vbr | ( | vorbis_info * | vi, |
long | channels, | ||
long | rate, | ||
float | quality | ||
) |
This function performs step-one of a three-step variable bitrate (quality-based) encode setup. It functions similarly to the one-step setup performed by vorbis_encode_init_vbr() but allows an application to make further encode setup tweaks using vorbis_encode_ctl() before finally calling vorbis_encode_setup_init to complete the setup process.
Before this function is called, the vorbis_info struct should be initialized by using vorbis_info_init() from the libvorbis API. After encoding, vorbis_info_clear() should be called.
vi | Pointer to an initialized vorbis_info struct. |
channels | The number of channels to be encoded. |
rate | The sampling rate of the source audio. |
quality | Desired quality level, currently from -0.1 to 1.0 (lo to hi). |
0 | Success |
OV_EFAULT | Internal logic fault; indicates a bug or heap/stack corruption. |
OV_EINVAL | Invalid setup request, eg, out of range argument. |
OV_EIMPL | Unimplemented mode; unable to comply with quality level request. |