FFmpeg
8svx.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Jaikrishnan Menon
3  * Copyright (C) 2011 Stefano Sabatini
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * 8svx audio decoder
25  * @author Jaikrishnan Menon
26  *
27  * supports: fibonacci delta encoding
28  * : exponential encoding
29  *
30  * For more information about the 8SVX format:
31  * http://netghost.narod.ru/gff/vendspec/iff/iff.txt
32  * http://sox.sourceforge.net/AudioFormats-11.html
33  * http://aminet.net/package/mus/misc/wavepak
34  * http://amigan.1emu.net/reg/8SVX.txt
35  *
36  * Samples can be found here:
37  * http://aminet.net/mods/smpl/
38  */
39 
40 #include "libavutil/avassert.h"
41 #include "avcodec.h"
42 #include "internal.h"
43 #include "libavutil/common.h"
44 
45 /** decoder context */
46 typedef struct EightSvxContext {
48  const int8_t *table;
49 
50  /* buffer used to store the whole first packet.
51  data is only sent as one large packet */
53  int data_size;
54  int data_idx;
56 
57 static const int8_t fibonacci[16] = { -34, -21, -13, -8, -5, -3, -2, -1, 0, 1, 2, 3, 5, 8, 13, 21 };
58 static const int8_t exponential[16] = { -128, -64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64 };
59 
60 #define MAX_FRAME_SIZE 2048
61 
62 /**
63  * Delta decode the compressed values in src, and put the resulting
64  * decoded samples in dst.
65  *
66  * @param[in,out] state starting value. it is saved for use in the next call.
67  * @param table delta sequence table
68  */
69 static void delta_decode(uint8_t *dst, const uint8_t *src, int src_size,
70  uint8_t *state, const int8_t *table)
71 {
72  uint8_t val = *state;
73 
74  while (src_size--) {
75  uint8_t d = *src++;
76  val = av_clip_uint8(val + table[d & 0xF]);
77  *dst++ = val;
78  val = av_clip_uint8(val + table[d >> 4]);
79  *dst++ = val;
80  }
81 
82  *state = val;
83 }
84 
85 /** decode a frame */
86 static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
87  int *got_frame_ptr, AVPacket *avpkt)
88 {
89  EightSvxContext *esc = avctx->priv_data;
90  AVFrame *frame = data;
91  int buf_size;
92  int ch, ret;
93  int hdr_size = 2;
94 
95  /* decode and interleave the first packet */
96  if (!esc->data[0] && avpkt) {
97  int chan_size = avpkt->size / avctx->channels - hdr_size;
98 
99  if (avpkt->size % avctx->channels) {
100  av_log(avctx, AV_LOG_WARNING, "Packet with odd size, ignoring last byte\n");
101  }
102  if (avpkt->size < (hdr_size + 1) * avctx->channels) {
103  av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
104  return AVERROR_INVALIDDATA;
105  }
106 
107  esc->fib_acc[0] = avpkt->data[1] + 128;
108  if (avctx->channels == 2)
109  esc->fib_acc[1] = avpkt->data[2+chan_size+1] + 128;
110 
111  esc->data_idx = 0;
112  esc->data_size = chan_size;
113  if (!(esc->data[0] = av_malloc(chan_size)))
114  return AVERROR(ENOMEM);
115  if (avctx->channels == 2) {
116  if (!(esc->data[1] = av_malloc(chan_size))) {
117  av_freep(&esc->data[0]);
118  return AVERROR(ENOMEM);
119  }
120  }
121  memcpy(esc->data[0], &avpkt->data[hdr_size], chan_size);
122  if (avctx->channels == 2)
123  memcpy(esc->data[1], &avpkt->data[2*hdr_size+chan_size], chan_size);
124  }
125  if (!esc->data[0]) {
126  av_log(avctx, AV_LOG_ERROR, "unexpected empty packet\n");
127  return AVERROR_INVALIDDATA;
128  }
129 
130  /* decode next piece of data from the buffer */
131  buf_size = FFMIN(MAX_FRAME_SIZE, esc->data_size - esc->data_idx);
132  if (buf_size <= 0) {
133  *got_frame_ptr = 0;
134  return avpkt->size;
135  }
136 
137  /* get output buffer */
138  frame->nb_samples = buf_size * 2;
139  if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
140  return ret;
141 
142  for (ch = 0; ch < avctx->channels; ch++) {
143  delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
144  buf_size, &esc->fib_acc[ch], esc->table);
145  }
146 
147  esc->data_idx += buf_size;
148 
149  *got_frame_ptr = 1;
150 
151  return ((avctx->frame_number == 0)*hdr_size + buf_size)*avctx->channels;
152 }
153 
155 {
156  EightSvxContext *esc = avctx->priv_data;
157 
158  if (avctx->channels < 1 || avctx->channels > 2) {
159  av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n");
160  return AVERROR_INVALIDDATA;
161  }
162 
163  switch (avctx->codec->id) {
164  case AV_CODEC_ID_8SVX_FIB: esc->table = fibonacci; break;
165  case AV_CODEC_ID_8SVX_EXP: esc->table = exponential; break;
166  default:
167  av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id);
168  return AVERROR_INVALIDDATA;
169  }
170  avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
171 
172  return 0;
173 }
174 
176 {
177  EightSvxContext *esc = avctx->priv_data;
178 
179  av_freep(&esc->data[0]);
180  av_freep(&esc->data[1]);
181  esc->data_size = 0;
182  esc->data_idx = 0;
183 
184  return 0;
185 }
186 
187 #if CONFIG_EIGHTSVX_FIB_DECODER
189  .name = "8svx_fib",
190  .long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
191  .type = AVMEDIA_TYPE_AUDIO,
192  .id = AV_CODEC_ID_8SVX_FIB,
193  .priv_data_size = sizeof (EightSvxContext),
196  .close = eightsvx_decode_close,
197  .capabilities = AV_CODEC_CAP_DR1,
198  .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
200 };
201 #endif
202 #if CONFIG_EIGHTSVX_EXP_DECODER
204  .name = "8svx_exp",
205  .long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
206  .type = AVMEDIA_TYPE_AUDIO,
207  .id = AV_CODEC_ID_8SVX_EXP,
208  .priv_data_size = sizeof (EightSvxContext),
211  .close = eightsvx_decode_close,
212  .capabilities = AV_CODEC_CAP_DR1,
213  .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
215 };
216 #endif
AVCodec
AVCodec.
Definition: avcodec.h:3481
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
AVERROR
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
ff_eightsvx_fib_decoder
AVCodec ff_eightsvx_fib_decoder
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:686
AV_CODEC_ID_8SVX_EXP
@ AV_CODEC_ID_8SVX_EXP
Definition: avcodec.h:618
ch
uint8_t pi<< 24) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_U8,(uint64_t)((*(const uint8_t *) pi - 0x80U))<< 56) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16,(*(const int16_t *) pi >>8)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16,(uint64_t)(*(const int16_t *) pi)<< 48) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32,(*(const int32_t *) pi >>24)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S32,(uint64_t)(*(const int32_t *) pi)<< 32) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S64,(*(const int64_t *) pi >>56)+0x80) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0f/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_FLT, llrintf(*(const float *) pi *(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_DBL, llrint(*(const double *) pi *(INT64_C(1)<< 63))) #define FMT_PAIR_FUNC(out, in) static conv_func_type *const fmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB *AV_SAMPLE_FMT_NB]={ FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64), };static void cpy1(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, len);} static void cpy2(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 2 *len);} static void cpy4(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 4 *len);} static void cpy8(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 8 *len);} AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, const int *ch_map, int flags) { AudioConvert *ctx;conv_func_type *f=fmt_pair_to_conv_functions[av_get_packed_sample_fmt(out_fmt)+AV_SAMPLE_FMT_NB *av_get_packed_sample_fmt(in_fmt)];if(!f) return NULL;ctx=av_mallocz(sizeof(*ctx));if(!ctx) return NULL;if(channels==1){ in_fmt=av_get_planar_sample_fmt(in_fmt);out_fmt=av_get_planar_sample_fmt(out_fmt);} ctx->channels=channels;ctx->conv_f=f;ctx->ch_map=ch_map;if(in_fmt==AV_SAMPLE_FMT_U8||in_fmt==AV_SAMPLE_FMT_U8P) memset(ctx->silence, 0x80, sizeof(ctx->silence));if(out_fmt==in_fmt &&!ch_map) { switch(av_get_bytes_per_sample(in_fmt)){ case 1:ctx->simd_f=cpy1;break;case 2:ctx->simd_f=cpy2;break;case 4:ctx->simd_f=cpy4;break;case 8:ctx->simd_f=cpy8;break;} } if(HAVE_X86ASM &&1) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);if(ARCH_ARM) swri_audio_convert_init_arm(ctx, out_fmt, in_fmt, channels);if(ARCH_AARCH64) swri_audio_convert_init_aarch64(ctx, out_fmt, in_fmt, channels);return ctx;} void swri_audio_convert_free(AudioConvert **ctx) { av_freep(ctx);} int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len) { int ch;int off=0;const int os=(out->planar ? 1 :out->ch_count) *out->bps;unsigned misaligned=0;av_assert0(ctx->channels==out->ch_count);if(ctx->in_simd_align_mask) { int planes=in->planar ? in->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) in->ch[ch];misaligned|=m &ctx->in_simd_align_mask;} if(ctx->out_simd_align_mask) { int planes=out->planar ? out->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) out->ch[ch];misaligned|=m &ctx->out_simd_align_mask;} if(ctx->simd_f &&!ctx->ch_map &&!misaligned){ off=len &~15;av_assert1(off >=0);av_assert1(off<=len);av_assert2(ctx->channels==SWR_CH_MAX||!in->ch[ctx->channels]);if(off >0){ if(out->planar==in->planar){ int planes=out->planar ? out->ch_count :1;for(ch=0;ch< planes;ch++){ ctx->simd_f(out-> ch ch
Definition: audioconvert.c:56
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:295
internal.h
AVPacket::data
uint8_t * data
Definition: avcodec.h:1477
table
static const uint16_t table[]
Definition: prosumer.c:206
data
const char data[16]
Definition: mxf.c:91
exponential
static const int8_t exponential[16]
Definition: 8svx.c:58
MAX_FRAME_SIZE
#define MAX_FRAME_SIZE
Definition: 8svx.c:60
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:31
AVCodecContext::codec
const struct AVCodec * codec
Definition: avcodec.h:1574
eightsvx_decode_init
static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
Definition: 8svx.c:154
AV_CODEC_ID_8SVX_FIB
@ AV_CODEC_ID_8SVX_FIB
Definition: avcodec.h:619
src
#define src
Definition: vp8dsp.c:254
avassert.h
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
state
static struct @313 state
av_cold
#define av_cold
Definition: attributes.h:84
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
EightSvxContext
decoder context
Definition: 8svx.c:46
EightSvxContext::data_idx
int data_idx
Definition: 8svx.c:54
EightSvxContext::table
const int8_t * table
Definition: 8svx.c:48
ff_eightsvx_exp_decoder
AVCodec ff_eightsvx_exp_decoder
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1965
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
AVPacket::size
int size
Definition: avcodec.h:1478
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
AV_SAMPLE_FMT_U8P
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: samplefmt.h:66
EightSvxContext::fib_acc
uint8_t fib_acc[2]
Definition: 8svx.c:47
AVCodecContext::sample_fmt
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:2233
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
eightsvx_decode_close
static av_cold int eightsvx_decode_close(AVCodecContext *avctx)
Definition: 8svx.c:175
val
const char const char void * val
Definition: avisynth_c.h:863
FFMIN
#define FFMIN(a, b)
Definition: common.h:96
AVCodecContext::channels
int channels
number of audio channels
Definition: avcodec.h:2226
AVCodec::id
enum AVCodecID id
Definition: avcodec.h:3495
delta_decode
static void delta_decode(uint8_t *dst, const uint8_t *src, int src_size, uint8_t *state, const int8_t *table)
Delta decode the compressed values in src, and put the resulting decoded samples in dst.
Definition: 8svx.c:69
common.h
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
uint8_t
uint8_t
Definition: audio_convert.c:194
AVCodec::name
const char * name
Name of the codec implementation.
Definition: avcodec.h:3488
fibonacci
static const int8_t fibonacci[16]
Definition: 8svx.c:57
avcodec.h
ret
ret
Definition: filter_design.txt:187
frame
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
Definition: filter_design.txt:264
EightSvxContext::data_size
int data_size
Definition: 8svx.c:53
AVCodecContext
main external API structure.
Definition: avcodec.h:1565
EightSvxContext::data
uint8_t * data[2]
Definition: 8svx.c:52
AVCodecContext::frame_number
int frame_number
Frame counter, set by libavcodec.
Definition: avcodec.h:2256
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:1592
AVPacket
This structure stores compressed data.
Definition: avcodec.h:1454
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
eightsvx_decode_frame
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
decode a frame
Definition: 8svx.c:86