47 static const int8_t
fibonacci[16] = { -34, -21, -13, -8, -5, -3, -2, -1,
48 0, 1, 2, 3, 5, 8, 13, 21 };
49 static const int8_t
exponential[16] = { -128, -64, -32, -16, -8, -4, -2, -1,
50 0, 1, 2, 4, 8, 16, 32, 64 };
52 #define MAX_FRAME_SIZE 32768
60 static void delta_decode(uint8_t *dst,
const uint8_t *src,
int src_size,
61 uint8_t *
state,
const int8_t *table,
int channels)
67 val = av_clip_uint8(val + table[d & 0xF]);
70 val = av_clip_uint8(val + table[d >> 4]);
78 static void raw_decode(uint8_t *dst,
const int8_t *src,
int src_size,
99 int hdr_size = is_compr ? 2 : 0;
114 esc->
fib_acc[1] = avpkt->
data[2+chan_size+1] + 128;
127 memcpy(esc->
data[0], &avpkt->
data[hdr_size], chan_size);
129 memcpy(esc->
data[1], &avpkt->
data[2*hdr_size+chan_size], chan_size);
160 for (ch = 0; ch < avctx->
channels; ch++) {
184 case CODEC_ID_8SVX_FIB:
187 case CODEC_ID_8SVX_EXP:
216 .id = CODEC_ID_8SVX_FIB,
228 .id = CODEC_ID_8SVX_EXP,
238 .
name =
"pcm_s8_planar",
static const int8_t fibonacci[16]
AVFrame * coded_frame
the picture in the bitstream
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
enum AVSampleFormat sample_fmt
audio sample format
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
decode a frame
AVCodec ff_eightsvx_fib_decoder
static av_cold int eightsvx_decode_close(AVCodecContext *avctx)
static const int8_t exponential[16]
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
AVCodec ff_eightsvx_exp_decoder
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
struct EightSvxContext EightSvxContext
decoder context
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static void raw_decode(uint8_t *dst, const int8_t *src, int src_size, int channels)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec ff_pcm_s8_planar_decoder
static void delta_decode(uint8_t *dst, const uint8_t *src, int src_size, uint8_t *state, const int8_t *table, int channels)
Delta decode the compressed values in src, and put the resulting decoded samples in dst...
common internal api header.
static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
initialize 8svx decoder
int channels
number of audio channels
void avcodec_get_frame_defaults(AVFrame *pic)
Set the fields of the given AVFrame to default values.
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
int nb_samples
number of audio samples (per channel) described by this frame