FFmpeg
|
#include "config_components.h"
#include <stdint.h>
#include "avcodec.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/channel_layout.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "libavutil/opt.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "mlp_parse.h"
#include "mlpdsp.h"
#include "mlp.h"
#include "config.h"
#include "profiles.h"
Go to the source code of this file.
Data Structures | |
struct | SubStream |
struct | MLPDecodeContext |
Macros | |
#define | VLC_BITS 9 |
number of bits used for VLC lookup - longest Huffman code is 9 More... | |
#define | VLC_STATIC_SIZE 512 |
#define | MSB_MASK(bits) (-(1 << (bits))) |
#define | OFFSET(x) offsetof(MLPDecodeContext, x) |
#define | FLAGS (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM) |
Functions | |
static int | mlp_channel_layout_subset (AVChannelLayout *layout, uint64_t mask) |
static enum AVChannel | thd_channel_layout_extract_channel (uint64_t channel_layout, int index) |
static av_cold void | init_static (void) |
Initialize static data, constant between all invocations of the codec. More... | |
static int32_t | calculate_sign_huff (MLPDecodeContext *m, unsigned int substr, unsigned int ch) |
static int | read_huff_channels (MLPDecodeContext *m, GetBitContext *gbp, unsigned int substr, unsigned int pos) |
Read a sample, consisting of either, both or neither of entropy-coded MSBs and plain LSBs. More... | |
static av_cold int | mlp_decode_init (AVCodecContext *avctx) |
static int | read_major_sync (MLPDecodeContext *m, GetBitContext *gb) |
Read a major sync info header - contains high level information about the stream - sample rate, channel arrangement etc. More... | |
static int | read_restart_header (MLPDecodeContext *m, GetBitContext *gbp, const uint8_t *buf, unsigned int substr) |
Read a restart header from a block in a substream. More... | |
static int | read_filter_params (MLPDecodeContext *m, GetBitContext *gbp, unsigned int substr, unsigned int channel, unsigned int filter) |
Read parameters for one of the prediction filters. More... | |
static int | read_matrix_params (MLPDecodeContext *m, unsigned int substr, GetBitContext *gbp) |
Read parameters for primitive matrices. More... | |
static int | read_channel_params (MLPDecodeContext *m, unsigned int substr, GetBitContext *gbp, unsigned int ch) |
Read channel parameters. More... | |
static int | read_decoding_params (MLPDecodeContext *m, GetBitContext *gbp, unsigned int substr) |
Read decoding parameters that change more often than those in the restart header. More... | |
static void | filter_channel (MLPDecodeContext *m, unsigned int substr, unsigned int channel) |
Generate PCM samples using the prediction filters and residual values read from the data stream, and update the filter state. More... | |
static int | read_block_data (MLPDecodeContext *m, GetBitContext *gbp, unsigned int substr) |
Read a block of PCM residual data (or actual if no filtering active). More... | |
static void | generate_2_noise_channels (MLPDecodeContext *m, unsigned int substr) |
Noise generation functions. More... | |
static void | fill_noise_buffer (MLPDecodeContext *m, unsigned int substr) |
Generate a block of noise, used when restart sync word == 0x31eb. More... | |
static int | output_data (MLPDecodeContext *m, unsigned int substr, AVFrame *frame, int *got_frame_ptr) |
Write the audio data into the output buffer. More... | |
static int | read_access_unit (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) |
Read an access unit from the stream. More... | |
static void | mlp_decode_flush (AVCodecContext *avctx) |
Variables | |
static enum AVChannel | thd_channel_order [] |
static VLC | huff_vlc [3] |
static const int8_t | noise_table [256] |
Data table used for TrueHD noise generation function. More... | |
static const AVOption | options [] |
static const AVClass | mlp_decoder_class |
static const AVClass | truehd_decoder_class |
MLP decoder
Definition in file mlpdec.c.
#define VLC_BITS 9 |
#define OFFSET | ( | x | ) | offsetof(MLPDecodeContext, x) |
#define FLAGS (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM) |
|
static |
Definition at line 194 of file mlpdec.c.
Referenced by read_restart_header().
|
static |
Definition at line 201 of file mlpdec.c.
Referenced by read_restart_header().
|
static |
Initialize static data, constant between all invocations of the codec.
Definition at line 219 of file mlpdec.c.
Referenced by mlp_decode_init().
|
inlinestatic |
Definition at line 233 of file mlpdec.c.
Referenced by read_decoding_params().
|
inlinestatic |
Read a sample, consisting of either, both or neither of entropy-coded MSBs and plain LSBs.
Definition at line 254 of file mlpdec.c.
Referenced by read_block_data().
|
static |
|
static |
Read a major sync info header - contains high level information about the stream - sample rate, channel arrangement etc.
Most of this information is not actually necessary for decoding, only for playback.
Definition at line 319 of file mlpdec.c.
Referenced by read_access_unit().
|
static |
Read a restart header from a block in a substream.
This contains parameters required to decode the audio that do not change very often. Generally (always) present only in blocks following a major sync.
Definition at line 510 of file mlpdec.c.
Referenced by read_access_unit().
|
static |
Read parameters for one of the prediction filters.
Definition at line 674 of file mlpdec.c.
Referenced by read_channel_params().
|
static |
Read parameters for primitive matrices.
Definition at line 749 of file mlpdec.c.
Referenced by read_decoding_params().
|
static |
Read channel parameters.
Definition at line 817 of file mlpdec.c.
Referenced by read_decoding_params().
|
static |
Read decoding parameters that change more often than those in the restart header.
Definition at line 874 of file mlpdec.c.
Referenced by read_access_unit().
|
static |
Generate PCM samples using the prediction filters and residual values read from the data stream, and update the filter state.
Definition at line 957 of file mlpdec.c.
Referenced by read_block_data().
|
static |
Read a block of PCM residual data (or actual if no filtering active).
Definition at line 984 of file mlpdec.c.
Referenced by read_access_unit().
|
static |
Noise generation functions.
I'm not sure what these are for - they seem to be some kind of pseudorandom sequence generators, used to generate noise data which is used when the channels are rematrixed. I'm not sure if they provide a practical benefit to compression, or just obfuscate the decoder. Are they for some kind of dithering? Generate two channels of noise, used in the matrix when restart sync word == 0x31ea.
Definition at line 1055 of file mlpdec.c.
Referenced by output_data().
|
static |
Generate a block of noise, used when restart sync word == 0x31eb.
Definition at line 1075 of file mlpdec.c.
Referenced by output_data().
|
static |
Write the audio data into the output buffer.
Definition at line 1092 of file mlpdec.c.
Referenced by apng_do_inverse_blend(), free_data_planes(), read_access_unit(), and test_function().
|
static |
|
static |
|
static |
Definition at line 178 of file mlpdec.c.
Referenced by thd_channel_layout_extract_channel().
|
static |
Definition at line 215 of file mlpdec.c.
Referenced by init_static(), and read_huff_channels().
|
static |
Data table used for TrueHD noise generation function.
Definition at line 1026 of file mlpdec.c.
Referenced by fill_noise_buffer(), and main().
|
static |
|
static |
|
static |