FFmpeg
Data Structures | Macros | Functions | Variables
roqaudioenc.c File Reference
#include "libavutil/mem.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  ROQDPCMContext
 

Macros

#define ROQ_FRAME_SIZE   735
 
#define ROQ_HEADER_SIZE   8
 
#define MAX_DPCM   (127*127)
 

Functions

static av_cold int roq_dpcm_encode_close (AVCodecContext *avctx)
 
static av_cold int roq_dpcm_encode_init (AVCodecContext *avctx)
 
static unsigned char dpcm_predict (short *previous, short current)
 
static int roq_dpcm_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

const FFCodec ff_roq_dpcm_encoder
 

Macro Definition Documentation

◆ ROQ_FRAME_SIZE

#define ROQ_FRAME_SIZE   735

Definition at line 31 of file roqaudioenc.c.

◆ ROQ_HEADER_SIZE

#define ROQ_HEADER_SIZE   8

Definition at line 32 of file roqaudioenc.c.

◆ MAX_DPCM

#define MAX_DPCM   (127*127)

Definition at line 34 of file roqaudioenc.c.

Function Documentation

◆ roq_dpcm_encode_close()

static av_cold int roq_dpcm_encode_close ( AVCodecContext avctx)
static

Definition at line 46 of file roqaudioenc.c.

◆ roq_dpcm_encode_init()

static av_cold int roq_dpcm_encode_init ( AVCodecContext avctx)
static

Definition at line 55 of file roqaudioenc.c.

◆ dpcm_predict()

static unsigned char dpcm_predict ( short previous,
short  current 
)
static

Definition at line 83 of file roqaudioenc.c.

Referenced by roq_dpcm_encode_frame().

◆ roq_dpcm_encode_frame()

static int roq_dpcm_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int *  got_packet_ptr 
)
static

Definition at line 123 of file roqaudioenc.c.

Variable Documentation

◆ ff_roq_dpcm_encoder

const FFCodec ff_roq_dpcm_encoder
Initial value:
= {
.p.name = "roq_dpcm",
CODEC_LONG_NAME("id RoQ DPCM"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.priv_data_size = sizeof(ROQDPCMContext),
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
}

Definition at line 191 of file roqaudioenc.c.

ROQDPCMContext
Definition: roqaudioenc.c:37
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
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_ROQ_DPCM
@ AV_CODEC_ID_ROQ_DPCM
Definition: codec_id.h:429
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
roq_dpcm_encode_init
static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
Definition: roqaudioenc.c:55
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
roq_dpcm_encode_frame
static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: roqaudioenc.c:123
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
roq_dpcm_encode_close
static av_cold int roq_dpcm_encode_close(AVCodecContext *avctx)
Definition: roqaudioenc.c:46