FFmpeg
Data Structures | Macros | Functions | Variables
qoadec.c File Reference
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "bytestream.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  QOAChannel
 
struct  QOAContext
 

Macros

#define QOA_SLICE_LEN   20
 
#define QOA_LMS_LEN   4
 

Functions

static av_cold int qoa_decode_init (AVCodecContext *avctx)
 
static int qoa_lms_predict (QOAChannel *lms)
 
static void qoa_lms_update (QOAChannel *lms, int sample, int residual)
 
static int qoa_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

static const int16_t qoa_dequant_tab [16][8]
 
const FFCodec ff_qoa_decoder
 

Macro Definition Documentation

◆ QOA_SLICE_LEN

#define QOA_SLICE_LEN   20

Definition at line 28 of file qoadec.c.

◆ QOA_LMS_LEN

#define QOA_LMS_LEN   4

Definition at line 29 of file qoadec.c.

Function Documentation

◆ qoa_decode_init()

static av_cold int qoa_decode_init ( AVCodecContext avctx)
static

Definition at line 59 of file qoadec.c.

◆ qoa_lms_predict()

static int qoa_lms_predict ( QOAChannel lms)
static

Definition at line 66 of file qoadec.c.

Referenced by qoa_decode_frame().

◆ qoa_lms_update()

static void qoa_lms_update ( QOAChannel lms,
int  sample,
int  residual 
)
static

Definition at line 74 of file qoadec.c.

Referenced by qoa_decode_frame().

◆ qoa_decode_frame()

static int qoa_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int *  got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 84 of file qoadec.c.

Variable Documentation

◆ qoa_dequant_tab

const int16_t qoa_dequant_tab[16][8]
static
Initial value:
= {
{ 1, -1, 3, -3, 5, -5, 7, -7},
{ 5, -5, 18, -18, 32, -32, 49, -49},
{ 16, -16, 53, -53, 95, -95, 147, -147},
{ 34, -34, 113, -113, 203, -203, 315, -315},
{ 63, -63, 210, -210, 378, -378, 588, -588},
{ 104, -104, 345, -345, 621, -621, 966, -966},
{ 158, -158, 528, -528, 950, -950, 1477, -1477},
{ 228, -228, 760, -760, 1368, -1368, 2128, -2128},
{ 316, -316, 1053, -1053, 1895, -1895, 2947, -2947},
{ 422, -422, 1405, -1405, 2529, -2529, 3934, -3934},
{ 548, -548, 1828, -1828, 3290, -3290, 5117, -5117},
{ 696, -696, 2320, -2320, 4176, -4176, 6496, -6496},
{ 868, -868, 2893, -2893, 5207, -5207, 8099, -8099},
{1064, -1064, 3548, -3548, 6386, -6386, 9933, -9933},
{1286, -1286, 4288, -4288, 7718, -7718, 12005, -12005},
{1536, -1536, 5120, -5120, 9216, -9216, 14336, -14336},
}

Definition at line 40 of file qoadec.c.

Referenced by qoa_decode_frame().

◆ ff_qoa_decoder

const FFCodec ff_qoa_decoder
Initial value:
= {
.p.name = "qoa",
CODEC_LONG_NAME("QOA (Quite OK Audio)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_QOA,
.priv_data_size = sizeof(QOAContext),
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
}

Definition at line 158 of file qoadec.c.

FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
AV_CODEC_ID_QOA
@ AV_CODEC_ID_QOA
Definition: codec_id.h:552
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:106
qoa_decode_frame
static int qoa_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: qoadec.c:84
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
QOAContext
Definition: qoadec.c:36
qoa_decode_init
static av_cold int qoa_decode_init(AVCodecContext *avctx)
Definition: qoadec.c:59