|
| static void | vorbis_encode_floor_setup (vorbis_info *vi, int s, const static_codebook *const *const *const books, const vorbis_info_floor1 *in, const int *x) |
| static void | vorbis_encode_global_psych_setup (vorbis_info *vi, double s, const vorbis_info_psy_global *in, const double *x) |
| static void | vorbis_encode_global_stereo (vorbis_info *vi, const highlevel_encode_setup *const hi, const adj_stereo *p) |
| static void | vorbis_encode_psyset_setup (vorbis_info *vi, double s, const int *nn_start, const int *nn_partition, const double *nn_thresh, int block) |
| static void | vorbis_encode_tonemask_setup (vorbis_info *vi, double s, int block, const att3 *att, const int *max, const vp_adjblock *in) |
| static void | vorbis_encode_compand_setup (vorbis_info *vi, double s, int block, const compandblock *in, const double *x) |
| static void | vorbis_encode_peak_setup (vorbis_info *vi, double s, int block, const int *suppress) |
| static void | vorbis_encode_noisebias_setup (vorbis_info *vi, double s, int block, const int *suppress, const noise3 *in, const noiseguard *guard, double userbias) |
| static void | vorbis_encode_ath_setup (vorbis_info *vi, int block) |
| static int | book_dup_or_new (codec_setup_info *ci, const static_codebook *book) |
| static void | vorbis_encode_blocksize_setup (vorbis_info *vi, double s, const int *shortb, const int *longb) |
| static void | vorbis_encode_residue_setup (vorbis_info *vi, int number, int block, const vorbis_residue_template *res) |
| static void | vorbis_encode_map_n_res_setup (vorbis_info *vi, double s, const vorbis_mapping_template *maps) |
| static double | setting_to_approx_bitrate (vorbis_info *vi) |
| static const void * | get_setup_template (long ch, long srate, double req, int q_or_bitrate, double *base_setting) |
| int | vorbis_encode_setup_init (vorbis_info *vi) |
| static void | vorbis_encode_setup_setting (vorbis_info *vi, long channels, long rate) |
| 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_managed (vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate) |
| int | vorbis_encode_init (vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate) |
| int | vorbis_encode_ctl (vorbis_info *vi, int number, void *arg) |
| 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.
- Parameters
-
| 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. |
- Returns
- Zero for success, and negative values for failure.
- Return values
-
| 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_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.
- Parameters
-
| 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. |
- Returns
- Zero for success, and negative for failure.
- Return values
-
| 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. |