FFmpeg
|
wmalosslessdec.c
Go to the documentation of this file.
40 #define MAX_ORDER 256
45 #define WMALL_BLOCK_SIZES (WMALL_BLOCK_MAX_BITS - WMALL_BLOCK_MIN_BITS + 1) ///< possible block sizes
77 uint8_t bits_per_sample; ///< integer audio sample size for the unscaled IMDCT output (used to scale to [-1.0, 1.0])
84 uint8_t max_subframe_len_bit; ///< flag indicating that the subframe is of maximum size when the first subframe length bit is 1
320 uint16_t num_samples[WMALL_MAX_CHANNELS] = { 0 }; /* sum of samples for all currently known subframes of a channel */
321 uint8_t contains_subframe[WMALL_MAX_CHANNELS]; /* flag indicating if a channel contains the current subframe */
322 int channels_for_cur_subframe = s->num_channels; /* number of channels that contain the current subframe */
323 int fixed_channel_layout = 0; /* flag indicating that all channels use the same subfra2me offsets and sizes */
324 int min_channel_len = 0; /* smallest sum of samples (channels with this length will be processed first) */
uint8_t subframe_len_bits
number of bits used for the subframe length
Definition: wmalosslessdec.c:83
uint8_t bits_per_sample
integer audio sample size for the unscaled IMDCT output (used to scale to [-1.0, 1.0])
Definition: wmalosslessdec.c:77
struct WmallDecodeCtx::@100 cdlms[WMALL_MAX_CHANNELS][9]
static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: wmalosslessdec.c:1164
uint8_t max_subframe_len_bit
flag indicating that the subframe is of maximum size when the first subframe length bit is 1 ...
Definition: wmalosslessdec.c:84
Definition: put_bits.h:41
uint16_t subframe_offsets[MAX_SUBFRAMES]
subframe positions in the current frame
Definition: wmalosslessdec.c:56
int16_t mclms_updates[WMALL_MAX_CHANNELS *2 *32]
Definition: wmalosslessdec.c:133
int32_t * samples_32[WMALL_MAX_CHANNELS]
current samplebuffer pointer (24-bit)
Definition: wmalosslessdec.c:103
int acfilter_prevvalues[WMALL_MAX_CHANNELS][16]
Definition: wmalosslessdec.c:126
void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
Copy the content of src to the bitstream.
Definition: bitstream.c:61
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
static int decode_subframe_length(WmallDecodeCtx *s, int offset)
Decode the subframe length.
Definition: wmalosslessdec.c:276
int channel_coeffs[WMALL_MAX_CHANNELS][WMALL_BLOCK_MAX_SIZE]
Definition: wmalosslessdec.c:170
static int lms_predict(WmallDecodeCtx *s, int ich, int ilms)
Definition: wmalosslessdec.c:687
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
Definition: libavcodec/avcodec.h:1898
int8_t channels_for_cur_subframe
number of channels that contain the subframe
Definition: wmalosslessdec.c:110
Macro definitions for various function/variable attributes.
static int get_sbits_long(GetBitContext *s, int n)
Read 0-32 bits as a signed integer.
Definition: get_bits.h:344
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
Definition: samplefmt.h:50
int8_t num_channels
number of channels in the stream (same as AVCodecContext.num_channels)
Definition: wmalosslessdec.c:80
static void reset_codec(WmallDecodeCtx *s)
Reset filter parameters and transient area at new seekable tile.
Definition: wmalosslessdec.c:583
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: libavcodec/avcodec.h:1242
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: libavcodec/avcodec.h:743
int is_channel_coded[WMALL_MAX_CHANNELS]
Definition: wmalosslessdec.c:154
static uint8_t * append(uint8_t *buf, const uint8_t *src, int size)
Definition: mjpeg2jpeg_bsf.c:53
uint16_t min_samples_per_subframe
Definition: wmalosslessdec.c:85
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everythnig contained in src to dst and reset src.
Definition: frame.c:352
bitstream reader API header.
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: libavcodec/avcodec.h:770
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: libavutil/internal.h:123
static void mclms_update(WmallDecodeCtx *s, int icoef, int *pred)
Definition: wmalosslessdec.c:598
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an input
Definition: filter_design.txt:216
Definition: avutil.h:144
simple assert() macros that are a bit more flexible than ISO C assert().
int8_t channel_indexes_for_cur_subframe[WMALL_MAX_CHANNELS]
Definition: wmalosslessdec.c:111
uint8_t frame_data[MAX_FRAMESIZE+FF_INPUT_BUFFER_PADDING_SIZE]
compressed frame data
Definition: wmalosslessdec.c:70
static void revert_acfilter(WmallDecodeCtx *s, int tile_size)
Definition: wmalosslessdec.c:807
static void put_bits(J2kEncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:160
external API header
int channel_residues[WMALL_MAX_CHANNELS][WMALL_BLOCK_MAX_SIZE]
Definition: wmalosslessdec.c:163
static int decode_tilehdr(WmallDecodeCtx *s)
Decode how the data in the frame is split into subframes.
Definition: wmalosslessdec.c:318
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
Definition: libavcodec/avcodec.h:561
static void use_high_update_speed(WmallDecodeCtx *s, int ich)
Definition: wmalosslessdec.c:741
static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred)
Definition: wmalosslessdec.c:656
static void clear_codec_buffers(WmallDecodeCtx *s)
Definition: wmalosslessdec.c:554
static void revert_inter_ch_decorr(WmallDecodeCtx *s, int tile_size)
Definition: wmalosslessdec.c:794
static int decode_channel_residues(WmallDecodeCtx *s, int ch, int tile_size)
Definition: wmalosslessdec.c:483
static void revert_cdlms(WmallDecodeCtx *s, int ch, int coef_begin, int coef_end)
Definition: wmalosslessdec.c:776
static void use_normal_update_speed(WmallDecodeCtx *s, int ich)
Definition: wmalosslessdec.c:759
int next_packet_start
start offset of the next WMA packet in the demuxer packet
Definition: wmalosslessdec.c:89
int16_t * samples_16[WMALL_MAX_CHANNELS]
current samplebuffer pointer (16-bit)
Definition: wmalosslessdec.c:102
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: libavcodec/utils.c:823
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
Definition: libavcodec/utils.c:927
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:379
int16_t mclms_prevvalues[WMALL_MAX_CHANNELS *2 *32]
Definition: wmalosslessdec.c:132
Definition: libavcodec/avcodec.h:420
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
Definition: get_bits.h:306
static int remaining_bits(WmallDecodeCtx *s, GetBitContext *gb)
Calculate remaining input buffer length.
Definition: wmalosslessdec.c:1108
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
av_cold int ff_wma_get_frame_len_bits(int sample_rate, int version, unsigned int decode_flags)
Get the samples per frame for this stream.
Definition: wma_common.c:31
#define CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time...
Definition: libavcodec/avcodec.h:791
Definition: get_bits.h:54
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
Definition: put_bits.h:81
int transient_counter
number of transient samples from the beginning of the transient zone
Definition: wmalosslessdec.c:60
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
Definition: put_bits.h:54
static void save_bits(WmallDecodeCtx *s, GetBitContext *gb, int len, int append)
Fill the bit reservoir with a (partial) frame.
Definition: wmalosslessdec.c:1120
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
static void lms_update(WmallDecodeCtx *s, int ich, int ilms, int input, int residue)
Definition: wmalosslessdec.c:699
static void revert_mclms(WmallDecodeCtx *s, int tile_size)
Definition: wmalosslessdec.c:678
bitstream writer API
Generated on Mon Nov 18 2024 06:52:03 for FFmpeg by 1.8.11