FFmpeg
Data Structures | Macros | Functions | Variables
misc4.c File Reference
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "bytestream.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  ChannelContext
 
struct  MISC4Context
 

Macros

#define FRACBITS   12
 
#define WEIGHTSBITS   26
 

Functions

static av_cold int misc4_init (AVCodecContext *avctx)
 
static int64_t prediction (int delta, ChannelContext *c)
 
static int16_t decode (ChannelContext *c, unsigned nibble)
 
static int misc4_decode (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
 

Variables

static const int16_t steps [16]
 
static const int16_t diffs [16]
 
const FFCodec ff_misc4_decoder
 

Macro Definition Documentation

◆ FRACBITS

#define FRACBITS   12

Definition at line 75 of file misc4.c.

◆ WEIGHTSBITS

#define WEIGHTSBITS   26

Definition at line 76 of file misc4.c.

Function Documentation

◆ misc4_init()

static av_cold int misc4_init ( AVCodecContext avctx)
static

Definition at line 56 of file misc4.c.

◆ prediction()

static int64_t prediction ( int  delta,
ChannelContext c 
)
static

◆ decode()

static int16_t decode ( ChannelContext c,
unsigned  nibble 
)
static

Definition at line 107 of file misc4.c.

Referenced by misc4_decode().

◆ misc4_decode()

static int misc4_decode ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket pkt 
)
static

Definition at line 131 of file misc4.c.

Variable Documentation

◆ steps

const int16_t steps[16]
static

◆ diffs

const int16_t diffs[16]
static
Initial value:
= {
2048, 4, 135, 213, 273, 323, 373, 425,
425, 373, 323, 273, 213, 135, 4, 2048,
}

Definition at line 35 of file misc4.c.

Referenced by decode().

◆ ff_misc4_decoder

const FFCodec ff_misc4_decoder
Initial value:
= {
.p.name = "misc4",
CODEC_LONG_NAME("Micronas SC-4 Audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(MISC4Context),
.p.capabilities = AV_CODEC_CAP_DR1 |
AV_CODEC_CAP_SUBFRAMES |
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
}

Definition at line 174 of file misc4.c.

AV_CODEC_ID_MISC4
@ AV_CODEC_ID_MISC4
Definition: codec_id.h:538
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
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
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
MISC4Context
Definition: misc4.c:48
misc4_init
static av_cold int misc4_init(AVCodecContext *avctx)
Definition: misc4.c:56
misc4_decode
static int misc4_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
Definition: misc4.c:131