FFmpeg
|
#include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "put_bits.h"
#include "lossless_audiodsp.h"
#include "wma.h"
#include "wma_common.h"
Go to the source code of this file.
Data Structures | |
struct | WmallChannelCtx |
frame-specific decoder context for a single channel More... | |
struct | WmallDecodeCtx |
main decoder context More... | |
Macros | |
#define | WMALL_MAX_CHANNELS 8 |
current decoder limitations More... | |
#define | MAX_SUBFRAMES 32 |
max number of subframes per channel More... | |
#define | MAX_BANDS 29 |
max number of scale factor bands More... | |
#define | MAX_FRAMESIZE 32768 |
maximum compressed frame size More... | |
#define | MAX_ORDER 256 |
#define | WMALL_BLOCK_MIN_BITS 6 |
log2 of min block size More... | |
#define | WMALL_BLOCK_MAX_BITS 14 |
log2 of max block size More... | |
#define | WMALL_BLOCK_MAX_SIZE (1 << WMALL_BLOCK_MAX_BITS) |
maximum block size More... | |
#define | WMALL_BLOCK_SIZES (WMALL_BLOCK_MAX_BITS - WMALL_BLOCK_MIN_BITS + 1) |
possible block sizes More... | |
#define | WMALL_COEFF_PAD_SIZE 16 |
pad coef buffers with 0 for use with SIMD More... | |
#define | WMASIGN(x) (((x) > 0) - ((x) < 0)) |
Get sign of integer (1 for positive, -1 for negative and 0 for zero) More... | |
Functions | |
static av_cold int | decode_init (AVCodecContext *avctx) |
static int | decode_subframe_length (WmallDecodeCtx *s, int offset) |
Decode the subframe length. More... | |
static int | decode_tilehdr (WmallDecodeCtx *s) |
Decode how the data in the frame is split into subframes. More... | |
static void | decode_ac_filter (WmallDecodeCtx *s) |
static void | decode_mclms (WmallDecodeCtx *s) |
static int | decode_cdlms (WmallDecodeCtx *s) |
static int | decode_channel_residues (WmallDecodeCtx *s, int ch, int tile_size) |
static void | decode_lpc (WmallDecodeCtx *s) |
static void | clear_codec_buffers (WmallDecodeCtx *s) |
static void | reset_codec (WmallDecodeCtx *s) |
Reset filter parameters and transient area at new seekable tile. More... | |
static void | mclms_update (WmallDecodeCtx *s, int icoef, int *pred) |
static void | mclms_predict (WmallDecodeCtx *s, int icoef, int *pred) |
static void | revert_mclms (WmallDecodeCtx *s, int tile_size) |
static void | lms_update (WmallDecodeCtx *s, int ich, int ilms, int input) |
static void | use_high_update_speed (WmallDecodeCtx *s, int ich) |
static void | use_normal_update_speed (WmallDecodeCtx *s, int ich) |
static void | revert_cdlms (WmallDecodeCtx *s, int ch, int coef_begin, int coef_end) |
static void | revert_inter_ch_decorr (WmallDecodeCtx *s, int tile_size) |
static void | revert_acfilter (WmallDecodeCtx *s, int tile_size) |
static int | decode_subframe (WmallDecodeCtx *s) |
static int | decode_frame (WmallDecodeCtx *s) |
Decode one WMA frame. More... | |
static int | remaining_bits (WmallDecodeCtx *s, GetBitContext *gb) |
Calculate remaining input buffer length. More... | |
static void | save_bits (WmallDecodeCtx *s, GetBitContext *gb, int len, int append) |
Fill the bit reservoir with a (partial) frame. More... | |
static int | decode_packet (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) |
static void | flush (AVCodecContext *avctx) |
static av_cold int | decode_close (AVCodecContext *avctx) |
Variables | |
AVCodec | ff_wmalossless_decoder |
#define WMALL_MAX_CHANNELS 8 |
current decoder limitations
max number of handled channels
Definition at line 39 of file wmalosslessdec.c.
Referenced by decode_init(), decode_tilehdr(), and revert_mclms().
#define MAX_SUBFRAMES 32 |
max number of subframes per channel
Definition at line 40 of file wmalosslessdec.c.
Referenced by decode_init(), and decode_tilehdr().
#define MAX_BANDS 29 |
max number of scale factor bands
Definition at line 41 of file wmalosslessdec.c.
#define MAX_FRAMESIZE 32768 |
maximum compressed frame size
Definition at line 42 of file wmalosslessdec.c.
Referenced by decode_init(), decode_packet(), flush(), and save_bits().
#define MAX_ORDER 256 |
Definition at line 43 of file wmalosslessdec.c.
Referenced by decode_cdlms().
#define WMALL_BLOCK_MIN_BITS 6 |
log2 of min block size
Definition at line 45 of file wmalosslessdec.c.
#define WMALL_BLOCK_MAX_BITS 14 |
log2 of max block size
Definition at line 46 of file wmalosslessdec.c.
#define WMALL_BLOCK_MAX_SIZE (1 << WMALL_BLOCK_MAX_BITS) |
#define WMALL_BLOCK_SIZES (WMALL_BLOCK_MAX_BITS - WMALL_BLOCK_MIN_BITS + 1) |
possible block sizes
Definition at line 48 of file wmalosslessdec.c.
#define WMALL_COEFF_PAD_SIZE 16 |
pad coef buffers with 0 for use with SIMD
Definition at line 50 of file wmalosslessdec.c.
Referenced by decode_cdlms(), and revert_cdlms().
#define WMASIGN | ( | x | ) | (((x) > 0) - ((x) < 0)) |
Get sign of integer (1 for positive, -1 for negative and 0 for zero)
Definition at line 179 of file wmalosslessdec.c.
Referenced by lms_update(), mclms_update(), and revert_cdlms().
|
static |
Definition at line 181 of file wmalosslessdec.c.
|
static |
Decode the subframe length.
s | context |
offset | sample offset in the frame |
Definition at line 290 of file wmalosslessdec.c.
Referenced by decode_tilehdr().
|
static |
Decode how the data in the frame is split into subframes.
Every WMA frame contains the encoded data for a fixed number of samples per channel. The data for every channel might be split into several subframes. This function will reconstruct the list of subframes for every channel.
If the subframes are not evenly split, the algorithm estimates the channels with the lowest number of total samples. Afterwards, for each of these channels a bit is read from the bitstream that indicates if the channel contains a subframe with the next subframe size that is going to be read from the bitstream or not. If a channel contains such a subframe, the subframe size gets added to the channel's subframe list. The algorithm repeats these steps until the frame is properly divided between the individual channels.
s | context |
Definition at line 332 of file wmalosslessdec.c.
Referenced by decode_frame().
|
static |
Definition at line 417 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 428 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 451 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 508 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 564 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 576 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Reset filter parameters and transient area at new seekable tile.
Definition at line 605 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 620 of file wmalosslessdec.c.
Referenced by revert_mclms().
|
static |
Definition at line 662 of file wmalosslessdec.c.
Referenced by revert_mclms().
|
static |
Definition at line 684 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 693 of file wmalosslessdec.c.
Referenced by revert_cdlms().
|
static |
Definition at line 719 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 737 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 754 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 780 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 793 of file wmalosslessdec.c.
Referenced by decode_subframe().
|
static |
Definition at line 825 of file wmalosslessdec.c.
Referenced by decode_frame().
|
static |
Decode one WMA frame.
s | codec context |
Definition at line 999 of file wmalosslessdec.c.
Referenced by decode_packet().
|
static |
Calculate remaining input buffer length.
s | codec context |
gb | bitstream reader context |
Definition at line 1098 of file wmalosslessdec.c.
Referenced by decode_packet().
|
static |
Fill the bit reservoir with a (partial) frame.
s | codec context |
gb | bitstream reader context |
len | length of the partial frame |
append | decides whether to reset the buffer or not |
Definition at line 1110 of file wmalosslessdec.c.
Referenced by decode_packet().
|
static |
Definition at line 1154 of file wmalosslessdec.c.
|
static |
Definition at line 1269 of file wmalosslessdec.c.
|
static |
Definition at line 1282 of file wmalosslessdec.c.
AVCodec ff_wmalossless_decoder |
Definition at line 1291 of file wmalosslessdec.c.