FFmpeg
Data Structures | Macros | Functions | Variables
dxv.c File Reference
#include <stdint.h>
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "dxv.h"
#include "lzf.h"
#include "texturedsp.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  DXVContext
 
struct  OpcodeTable
 

Macros

#define CHECKPOINT(x)
 

Functions

static int dxv_decompress_dxt1 (AVCodecContext *avctx)
 
static int fill_ltable (GetByteContext *gb, uint32_t *table, int *nb_elements)
 
static int fill_optable (unsigned *table0, OpcodeTable *table1, int nb_elements)
 
static int get_opcodes (GetByteContext *gb, uint32_t *table, uint8_t *dst, int op_size, int nb_elements)
 
static int dxv_decompress_opcodes (GetByteContext *gb, void *dstp, size_t op_size)
 
static int dxv_decompress_cgo (DXVContext *ctx, GetByteContext *gb, uint8_t *tex_data, int tex_size, uint8_t *op_data, int *oindex, int op_size, uint8_t **dstp, int *statep, uint8_t **tab0, uint8_t **tab1, int offset)
 
static int dxv_decompress_cocg (DXVContext *ctx, GetByteContext *gb, uint8_t *tex_data, int tex_size, uint8_t *op_data0, uint8_t *op_data1, int max_op_size0, int max_op_size1)
 
static int dxv_decompress_yo (DXVContext *ctx, GetByteContext *gb, uint8_t *tex_data, int tex_size, uint8_t *op_data, int max_op_size)
 
static int dxv_decompress_ycg6 (AVCodecContext *avctx)
 
static int dxv_decompress_yg10 (AVCodecContext *avctx)
 
static int dxv_decompress_dxt5 (AVCodecContext *avctx)
 
static int dxv_decompress_lzf (AVCodecContext *avctx)
 
static int dxv_decompress_raw (AVCodecContext *avctx)
 
static int dxv_decode (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static int dxv_init (AVCodecContext *avctx)
 
static int dxv_close (AVCodecContext *avctx)
 

Variables

const FFCodec ff_dxv_decoder
 

Macro Definition Documentation

◆ CHECKPOINT

#define CHECKPOINT (   x)
Value:
do { \
if (state == 0) { \
value = bytestream2_get_le32(gbc); \
state = 16; \
} \
op = value & 0x3; \
value >>= 2; \
state--; \
switch (op) { \
case 1: \
idx = x; \
break; \
case 2: \
idx = (bytestream2_get_byte(gbc) + 2) * x; \
if (idx > pos) { \
av_log(avctx, AV_LOG_ERROR, "idx %d > %d\n", idx, pos); \
} \
break; \
case 3: \
idx = (bytestream2_get_le16(gbc) + 0x102) * x; \
if (idx > pos) { \
av_log(avctx, AV_LOG_ERROR, "idx %d > %d\n", idx, pos); \
} \
break; \
} \
} while(0)

Definition at line 56 of file dxv.c.

Function Documentation

◆ dxv_decompress_dxt1()

static int dxv_decompress_dxt1 ( AVCodecContext avctx)
static

Definition at line 88 of file dxv.c.

Referenced by dxv_decode().

◆ fill_ltable()

static int fill_ltable ( GetByteContext gb,
uint32_t *  table,
int *  nb_elements 
)
static

Definition at line 143 of file dxv.c.

Referenced by dxv_decompress_opcodes().

◆ fill_optable()

static int fill_optable ( unsigned *  table0,
OpcodeTable table1,
int  nb_elements 
)
static

Definition at line 187 of file dxv.c.

Referenced by get_opcodes().

◆ get_opcodes()

static int get_opcodes ( GetByteContext gb,
uint32_t *  table,
uint8_t *  dst,
int  op_size,
int  nb_elements 
)
static

Definition at line 228 of file dxv.c.

Referenced by dxv_decompress_opcodes().

◆ dxv_decompress_opcodes()

static int dxv_decompress_opcodes ( GetByteContext gb,
void *  dstp,
size_t  op_size 
)
static

Definition at line 270 of file dxv.c.

Referenced by dxv_decompress_cocg(), and dxv_decompress_yo().

◆ dxv_decompress_cgo()

static int dxv_decompress_cgo ( DXVContext ctx,
GetByteContext gb,
uint8_t *  tex_data,
int  tex_size,
uint8_t *  op_data,
int *  oindex,
int  op_size,
uint8_t **  dstp,
int *  statep,
uint8_t **  tab0,
uint8_t **  tab1,
int  offset 
)
static

Definition at line 295 of file dxv.c.

Referenced by dxv_decompress_cocg(), and dxv_decompress_yo().

◆ dxv_decompress_cocg()

static int dxv_decompress_cocg ( DXVContext ctx,
GetByteContext gb,
uint8_t *  tex_data,
int  tex_size,
uint8_t *  op_data0,
uint8_t *  op_data1,
int  max_op_size0,
int  max_op_size1 
)
static

Definition at line 535 of file dxv.c.

Referenced by dxv_decompress_ycg6(), and dxv_decompress_yg10().

◆ dxv_decompress_yo()

static int dxv_decompress_yo ( DXVContext ctx,
GetByteContext gb,
uint8_t *  tex_data,
int  tex_size,
uint8_t *  op_data,
int  max_op_size 
)
static

Definition at line 591 of file dxv.c.

Referenced by dxv_decompress_ycg6().

◆ dxv_decompress_ycg6()

static int dxv_decompress_ycg6 ( AVCodecContext avctx)
static

Definition at line 633 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_yg10()

static int dxv_decompress_yg10 ( AVCodecContext avctx)
static

Definition at line 649 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_dxt5()

static int dxv_decompress_dxt5 ( AVCodecContext avctx)
static

Definition at line 666 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_lzf()

static int dxv_decompress_lzf ( AVCodecContext avctx)
static

Definition at line 823 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_raw()

static int dxv_decompress_raw ( AVCodecContext avctx)
static

Definition at line 829 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decode()

static int dxv_decode ( AVCodecContext avctx,
AVFrame frame,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 841 of file dxv.c.

◆ dxv_init()

static int dxv_init ( AVCodecContext avctx)
static

Definition at line 1056 of file dxv.c.

◆ dxv_close()

static int dxv_close ( AVCodecContext avctx)
static

Definition at line 1076 of file dxv.c.

Variable Documentation

◆ ff_dxv_decoder

const FFCodec ff_dxv_decoder
Initial value:
= {
.p.name = "dxv",
CODEC_LONG_NAME("Resolume DXV"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_DXV,
.init = dxv_init,
.close = dxv_close,
.priv_data_size = sizeof(DXVContext),
.p.capabilities = AV_CODEC_CAP_DR1 |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 1090 of file dxv.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
dxv_decode
static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: dxv.c:841
dxv_init
static int dxv_init(AVCodecContext *avctx)
Definition: dxv.c:1056
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
op
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Definition: anm.c:76
dxv_close
static int dxv_close(AVCodecContext *avctx)
Definition: dxv.c:1076
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:110
state
static struct @466 state
bytestream2_get_bytes_left
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:158
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_CODEC_ID_DXV
@ AV_CODEC_ID_DXV
Definition: codec_id.h:245
AV_CODEC_CAP_SLICE_THREADS
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: codec.h:114
DXVContext
Definition: dxv.c:36
value
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
Definition: writing_filters.txt:86
pos
unsigned int pos
Definition: spdifenc.c:414
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61