#include <ac3enc.h>
Data Fields | |
AVClass * | av_class |
AVClass used for AVOption. | |
AC3EncOptions | options |
encoding options | |
AVCodecContext * | avctx |
parent AVCodecContext | |
PutBitContext | pb |
bitstream writer context | |
DSPContext | dsp |
AC3DSPContext | ac3dsp |
AC-3 optimized functions. | |
AC3MDCTContext * | mdct |
MDCT context. | |
AC3Block | blocks [AC3_MAX_BLOCKS] |
per-block info | |
int | fixed_point |
indicates if fixed-point encoder is being used | |
int | eac3 |
indicates if this is E-AC-3 vs. AC-3 | |
int | bitstream_id |
bitstream id (bsid) | |
int | bitstream_mode |
bitstream mode (bsmod) | |
int | bit_rate |
target bit rate, in bits-per-second | |
int | sample_rate |
sampling frequency, in Hz | |
int | frame_size_min |
minimum frame size in case rounding is necessary | |
int | frame_size |
current frame size in bytes | |
int | frame_size_code |
frame size code (frmsizecod) | |
uint16_t | crc_inv [2] |
int64_t | bits_written |
bit count (used to avg. bitrate) | |
int64_t | samples_written |
sample count (used to avg. bitrate) | |
int | fbw_channels |
number of full-bandwidth channels (nfchans) | |
int | channels |
total number of channels (nchans) | |
int | lfe_on |
indicates if there is an LFE channel (lfeon) | |
int | lfe_channel |
channel index of the LFE channel | |
int | has_center |
indicates if there is a center channel | |
int | has_surround |
indicates if there are one or more surround channels | |
int | channel_mode |
channel mode (acmod) | |
const uint8_t * | channel_map |
channel map used to reorder channels | |
int | center_mix_level |
center mix level code | |
int | surround_mix_level |
surround mix level code | |
int | ltrt_center_mix_level |
Lt/Rt center mix level code. | |
int | ltrt_surround_mix_level |
Lt/Rt surround mix level code. | |
int | loro_center_mix_level |
Lo/Ro center mix level code. | |
int | loro_surround_mix_level |
Lo/Ro surround mix level code. | |
int | cutoff |
user-specified cutoff frequency, in Hz | |
int | bandwidth_code |
bandwidth code (0 to 60) (chbwcod) | |
int | start_freq [AC3_MAX_CHANNELS] |
start frequency bin (strtmant) | |
int | cpl_end_freq |
coupling channel end frequency bin | |
int | cpl_on |
coupling turned on for this frame | |
int | cpl_enabled |
coupling enabled for all frames | |
int | num_cpl_subbands |
number of coupling subbands (ncplsubnd) | |
int | num_cpl_bands |
number of coupling bands (ncplbnd) | |
uint8_t | cpl_band_sizes [AC3_MAX_CPL_BANDS] |
number of coeffs in each coupling band | |
int | rematrixing_enabled |
stereo rematrixing enabled | |
int | slow_gain_code |
slow gain code (sgaincod) | |
int | slow_decay_code |
slow decay code (sdcycod) | |
int | fast_decay_code |
fast decay code (fdcycod) | |
int | db_per_bit_code |
dB/bit code (dbpbcod) | |
int | floor_code |
floor code (floorcod) | |
AC3BitAllocParameters | bit_alloc |
bit allocation parameters | |
int | coarse_snr_offset |
coarse SNR offsets (csnroffst) | |
int | fast_gain_code [AC3_MAX_CHANNELS] |
fast gain codes (signal-to-mask ratio) (fgaincod) | |
int | fine_snr_offset [AC3_MAX_CHANNELS] |
fine SNR offsets (fsnroffst) | |
int | frame_bits_fixed |
number of non-coefficient bits for fixed parameters | |
int | frame_bits |
all frame bits except exponents and mantissas | |
int | exponent_bits |
number of bits used for exponents | |
SampleType * | windowed_samples |
SampleType ** | planar_samples |
uint8_t * | bap_buffer |
uint8_t * | bap1_buffer |
CoefType * | mdct_coef_buffer |
int32_t * | fixed_coef_buffer |
uint8_t * | exp_buffer |
uint8_t * | grouped_exp_buffer |
int16_t * | psd_buffer |
int16_t * | band_psd_buffer |
int16_t * | mask_buffer |
uint16_t * | qmant_buffer |
uint8_t * | cpl_coord_exp_buffer |
uint8_t * | cpl_coord_mant_buffer |
uint8_t | exp_strategy [AC3_MAX_CHANNELS][AC3_MAX_BLOCKS] |
exponent strategies | |
uint8_t | exp_ref_block [AC3_MAX_CHANNELS][AC3_MAX_BLOCKS] |
reference blocks for EXP_REUSE | |
uint8_t * | ref_bap [AC3_MAX_CHANNELS][AC3_MAX_BLOCKS] |
bit allocation pointers (bap) | |
int | ref_bap_set |
indicates if ref_bap pointers have been set | |
void(* | mdct_end )(AC3MDCTContext *mdct) |
int(* | mdct_init )(AVCodecContext *avctx, AC3MDCTContext *mdct, int nbits) |
void(* | apply_window )(DSPContext *dsp, SampleType *output, const SampleType *input, const SampleType *window, unsigned int len) |
int(* | normalize_samples )(struct AC3EncodeContext *s) |
void(* | scale_coefficients )(struct AC3EncodeContext *s) |
int(* | allocate_sample_buffers )(struct AC3EncodeContext *s) |
void(* | deinterleave_input_samples )(struct AC3EncodeContext *s, const SampleType *samples) |
void(* | apply_mdct )(struct AC3EncodeContext *s) |
void(* | apply_channel_coupling )(struct AC3EncodeContext *s) |
void(* | compute_rematrixing_strategy )(struct AC3EncodeContext *s) |
void(* | output_frame_header )(struct AC3EncodeContext *s) |
Definition at line 135 of file ac3enc.h.
AC-3 optimized functions.
Definition at line 141 of file ac3enc.h.
Referenced by bit_alloc(), count_mantissa_bits(), count_mantissa_bits_update_ch(), encode_exponents(), extract_exponents(), ff_ac3_encode_init(), ff_ac3_float_scale_coefficients(), and log2_tab().
int(* AC3EncodeContext::allocate_sample_buffers)(struct AC3EncodeContext *s) |
Referenced by allocate_buffers(), and ff_ac3_encode_init().
void(* AC3EncodeContext::apply_channel_coupling)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_frame(), and ff_ac3_encode_init().
void(* AC3EncodeContext::apply_mdct)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_frame(), and ff_ac3_encode_init().
void(* AC3EncodeContext::apply_window)(DSPContext *dsp, SampleType *output, const SampleType *input, const SampleType *window, unsigned int len) |
Referenced by ff_ac3_encode_init().
int16_t* AC3EncodeContext::band_psd_buffer |
Definition at line 213 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
bandwidth code (0 to 60) (chbwcod)
Definition at line 178 of file ac3enc.h.
Referenced by compute_coupling_strategy(), count_mantissa_bits(), output_audio_block(), and set_bandwidth().
uint8_t* AC3EncodeContext::bap1_buffer |
Definition at line 207 of file ac3enc.h.
Referenced by allocate_buffers(), cbr_bit_allocation(), and ff_ac3_encode_close().
uint8_t* AC3EncodeContext::bap_buffer |
Definition at line 206 of file ac3enc.h.
Referenced by allocate_buffers(), cbr_bit_allocation(), ff_ac3_encode_close(), and reset_block_bap().
bit allocation parameters
Definition at line 196 of file ac3enc.h.
Referenced by ac3_output_frame_header(), bit_alloc(), bit_alloc_init(), bit_alloc_masking(), ff_ac3_encode_frame(), ff_ac3_encode_init(), ff_eac3_output_frame_header(), output_audio_block(), set_bandwidth(), and validate_options().
target bit rate, in bits-per-second
Definition at line 151 of file ac3enc.h.
Referenced by adjust_frame_size(), dprint_options(), and validate_options().
int64_t AC3EncodeContext::bits_written |
bit count (used to avg. bitrate)
Definition at line 158 of file ac3enc.h.
Referenced by adjust_frame_size(), and ff_ac3_encode_init().
bitstream id (bsid)
Definition at line 148 of file ac3enc.h.
Referenced by ac3_output_frame_header(), count_frame_bits(), dprint_options(), ff_eac3_output_frame_header(), validate_metadata(), and validate_options().
bitstream mode (bsmod)
Definition at line 149 of file ac3enc.h.
Referenced by ac3_output_frame_header(), and ff_ac3_encode_init().
AC3Block AC3EncodeContext::blocks[AC3_MAX_BLOCKS] |
per-block info
Definition at line 144 of file ac3enc.h.
Referenced by allocate_buffers(), apply_rematrixing(), bit_alloc(), bit_alloc_masking(), compute_coupling_strategy(), compute_exp_strategy(), count_frame_bits(), count_mantissa_bits_update_ch(), downgrade_exponents(), encode_exponents(), extract_exponents(), ff_ac3_encode_close(), ff_eac3_output_frame_header(), ff_eac3_set_cpl_states(), group_exponents(), output_audio_block(), quantize_mantissas(), and set_bandwidth().
center mix level code
Definition at line 170 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and validate_metadata().
const uint8_t* AC3EncodeContext::channel_map |
channel map used to reorder channels
Definition at line 168 of file ac3enc.h.
Referenced by set_channel_info().
channel mode (acmod)
Definition at line 167 of file ac3enc.h.
Referenced by ac3_output_frame_header(), count_frame_bits(), count_frame_bits_fixed(), dprint_options(), ff_eac3_output_frame_header(), output_audio_block(), set_bandwidth(), set_channel_info(), and validate_options().
total number of channels (nchans)
Definition at line 162 of file ac3enc.h.
Referenced by allocate_buffers(), bit_alloc_init(), count_frame_bits(), dprint_options(), extract_exponents(), ff_ac3_encode_close(), ff_ac3_float_scale_coefficients(), output_audio_block(), quantize_mantissas(), reset_block_bap(), and set_channel_info().
coarse SNR offsets (csnroffst)
Definition at line 197 of file ac3enc.h.
Referenced by bit_alloc_init(), cbr_bit_allocation(), ff_eac3_output_frame_header(), and output_audio_block().
void(* AC3EncodeContext::compute_rematrixing_strategy)(struct AC3EncodeContext *s) |
Referenced by compute_bit_allocation(), ff_ac3_encode_frame(), and ff_ac3_encode_init().
uint8_t AC3EncodeContext::cpl_band_sizes[AC3_MAX_CPL_BANDS] |
number of coeffs in each coupling band
Definition at line 186 of file ac3enc.h.
Referenced by set_bandwidth().
coupling enabled for all frames
Definition at line 183 of file ac3enc.h.
Referenced by allocate_buffers(), count_mantissa_bits(), ff_ac3_encode_frame(), set_bandwidth(), and validate_options().
coupling channel end frequency bin
Definition at line 180 of file ac3enc.h.
Referenced by output_audio_block(), and set_bandwidth().
coupling turned on for this frame
Definition at line 182 of file ac3enc.h.
Referenced by cbr_bit_allocation(), compute_bit_allocation(), compute_coupling_strategy(), compute_exp_strategy(), encode_exponents(), extract_exponents(), and ff_ac3_encode_frame().
uint16_t AC3EncodeContext::crc_inv[2] |
Definition at line 157 of file ac3enc.h.
Referenced by ff_ac3_encode_init(), and output_frame_end().
user-specified cutoff frequency, in Hz
Definition at line 177 of file ac3enc.h.
Referenced by dprint_options(), set_bandwidth(), and validate_options().
dB/bit code (dbpbcod)
Definition at line 194 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
void(* AC3EncodeContext::deinterleave_input_samples)(struct AC3EncodeContext *s, const SampleType *samples) |
Referenced by ff_ac3_encode_frame(), and ff_ac3_encode_init().
Definition at line 140 of file ac3enc.h.
Referenced by compute_exp_strategy(), and ff_ac3_encode_init().
indicates if this is E-AC-3 vs. AC-3
Definition at line 147 of file ac3enc.h.
Referenced by bit_alloc_init(), count_frame_bits(), count_frame_bits_fixed(), ff_ac3_encode_frame(), ff_ac3_encode_init(), output_audio_block(), output_frame_end(), and validate_options().
uint8_t* AC3EncodeContext::exp_buffer |
Definition at line 210 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
uint8_t AC3EncodeContext::exp_ref_block[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS] |
reference blocks for EXP_REUSE
Definition at line 220 of file ac3enc.h.
Referenced by encode_exponents(), quantize_mantissas(), and reset_block_bap().
uint8_t AC3EncodeContext::exp_strategy[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS] |
exponent strategies
Definition at line 219 of file ac3enc.h.
Referenced by bit_alloc(), bit_alloc_masking(), compute_exp_strategy(), count_frame_bits(), downgrade_exponents(), encode_exponents(), ff_eac3_output_frame_header(), group_exponents(), and output_audio_block().
number of bits used for exponents
Definition at line 202 of file ac3enc.h.
Referenced by cbr_bit_allocation(), and group_exponents().
fast decay code (fdcycod)
Definition at line 193 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
int AC3EncodeContext::fast_gain_code[AC3_MAX_CHANNELS] |
fast gain codes (signal-to-mask ratio) (fgaincod)
Definition at line 198 of file ac3enc.h.
Referenced by bit_alloc_init(), bit_alloc_masking(), and output_audio_block().
number of full-bandwidth channels (nfchans)
Definition at line 161 of file ac3enc.h.
Referenced by compute_coupling_strategy(), count_frame_bits(), count_frame_bits_fixed(), ff_eac3_output_frame_header(), ff_eac3_set_cpl_states(), output_audio_block(), set_bandwidth(), and set_channel_info().
int AC3EncodeContext::fine_snr_offset[AC3_MAX_CHANNELS] |
fine SNR offsets (fsnroffst)
Definition at line 199 of file ac3enc.h.
Referenced by cbr_bit_allocation(), ff_eac3_output_frame_header(), and output_audio_block().
int32_t* AC3EncodeContext::fixed_coef_buffer |
Definition at line 209 of file ac3enc.h.
Referenced by allocate_buffers(), ff_ac3_encode_close(), and ff_ac3_float_scale_coefficients().
indicates if fixed-point encoder is being used
Definition at line 146 of file ac3enc.h.
Referenced by ac3_fixed_encode_init(), allocate_buffers(), ff_ac3_encode_init(), and validate_options().
floor code (floorcod)
Definition at line 195 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
all frame bits except exponents and mantissas
Definition at line 201 of file ac3enc.h.
Referenced by cbr_bit_allocation(), and count_frame_bits().
number of non-coefficient bits for fixed parameters
Definition at line 200 of file ac3enc.h.
Referenced by count_frame_bits(), and count_frame_bits_fixed().
current frame size in bytes
Definition at line 155 of file ac3enc.h.
Referenced by ac3_output_frame_header(), adjust_frame_size(), cbr_bit_allocation(), ff_ac3_encode_frame(), ff_ac3_encode_init(), ff_eac3_output_frame_header(), output_frame_end(), and validate_options().
frame size code (frmsizecod)
Definition at line 156 of file ac3enc.h.
Referenced by ac3_output_frame_header(), set_bandwidth(), and validate_options().
minimum frame size in case rounding is necessary
Definition at line 154 of file ac3enc.h.
Referenced by ac3_output_frame_header(), adjust_frame_size(), output_frame_end(), and validate_options().
uint8_t* AC3EncodeContext::grouped_exp_buffer |
Definition at line 211 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
indicates if there is a center channel
Definition at line 165 of file ac3enc.h.
Referenced by dprint_options(), set_channel_info(), and validate_metadata().
indicates if there are one or more surround channels
Definition at line 166 of file ac3enc.h.
Referenced by dprint_options(), set_channel_info(), and validate_metadata().
channel index of the LFE channel
Definition at line 164 of file ac3enc.h.
Referenced by bit_alloc_masking(), compute_exp_strategy(), ff_eac3_output_frame_header(), output_audio_block(), set_bandwidth(), and set_channel_info().
indicates if there is an LFE channel (lfeon)
Definition at line 163 of file ac3enc.h.
Referenced by ac3_output_frame_header(), compute_exp_strategy(), count_frame_bits_fixed(), ff_eac3_output_frame_header(), output_audio_block(), set_bandwidth(), and set_channel_info().
Lo/Ro center mix level code.
Definition at line 174 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and validate_metadata().
Lo/Ro surround mix level code.
Definition at line 175 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and validate_metadata().
Lt/Rt center mix level code.
Definition at line 172 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and validate_metadata().
Lt/Rt surround mix level code.
Definition at line 173 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and validate_metadata().
int16_t* AC3EncodeContext::mask_buffer |
Definition at line 214 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
MDCT context.
Definition at line 142 of file ac3enc.h.
Referenced by ff_ac3_encode_close(), and ff_ac3_encode_init().
Definition at line 208 of file ac3enc.h.
Referenced by allocate_buffers(), ff_ac3_encode_close(), and ff_ac3_float_scale_coefficients().
void(* AC3EncodeContext::mdct_end)(AC3MDCTContext *mdct) |
Referenced by ff_ac3_encode_close(), and ff_ac3_encode_init().
int(* AC3EncodeContext::mdct_init)(AVCodecContext *avctx, AC3MDCTContext *mdct, int nbits) |
Referenced by ff_ac3_encode_init().
int(* AC3EncodeContext::normalize_samples)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_init().
number of coupling bands (ncplbnd)
Definition at line 185 of file ac3enc.h.
Referenced by count_frame_bits(), output_audio_block(), and set_bandwidth().
number of coupling subbands (ncplsubnd)
Definition at line 184 of file ac3enc.h.
Referenced by count_frame_bits(), and set_bandwidth().
encoding options
Definition at line 137 of file ac3enc.h.
Referenced by ac3_output_frame_header(), count_frame_bits(), dprint_options(), ff_ac3_encode_frame(), ff_eac3_output_frame_header(), set_bandwidth(), validate_metadata(), and validate_options().
void(* AC3EncodeContext::output_frame_header)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_init(), and output_frame().
bitstream writer context
Definition at line 139 of file ac3enc.h.
Referenced by ac3_output_frame_header(), ff_eac3_output_frame_header(), output_audio_block(), output_frame(), and output_frame_end().
int16_t* AC3EncodeContext::psd_buffer |
Definition at line 212 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
uint16_t* AC3EncodeContext::qmant_buffer |
Definition at line 215 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
uint8_t* AC3EncodeContext::ref_bap[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS] |
bit allocation pointers (bap)
Definition at line 221 of file ac3enc.h.
Referenced by bit_alloc(), count_mantissa_bits_update_ch(), output_audio_block(), quantize_mantissas(), and reset_block_bap().
indicates if ref_bap pointers have been set
Definition at line 222 of file ac3enc.h.
Referenced by encode_exponents(), and reset_block_bap().
stereo rematrixing enabled
Definition at line 188 of file ac3enc.h.
Referenced by apply_rematrixing(), and validate_options().
sampling frequency, in Hz
Definition at line 152 of file ac3enc.h.
Referenced by adjust_frame_size(), dprint_options(), set_bandwidth(), and validate_options().
sample count (used to avg. bitrate)
Definition at line 159 of file ac3enc.h.
Referenced by adjust_frame_size(), and ff_ac3_encode_init().
void(* AC3EncodeContext::scale_coefficients)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_frame(), and ff_ac3_encode_init().
slow decay code (sdcycod)
Definition at line 192 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
slow gain code (sgaincod)
Definition at line 191 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
int AC3EncodeContext::start_freq[AC3_MAX_CHANNELS] |
start frequency bin (strtmant)
Definition at line 179 of file ac3enc.h.
Referenced by bit_alloc(), bit_alloc_masking(), compute_coupling_strategy(), compute_exp_strategy(), count_mantissa_bits(), encode_exponents(), group_exponents(), output_audio_block(), quantize_mantissas(), and set_bandwidth().
surround mix level code
Definition at line 171 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and validate_metadata().