Go to the documentation of this file.
76 case 16:
s->align *= 2;
82 case MKTAG(
'0',
'C',
'P',
'Y'):
86 case MKTAG(
'1',
'D',
'I',
'F'):
90 case MKTAG(
'2',
'S',
'L',
'P'):
91 case MKTAG(
'3',
'N',
'L',
'P'):
92 case MKTAG(
'4',
'A',
'L',
'P'):
100 s->max_framesize =
s->nb_samples * 16;
101 s->bitstream =
av_calloc(
s->max_framesize,
sizeof(*
s->bitstream));
112 unsigned z = (x << k) | y;
121 return (z & 1) ? ~((
int)(z >> 1)) : z >> 1;
126 const int nb_samples =
s->nb_samples;
127 const int shift =
s->shift;
131 for (
int n = 0; n <
len; n++) {
132 s->samples[0][n] =
s->samples[0][nb_samples + n] >>
shift;
133 s->samples[1][n] =
s->pred[1][n] >>
shift;
136 for (
int n = 0; n <
len; n++) {
137 s->samples[0][n] =
s->samples[0][nb_samples + n] >>
shift;
138 s->samples[1][n] =
s->pred[0][n] >>
shift;
143 for (
int n = 0; n < nb_samples; n++)
144 s->samples[1][n +
len] +=
s->samples[0][n +
len];
146 for (
int n = 0; n <
len; n++) {
147 s->pred[0][n] =
s->samples[1][nb_samples + n];
148 s->pred[1][n] =
s->pred[0][n] -
s->samples[0][nb_samples + n];
156 const int bits =
s->align * 8;
162 for (
int n = 0; n <
s->nb_samples; n++) {
164 s->samples[ch][n] =
get_bits(gb, 8) - 0x80;
168 for (
int n = 0; n <
s->nb_samples; n++) {
180 int ch, finished, fill, correlated;
192 if (block_type < 4 && block_type >= 0) {
199 switch (block_type) {
218 for (
int n = 0; n <
s->nb_samples; n++)
223 for (
int n = 0; n <
s->nb_samples; n++)
228 for (
int n = 0; n <
s->nb_samples; n++)
234 for (
int n = 0; n <
s->nb_samples; n++)
239 for (
int n = 0; n <
s->nb_samples; n++)
244 for (
int n = 0; n <
s->nb_samples; n++)
262 for (
int n = 0; n < 4; n++)
263 s->samples[0][n] =
s->samples[0][
s->nb_samples + n];
272 int ch, finished, fill, correlated, order;
284 if (block_type < 5 && block_type >= 0) {
291 switch (block_type) {
297 if (
s->nb_samples > 570) {
314 for (
int n = 0; n <
s->nb_samples; n++)
319 for (
int n = 0; n <
s->nb_samples; n++)
324 for (
int n = 0; n <
s->nb_samples; n++)
330 for (
int n = 0; n <
s->nb_samples; n++)
335 for (
int n = 0; n <
s->nb_samples; n++)
340 for (
int n = 0; n <
s->nb_samples; n++)
346 for (
int o = 0; o < order; o++)
348 for (
int n = 0; n <
s->nb_samples; n++) {
351 for (
int o = 0; o < order; o++)
352 sum +=
s->filter[ch][o] *
samples[n + 70 - o - 1];
372 for (
int n = 0; n < 70; n++)
373 s->samples[0][n] =
s->samples[0][
s->nb_samples + n];
384 int buf_size, input_buf_size;
388 if ((!
pkt->
size && !
s->bitstream_size) ||
s->nb_samples == 0 ||
s->eof) {
393 buf_size =
FFMIN(
pkt->
size,
s->max_framesize -
s->bitstream_size);
394 input_buf_size = buf_size;
396 memmove(
s->bitstream, &
s->bitstream[
s->bitstream_index],
s->bitstream_size);
397 s->bitstream_index = 0;
400 memcpy(&
s->bitstream[
s->bitstream_index +
s->bitstream_size],
pkt->
data, buf_size);
401 buf = &
s->bitstream[
s->bitstream_index];
402 buf_size +=
s->bitstream_size;
403 s->bitstream_size = buf_size;
404 if (buf_size < s->max_framesize &&
pkt->
data) {
406 return input_buf_size;
414 case MKTAG(
'0',
'C',
'P',
'Y'):
417 case MKTAG(
'1',
'D',
'I',
'F'):
420 case MKTAG(
'2',
'S',
'L',
'P'):
421 case MKTAG(
'3',
'N',
'L',
'P'):
422 case MKTAG(
'4',
'A',
'L',
'P'):
437 s->bitstream_size = 0;
438 s->bitstream_index = 0;
444 frame->nb_samples =
s->nb_samples;
451 uint8_t *dst = (uint8_t *)
frame->extended_data[ch];
452 const int *
src =
s->samples[ch] +
s->offset;
454 for (
int n = 0; n <
frame->nb_samples; n++)
455 dst[n] =
src[n] * (1 <<
s->shift) + 0x80
U;
460 int16_t *dst = (int16_t *)
frame->extended_data[ch];
461 const int *
src =
s->samples[ch] +
s->offset;
463 for (
int n = 0; n <
frame->nb_samples; n++)
464 dst[n] =
src[n] * (1 <<
s->shift);
471 if (
s->bitstream_size) {
472 s->bitstream_index += n;
473 s->bitstream_size -= n;
474 return input_buf_size;
485 s->bitstream_size = 0;
static int get_bits_left(GetBitContext *gb)
static int get_srice(GetBitContext *gb, int k)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int sample_rate
samples per second
#define AVERROR_EOF
End of file.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static int get_bits_count(const GetBitContext *s)
This structure describes decoded (raw) audio or video data.
int nb_channels
Number of channels in this layout.
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVCodec p
The public AVCodec.
AVChannelLayout ch_layout
Audio channel layout.
static int wavarc_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
static void do_stereo(WavArcContext *s, int ch, int correlated, int len)
static int decode_0cpy(AVCodecContext *avctx, WavArcContext *s, GetBitContext *gb)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define FF_CODEC_DECODE_CB(func)
int(* init)(AVBSFContext *ctx)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
#define CODEC_LONG_NAME(str)
static unsigned int get_bits1(GetBitContext *s)
static int get_unary(GetBitContext *gb, int stop, int len)
Get unary code of limited length.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
static int shift(int a, int b)
enum AVSampleFormat sample_fmt
audio sample format
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
const FFCodec ff_wavarc_decoder
static int decode_1dif(AVCodecContext *avctx, WavArcContext *s, GetBitContext *gb)
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVSampleFormat
Audio sample formats.
const char * name
Name of the codec implementation.
void * av_calloc(size_t nmemb, size_t size)
static av_cold int wavarc_close(AVCodecContext *avctx)
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 For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define AV_INPUT_BUFFER_PADDING_SIZE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
main external API structure.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
static av_const int sign_extend(int val, unsigned bits)
static int decode_2slp(AVCodecContext *avctx, WavArcContext *s, GetBitContext *gb)
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Filter the word “frame” indicates either a video frame or a group of audio samples
#define AV_CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time,...
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
This structure stores compressed data.
static unsigned get_urice(GetBitContext *gb, int k)
static av_cold int wavarc_init(AVCodecContext *avctx)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)