FFmpeg
Data Structures | Macros | Functions | Variables
gdv.c File Reference
#include "libavutil/common.h"
#include "avcodec.h"
#include "bytestream.h"
#include "decode.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  GDVContext
 
struct  Bits8
 
struct  Bits32
 

Macros

#define PREAMBLE_SIZE   4096
 

Functions

static av_cold int gdv_decode_init (AVCodecContext *avctx)
 
static void scaleup (uint8_t *dst, const uint8_t *src, int w)
 
static void scaleup_rev (uint8_t *dst, const uint8_t *src, int w)
 
static void scaledown (uint8_t *dst, const uint8_t *src, int w)
 
static void rescale (GDVContext *gdv, uint8_t *dst, int w, int h, int scale_v, int scale_h)
 
static int read_bits2 (Bits8 *bits, GetByteContext *gb)
 
static void fill_bits32 (Bits32 *bits, GetByteContext *gb)
 
static int read_bits32 (Bits32 *bits, GetByteContext *gb, int nbits)
 
static void lz_copy (PutByteContext *pb, GetByteContext *g2, int offset, unsigned len)
 
static int decompress_2 (AVCodecContext *avctx)
 
static int decompress_5 (AVCodecContext *avctx, unsigned skip)
 
static int decompress_68 (AVCodecContext *avctx, unsigned skip, unsigned use8)
 
static int gdv_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int gdv_decode_close (AVCodecContext *avctx)
 

Variables

const AVCodec ff_gdv_decoder
 

Macro Definition Documentation

◆ PREAMBLE_SIZE

#define PREAMBLE_SIZE   4096

Definition at line 52 of file gdv.c.

Function Documentation

◆ gdv_decode_init()

static av_cold int gdv_decode_init ( AVCodecContext avctx)
static

Definition at line 54 of file gdv.c.

◆ scaleup()

static void scaleup ( uint8_t *  dst,
const uint8_t *  src,
int  w 
)
static

Definition at line 76 of file gdv.c.

Referenced by gdv_decode_frame().

◆ scaleup_rev()

static void scaleup_rev ( uint8_t *  dst,
const uint8_t *  src,
int  w 
)
static

Definition at line 94 of file gdv.c.

Referenced by rescale().

◆ scaledown()

static void scaledown ( uint8_t *  dst,
const uint8_t *  src,
int  w 
)
static

Definition at line 113 of file gdv.c.

Referenced by rescale().

◆ rescale()

static void rescale ( GDVContext gdv,
uint8_t *  dst,
int  w,
int  h,
int  scale_v,
int  scale_h 
)
static

Definition at line 131 of file gdv.c.

Referenced by gdv_decode_frame(), and silk_decode_frame().

◆ read_bits2()

static int read_bits2 ( Bits8 bits,
GetByteContext gb 
)
static

Definition at line 179 of file gdv.c.

Referenced by decompress_2(), and decompress_5().

◆ fill_bits32()

static void fill_bits32 ( Bits32 bits,
GetByteContext gb 
)
static

Definition at line 194 of file gdv.c.

Referenced by decompress_68().

◆ read_bits32()

static int read_bits32 ( Bits32 bits,
GetByteContext gb,
int  nbits 
)
static

Definition at line 200 of file gdv.c.

Referenced by decompress_68().

◆ lz_copy()

static void lz_copy ( PutByteContext pb,
GetByteContext g2,
int  offset,
unsigned  len 
)
static

Definition at line 214 of file gdv.c.

Referenced by decompress_2(), decompress_5(), and decompress_68().

◆ decompress_2()

static int decompress_2 ( AVCodecContext avctx)
static

Definition at line 243 of file gdv.c.

Referenced by gdv_decode_frame().

◆ decompress_5()

static int decompress_5 ( AVCodecContext avctx,
unsigned  skip 
)
static

Definition at line 285 of file gdv.c.

Referenced by gdv_decode_frame().

◆ decompress_68()

static int decompress_68 ( AVCodecContext avctx,
unsigned  skip,
unsigned  use8 
)
static

Definition at line 332 of file gdv.c.

Referenced by gdv_decode_frame().

◆ gdv_decode_frame()

static int gdv_decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 458 of file gdv.c.

◆ gdv_decode_close()

static av_cold int gdv_decode_close ( AVCodecContext avctx)
static

Definition at line 556 of file gdv.c.

Variable Documentation

◆ ff_gdv_decoder

const AVCodec ff_gdv_decoder
Initial value:
= {
.name = "gdv",
.long_name = NULL_IF_CONFIG_SMALL("Gremlin Digital Video"),
.priv_data_size = sizeof(GDVContext),
.close = gdv_decode_close,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 563 of file gdv.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
AV_CODEC_ID_GDV
@ AV_CODEC_ID_GDV
Definition: codec_id.h:284
init
static int init
Definition: av_tx.c:47
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
gdv_decode_init
static av_cold int gdv_decode_init(AVCodecContext *avctx)
Definition: gdv.c:54
gdv_decode_close
static av_cold int gdv_decode_close(AVCodecContext *avctx)
Definition: gdv.c:556
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
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
GDVContext
Definition: gdv.c:29
gdv_decode_frame
static int gdv_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: gdv.c:458
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201