#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 |
AVFloatDSPContext | fdsp |
AC3DSPContext | ac3dsp |
AC-3 optimized functions. | |
FFTContext | mdct |
FFT context for MDCT calculation. | |
const SampleType * | mdct_window |
MDCT window function array. | |
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 | num_blks_code |
number of blocks code (numblkscod) | |
int | num_blocks |
number of blocks per frame | |
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 |
int16_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 | frame_exp_strategy [AC3_MAX_CHANNELS] |
frame exp strategy index | |
int | use_frame_exp_strategy |
indicates use of frame exp strategy | |
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 )(struct AC3EncodeContext *s) |
int(* | mdct_init )(struct AC3EncodeContext *s) |
int(* | allocate_sample_buffers )(struct AC3EncodeContext *s) |
void(* | output_frame_header )(struct AC3EncodeContext *s) |
Definition at line 157 of file ac3enc.h.
AC-3 optimized functions.
Definition at line 164 of file ac3enc.h.
Referenced by apply_channel_coupling(), bit_alloc(), count_mantissa_bits(), count_mantissa_bits_update_ch(), encode_exponents(), extract_exponents(), ff_ac3_encode_init(), normalize_samples(), scale_coefficients(), and sum_square_butterfly().
int(* AC3EncodeContext::allocate_sample_buffers)(struct AC3EncodeContext *s) |
Referenced by allocate_buffers(), and ff_ac3_encode_init().
parent AVCodecContext
Definition at line 160 of file ac3enc.h.
Referenced by allocate_buffers(), dprint_options(), encode_frame(), ff_ac3_encode_init(), ff_ac3_float_mdct_init(), ff_ac3_validate_metadata(), ff_eac3_output_frame_header(), and validate_options().
Definition at line 239 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
bandwidth code (0 to 60) (chbwcod)
Definition at line 204 of file ac3enc.h.
Referenced by count_mantissa_bits(), ff_ac3_compute_coupling_strategy(), output_audio_block(), and set_bandwidth().
Definition at line 233 of file ac3enc.h.
Referenced by allocate_buffers(), cbr_bit_allocation(), and ff_ac3_encode_close().
Definition at line 232 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 222 of file ac3enc.h.
Referenced by ac3_output_frame_header(), bit_alloc(), bit_alloc_init(), bit_alloc_masking(), 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 175 of file ac3enc.h.
Referenced by dprint_options(), ff_ac3_adjust_frame_size(), and validate_options().
int64_t AC3EncodeContext::bits_written |
bit count (used to avg. bitrate)
Definition at line 184 of file ac3enc.h.
Referenced by ff_ac3_adjust_frame_size(), and ff_ac3_encode_init().
bitstream id (bsid)
Definition at line 172 of file ac3enc.h.
Referenced by ac3_output_frame_header(), count_frame_bits(), dprint_options(), ff_ac3_validate_metadata(), ff_eac3_output_frame_header(), and validate_options().
bitstream mode (bsmod)
Definition at line 173 of file ac3enc.h.
Referenced by ac3_output_frame_header(), ff_ac3_encode_init(), and ff_eac3_output_frame_header().
AC3Block AC3EncodeContext::blocks[AC3_MAX_BLOCKS] |
per-block info
Definition at line 168 of file ac3enc.h.
Referenced by allocate_buffers(), apply_channel_coupling(), apply_mdct(), bit_alloc(), bit_alloc_masking(), compute_exp_strategy(), compute_rematrixing_strategy(), count_exponent_bits(), count_frame_bits(), count_mantissa_bits_update_ch(), encode_exponents(), encode_frame(), extract_exponents(), ff_ac3_apply_rematrixing(), ff_ac3_compute_coupling_strategy(), ff_ac3_encode_close(), ff_ac3_group_exponents(), ff_ac3_quantize_mantissas(), ff_eac3_output_frame_header(), ff_eac3_set_cpl_states(), output_audio_block(), scale_coefficients(), and set_bandwidth().
center mix level code
Definition at line 196 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and ff_ac3_validate_metadata().
channel map used to reorder channels
Definition at line 194 of file ac3enc.h.
Referenced by deinterleave_input_samples(), and set_channel_info().
channel mode (acmod)
Definition at line 193 of file ac3enc.h.
Referenced by ac3_output_frame_header(), compute_rematrixing_strategy(), count_frame_bits(), count_frame_bits_fixed(), dprint_options(), ff_ac3_validate_metadata(), ff_eac3_output_frame_header(), output_audio_block(), set_bandwidth(), set_channel_info(), and validate_options().
total number of channels (nchans)
Definition at line 188 of file ac3enc.h.
Referenced by allocate_buffers(), apply_mdct(), bit_alloc_init(), count_frame_bits(), deinterleave_input_samples(), dprint_options(), encode_frame(), extract_exponents(), ff_ac3_encode_close(), ff_ac3_quantize_mantissas(), output_audio_block(), reset_block_bap(), scale_coefficients(), and set_channel_info().
coarse SNR offsets (csnroffst)
Definition at line 223 of file ac3enc.h.
Referenced by bit_alloc_init(), cbr_bit_allocation(), ff_eac3_output_frame_header(), and output_audio_block().
uint8_t AC3EncodeContext::cpl_band_sizes[AC3_MAX_CPL_BANDS] |
number of coeffs in each coupling band
Definition at line 212 of file ac3enc.h.
Referenced by apply_channel_coupling(), and set_bandwidth().
Definition at line 242 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
Definition at line 243 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
coupling enabled for all frames
Definition at line 209 of file ac3enc.h.
Referenced by allocate_buffers(), count_mantissa_bits(), encode_frame(), set_bandwidth(), and validate_options().
coupling channel end frequency bin
Definition at line 206 of file ac3enc.h.
Referenced by apply_channel_coupling(), output_audio_block(), and set_bandwidth().
coupling turned on for this frame
Definition at line 208 of file ac3enc.h.
Referenced by cbr_bit_allocation(), compute_exp_strategy(), count_frame_bits(), encode_exponents(), encode_frame(), extract_exponents(), ff_ac3_compute_coupling_strategy(), ff_eac3_get_frame_exp_strategy(), ff_eac3_output_frame_header(), and scale_coefficients().
uint16_t AC3EncodeContext::crc_inv[2] |
Definition at line 183 of file ac3enc.h.
Referenced by ff_ac3_encode_init(), and output_frame_end().
user-specified cutoff frequency, in Hz
Definition at line 203 of file ac3enc.h.
Referenced by dprint_options(), set_bandwidth(), and validate_options().
dB/bit code (dbpbcod)
Definition at line 220 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
Definition at line 162 of file ac3enc.h.
Referenced by apply_channel_coupling(), apply_mdct(), compute_exp_strategy(), encode_frame(), and ff_ac3_encode_init().
indicates if this is E-AC-3 vs. AC-3
Definition at line 171 of file ac3enc.h.
Referenced by apply_channel_coupling(), bit_alloc_init(), compute_exp_strategy(), count_frame_bits(), count_frame_bits_fixed(), encode_frame(), exponent_init(), ff_ac3_encode_init(), ff_ac3_validate_metadata(), output_audio_block(), output_frame_end(), and validate_options().
Definition at line 236 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 248 of file ac3enc.h.
Referenced by encode_exponents(), ff_ac3_quantize_mantissas(), and reset_block_bap().
uint8_t AC3EncodeContext::exp_strategy[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS] |
exponent strategies
Definition at line 245 of file ac3enc.h.
Referenced by bit_alloc(), bit_alloc_masking(), compute_exp_strategy(), count_exponent_bits(), count_frame_bits(), encode_exponents(), ff_ac3_group_exponents(), ff_eac3_get_frame_exp_strategy(), ff_eac3_output_frame_header(), and output_audio_block().
number of bits used for exponents
Definition at line 228 of file ac3enc.h.
Referenced by cbr_bit_allocation(), and ff_ac3_compute_bit_allocation().
fast decay code (fdcycod)
Definition at line 219 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 224 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 187 of file ac3enc.h.
Referenced by apply_channel_coupling(), count_frame_bits(), count_frame_bits_fixed(), ff_ac3_compute_coupling_strategy(), ff_eac3_output_frame_header(), ff_eac3_set_cpl_states(), output_audio_block(), set_bandwidth(), set_channel_info(), and validate_options().
Definition at line 163 of file ac3enc.h.
Referenced by apply_mdct(), apply_window(), and ff_ac3_encode_init().
int AC3EncodeContext::fine_snr_offset[AC3_MAX_CHANNELS] |
fine SNR offsets (fsnroffst)
Definition at line 225 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 235 of file ac3enc.h.
Referenced by allocate_buffers(), ff_ac3_encode_close(), and scale_coefficients().
indicates if fixed-point encoder is being used
Definition at line 170 of file ac3enc.h.
Referenced by ac3_fixed_encode_init(), allocate_buffers(), apply_mdct(), encode_frame(), and ff_ac3_encode_init().
floor code (floorcod)
Definition at line 221 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
all frame bits except exponents and mantissas
Definition at line 227 of file ac3enc.h.
Referenced by cbr_bit_allocation(), and count_frame_bits().
number of non-coefficient bits for fixed parameters
Definition at line 226 of file ac3enc.h.
Referenced by count_frame_bits(), and count_frame_bits_fixed().
uint8_t AC3EncodeContext::frame_exp_strategy[AC3_MAX_CHANNELS] |
frame exp strategy index
Definition at line 246 of file ac3enc.h.
Referenced by ff_eac3_get_frame_exp_strategy(), and ff_eac3_output_frame_header().
current frame size in bytes
Definition at line 181 of file ac3enc.h.
Referenced by ac3_output_frame_header(), cbr_bit_allocation(), encode_frame(), ff_ac3_adjust_frame_size(), ff_ac3_encode_init(), ff_eac3_output_frame_header(), output_frame_end(), and validate_options().
frame size code (frmsizecod)
Definition at line 182 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 180 of file ac3enc.h.
Referenced by ac3_output_frame_header(), ff_ac3_adjust_frame_size(), output_frame_end(), and validate_options().
Definition at line 237 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
indicates if there is a center channel
Definition at line 191 of file ac3enc.h.
Referenced by count_frame_bits(), dprint_options(), ff_ac3_validate_metadata(), ff_eac3_output_frame_header(), and set_channel_info().
indicates if there are one or more surround channels
Definition at line 192 of file ac3enc.h.
Referenced by count_frame_bits(), dprint_options(), ff_ac3_validate_metadata(), ff_eac3_output_frame_header(), and set_channel_info().
channel index of the LFE channel
Definition at line 190 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 189 of file ac3enc.h.
Referenced by ac3_output_frame_header(), compute_exp_strategy(), count_frame_bits(), 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 200 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), ff_ac3_validate_metadata(), and ff_eac3_output_frame_header().
Lo/Ro surround mix level code.
Definition at line 201 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), ff_ac3_validate_metadata(), and ff_eac3_output_frame_header().
Lt/Rt center mix level code.
Definition at line 198 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), ff_ac3_validate_metadata(), and ff_eac3_output_frame_header().
Lt/Rt surround mix level code.
Definition at line 199 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), ff_ac3_validate_metadata(), and ff_eac3_output_frame_header().
Definition at line 240 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
FFT context for MDCT calculation.
Definition at line 165 of file ac3enc.h.
Referenced by apply_mdct(), ff_ac3_float_mdct_end(), and ff_ac3_float_mdct_init().
Definition at line 234 of file ac3enc.h.
Referenced by allocate_buffers(), ff_ac3_encode_close(), and scale_coefficients().
void(* AC3EncodeContext::mdct_end)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_close(), and ff_ac3_encode_init().
int(* AC3EncodeContext::mdct_init)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_init().
MDCT window function array.
Definition at line 166 of file ac3enc.h.
Referenced by apply_mdct(), ff_ac3_float_mdct_end(), and ff_ac3_float_mdct_init().
number of blocks code (numblkscod)
Definition at line 178 of file ac3enc.h.
Referenced by compute_exp_strategy(), count_frame_bits_fixed(), dprint_options(), ff_eac3_output_frame_header(), and validate_options().
number of blocks per frame
Definition at line 179 of file ac3enc.h.
Referenced by allocate_buffers(), apply_channel_coupling(), apply_mdct(), bit_alloc(), bit_alloc_masking(), compute_exp_strategy(), compute_rematrixing_strategy(), count_exponent_bits(), count_frame_bits(), count_frame_bits_fixed(), count_mantissa_bits_update_ch(), deinterleave_input_samples(), dprint_options(), encode_frame(), extract_exponents(), ff_ac3_adjust_frame_size(), ff_ac3_apply_rematrixing(), ff_ac3_compute_coupling_strategy(), ff_ac3_encode_close(), ff_ac3_encode_init(), ff_ac3_group_exponents(), ff_ac3_output_frame(), ff_ac3_quantize_mantissas(), ff_eac3_get_frame_exp_strategy(), ff_eac3_output_frame_header(), ff_eac3_set_cpl_states(), reset_block_bap(), scale_coefficients(), set_bandwidth(), and validate_options().
number of coupling bands (ncplbnd)
Definition at line 211 of file ac3enc.h.
Referenced by apply_channel_coupling(), count_frame_bits(), output_audio_block(), and set_bandwidth().
number of coupling subbands (ncplsubnd)
Definition at line 210 of file ac3enc.h.
Referenced by apply_channel_coupling(), count_frame_bits(), and set_bandwidth().
encoding options
Definition at line 159 of file ac3enc.h.
Referenced by ac3_output_frame_header(), count_frame_bits(), dprint_options(), encode_frame(), ff_ac3_validate_metadata(), ff_eac3_output_frame_header(), set_bandwidth(), and validate_options().
void(* AC3EncodeContext::output_frame_header)(struct AC3EncodeContext *s) |
Referenced by ff_ac3_encode_init(), and ff_ac3_output_frame().
bitstream writer context
Definition at line 161 of file ac3enc.h.
Referenced by ac3_output_frame_header(), ff_ac3_output_frame(), ff_eac3_output_frame_header(), output_audio_block(), and output_frame_end().
Definition at line 231 of file ac3enc.h.
Referenced by apply_mdct(), deinterleave_input_samples(), and ff_ac3_encode_close().
Definition at line 238 of file ac3enc.h.
Referenced by allocate_buffers(), and ff_ac3_encode_close().
Definition at line 241 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 249 of file ac3enc.h.
Referenced by bit_alloc(), count_mantissa_bits_update_ch(), ff_ac3_quantize_mantissas(), output_audio_block(), and reset_block_bap().
indicates if ref_bap pointers have been set
Definition at line 250 of file ac3enc.h.
Referenced by encode_exponents(), and reset_block_bap().
stereo rematrixing enabled
Definition at line 214 of file ac3enc.h.
Referenced by compute_rematrixing_strategy(), ff_ac3_apply_rematrixing(), and validate_options().
sampling frequency, in Hz
Definition at line 176 of file ac3enc.h.
Referenced by dprint_options(), ff_ac3_adjust_frame_size(), set_bandwidth(), and validate_options().
sample count (used to avg. bitrate)
Definition at line 185 of file ac3enc.h.
Referenced by ff_ac3_adjust_frame_size(), and ff_ac3_encode_init().
slow decay code (sdcycod)
Definition at line 218 of file ac3enc.h.
Referenced by bit_alloc_init(), and output_audio_block().
slow gain code (sgaincod)
Definition at line 217 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 205 of file ac3enc.h.
Referenced by apply_channel_coupling(), bit_alloc(), bit_alloc_masking(), compute_exp_strategy(), compute_rematrixing_strategy(), count_exponent_bits(), count_mantissa_bits(), encode_exponents(), ff_ac3_compute_coupling_strategy(), ff_ac3_group_exponents(), ff_ac3_quantize_mantissas(), output_audio_block(), and set_bandwidth().
surround mix level code
Definition at line 197 of file ac3enc.h.
Referenced by ac3_output_frame_header(), dprint_options(), and ff_ac3_validate_metadata().
indicates use of frame exp strategy
Definition at line 247 of file ac3enc.h.
Referenced by count_frame_bits(), count_frame_bits_fixed(), ff_eac3_get_frame_exp_strategy(), and ff_eac3_output_frame_header().
Definition at line 230 of file ac3enc.h.
Referenced by apply_mdct(), ff_ac3_encode_close(), and normalize_samples().