FFmpeg
Loading...
Searching...
No Matches
osq.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "internal.h"
#include "get_bits.h"
#include "unary.h"

Go to the source code of this file.

Data Structures

struct  OSQChannel
 
struct  OSQContext
 

Macros

#define BITSTREAM_READER_LE
 
#define OFFSET   5
 
#define A   (-1)
 
#define B   (-2)
 
#define C   (-3)
 
#define D   (-4)
 
#define E   (-5)
 
#define P2   (((unsigned)dst[A] + dst[A]) - dst[B])
 
#define P3   (((unsigned)dst[A] - dst[B]) * 3 + dst[C])
 

Functions

static av_cold void osq_flush (AVCodecContext *avctx)
 
static av_cold int osq_close (AVCodecContext *avctx)
 
static av_cold int osq_init (AVCodecContext *avctx)
 
static void reset_stats (OSQChannel *cb)
 
static void update_stats (OSQChannel *cb, int val)
 
static int update_residue_parameter (OSQChannel *cb)
 
static uint32_t get_urice (GetBitContext *gb, int k)
 
static int32_t get_srice (GetBitContext *gb, int x)
 
static int osq_channel_parameters (AVCodecContext *avctx, int ch)
 
static int do_decode (AVCodecContext *avctx, AVFrame *frame, int decorrelate, int downsample)
 
static int osq_decode_block (AVCodecContext *avctx, AVFrame *frame)
 
static int osq_receive_frame (AVCodecContext *avctx, AVFrame *frame)
 

Variables

const FFCodec ff_osq_decoder
 

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 30 of file osq.c.

◆ OFFSET

#define OFFSET   5

Definition at line 34 of file osq.c.

◆ A

#define A   (-1)

Definition at line 232 of file osq.c.

◆ B

#define B   (-2)

Definition at line 233 of file osq.c.

◆ C

#define C   (-3)

Definition at line 234 of file osq.c.

◆ D

#define D   (-4)

Definition at line 235 of file osq.c.

◆ E

#define E   (-5)

Definition at line 236 of file osq.c.

◆ P2

#define P2   (((unsigned)dst[A] + dst[A]) - dst[B])

Definition at line 237 of file osq.c.

◆ P3

#define P3   (((unsigned)dst[A] - dst[B]) * 3 + dst[C])

Definition at line 238 of file osq.c.

Function Documentation

◆ osq_flush()

static av_cold void osq_flush ( AVCodecContext * avctx)
static

Definition at line 66 of file osq.c.

◆ osq_close()

static av_cold int osq_close ( AVCodecContext * avctx)
static

Definition at line 74 of file osq.c.

◆ osq_init()

static av_cold int osq_init ( AVCodecContext * avctx)
static

Definition at line 87 of file osq.c.

◆ reset_stats()

static void reset_stats ( OSQChannel * cb)
static

Definition at line 142 of file osq.c.

Referenced by osq_channel_parameters().

◆ update_stats()

static void update_stats ( OSQChannel * cb,
int val )
static

Definition at line 148 of file osq.c.

Referenced by do_decode().

◆ update_residue_parameter()

static int update_residue_parameter ( OSQChannel * cb)
static

Definition at line 160 of file osq.c.

Referenced by do_decode().

◆ get_urice()

static uint32_t get_urice ( GetBitContext * gb,
int k )
static

Definition at line 184 of file osq.c.

Referenced by get_srice(), and osq_channel_parameters().

◆ get_srice()

static int32_t get_srice ( GetBitContext * gb,
int x )
static

Definition at line 195 of file osq.c.

Referenced by decode_2slp(), decode_5elp(), and do_decode().

◆ osq_channel_parameters()

static int osq_channel_parameters ( AVCodecContext * avctx,
int ch )
static

Definition at line 201 of file osq.c.

Referenced by osq_decode_block().

◆ do_decode()

static int do_decode ( AVCodecContext * avctx,
AVFrame * frame,
int decorrelate,
int downsample )
static

Definition at line 240 of file osq.c.

Referenced by osq_decode_block().

◆ osq_decode_block()

static int osq_decode_block ( AVCodecContext * avctx,
AVFrame * frame )
static

Definition at line 362 of file osq.c.

Referenced by osq_receive_frame().

◆ osq_receive_frame()

static int osq_receive_frame ( AVCodecContext * avctx,
AVFrame * frame )
static

Definition at line 422 of file osq.c.

Variable Documentation

◆ ff_osq_decoder

const FFCodec ff_osq_decoder
Initial value:
= {
.p.name = "osq",
CODEC_LONG_NAME("OSQ (Original Sound Quality)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_OSQ,
.priv_data_size = sizeof(OSQContext),
.close = osq_close,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.flush = osq_flush,
}
#define FF_CODEC_RECEIVE_FRAME_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition codec.h:94
@ AV_CODEC_ID_OSQ
Definition codec_id.h:557
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
static av_cold int osq_close(AVCodecContext *avctx)
Definition osq.c:74
static av_cold void osq_flush(AVCodecContext *avctx)
Definition osq.c:66
static av_cold int osq_init(AVCodecContext *avctx)
Definition osq.c:87
static int osq_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition osq.c:422

Definition at line 486 of file osq.c.