|
FFmpeg
|
The simplest AC-3 encoder. More...
#include <stdint.h>#include "libavutil/attributes.h"#include "libavutil/avassert.h"#include "libavutil/avstring.h"#include "libavutil/channel_layout.h"#include "libavutil/crc.h"#include "libavutil/internal.h"#include "libavutil/opt.h"#include "avcodec.h"#include "internal.h"#include "me_cmp.h"#include "put_bits.h"#include "audiodsp.h"#include "ac3dsp.h"#include "ac3.h"#include "fft.h"#include "ac3enc.h"#include "eac3enc.h"Classes | |
| struct | AC3Mant |
Macros | |
| #define | CMIXLEV_NUM_OPTIONS 3 |
| #define | SURMIXLEV_NUM_OPTIONS 3 |
| #define | EXTMIXLEV_NUM_OPTIONS 8 |
| #define | EXP_DIFF_THRESHOLD 500 |
| Exponent Difference Threshold. More... | |
| #define | CRC16_POLY ((1 << 0) | (1 << 2) | (1 << 15) | (1 << 16)) |
| CRC-16 Polynomial. | |
| #define | FLT_OPTION_THRESHOLD 0.01 |
Typedefs | |
| typedef struct AC3Mant | AC3Mant |
Functions | |
| void | ff_ac3_adjust_frame_size (AC3EncodeContext *s) |
| Adjust the frame size to make the average bit rate match the target bit rate. More... | |
| void | ff_ac3_compute_coupling_strategy (AC3EncodeContext *s) |
| Set the initial coupling strategy parameters prior to coupling analysis. More... | |
| void | ff_ac3_apply_rematrixing (AC3EncodeContext *s) |
| Apply stereo rematrixing to coefficients based on rematrixing flags. More... | |
| void | ff_ac3_group_exponents (AC3EncodeContext *s) |
| Group exponents. More... | |
| void | ff_ac3_process_exponents (AC3EncodeContext *s) |
| Calculate final exponents from the supplied MDCT coefficients and exponent shift. More... | |
| int | ff_ac3_compute_bit_allocation (AC3EncodeContext *s) |
| void | ff_ac3_quantize_mantissas (AC3EncodeContext *s) |
| Quantize mantissas using coefficients, exponents, and bit allocation pointers. More... | |
| void | ff_ac3_output_frame (AC3EncodeContext *s, unsigned char *frame) |
| Write the frame to the output bitstream. More... | |
| int | ff_ac3_validate_metadata (AC3EncodeContext *s) |
| Validate metadata options as set by AVOption system. More... | |
| av_cold int | ff_ac3_encode_close (AVCodecContext *avctx) |
| Finalize encoding and free any memory allocated by the encoder. More... | |
| av_cold int | ff_ac3_encode_init (AVCodecContext *avctx) |
Variables | |
| const uint64_t | ff_ac3_channel_layouts [19] |
| List of supported channel layouts. More... | |
The simplest AC-3 encoder.
| #define EXP_DIFF_THRESHOLD 500 |
Exponent Difference Threshold.
New exponents are sent if their SAD exceed this number.
| void ff_ac3_adjust_frame_size | ( | AC3EncodeContext * | s | ) |
Adjust the frame size to make the average bit rate match the target bit rate.
This is only needed for 11025, 22050, and 44100 sample rates or any E-AC-3.
| s | AC-3 encoder private context |
| void ff_ac3_apply_rematrixing | ( | AC3EncodeContext * | s | ) |
Apply stereo rematrixing to coefficients based on rematrixing flags.
| s | AC-3 encoder private context |
| void ff_ac3_compute_coupling_strategy | ( | AC3EncodeContext * | s | ) |
Set the initial coupling strategy parameters prior to coupling analysis.
| s | AC-3 encoder private context |
| av_cold int ff_ac3_encode_close | ( | AVCodecContext * | avctx | ) |
Finalize encoding and free any memory allocated by the encoder.
| avctx | Codec context |
| void ff_ac3_group_exponents | ( | AC3EncodeContext * | s | ) |
Group exponents.
3 delta-encoded exponents are in each 7-bit group. The number of groups varies depending on exponent strategy and bandwidth.
| s | AC-3 encoder private context |
| void ff_ac3_output_frame | ( | AC3EncodeContext * | s, |
| unsigned char * | frame | ||
| ) |
Write the frame to the output bitstream.
| s | AC-3 encoder private context |
| frame | output data buffer |
| void ff_ac3_process_exponents | ( | AC3EncodeContext * | s | ) |
Calculate final exponents from the supplied MDCT coefficients and exponent shift.
Extract exponents from MDCT coefficients, calculate exponent strategies, and encode final exponents.
| s | AC-3 encoder private context |
| void ff_ac3_quantize_mantissas | ( | AC3EncodeContext * | s | ) |
Quantize mantissas using coefficients, exponents, and bit allocation pointers.
| s | AC-3 encoder private context |
| int ff_ac3_validate_metadata | ( | AC3EncodeContext * | s | ) |
Validate metadata options as set by AVOption system.
These values can optionally be changed per-frame.
| s | AC-3 encoder private context |
| const uint64_t ff_ac3_channel_layouts[19] |
List of supported channel layouts.
1.8.12