FFmpeg  4.3
Data Structures | Macros | Functions | Variables
dxv.c File Reference
#include <stdint.h>
#include "libavutil/imgutils.h"
#include "mathops.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.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 void decompress_indices (uint8_t *dst, const uint8_t *src)
 
static int extract_component (int yo0, int yo1, int code)
 
static int cocg_block (uint8_t *plane0, ptrdiff_t stride0, uint8_t *plane1, ptrdiff_t stride1, const uint8_t *block)
 
static void yao_subblock (uint8_t *dst, uint8_t *yo_indices, ptrdiff_t stride, const uint8_t *block)
 
static int yo_block (uint8_t *dst, ptrdiff_t stride, uint8_t *unused0, ptrdiff_t unused1, const uint8_t *block)
 
static int yao_block (uint8_t *plane0, ptrdiff_t stride0, uint8_t *plane3, ptrdiff_t stride1, const uint8_t *block)
 
static int decompress_texture_thread (AVCodecContext *avctx, void *arg, int slice, int thread_nb)
 
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, void *data, int *got_frame, AVPacket *avpkt)
 
static int dxv_init (AVCodecContext *avctx)
 
static int dxv_close (AVCodecContext *avctx)
 

Variables

AVCodec 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 256 of file dxv.c.

Function Documentation

◆ decompress_indices()

static void decompress_indices ( uint8_t dst,
const uint8_t src 
)
static

Definition at line 66 of file dxv.c.

Referenced by cocg_block(), and yao_subblock().

◆ extract_component()

static int extract_component ( int  yo0,
int  yo1,
int  code 
)
static

Definition at line 82 of file dxv.c.

Referenced by cocg_block(), and yao_subblock().

◆ cocg_block()

static int cocg_block ( uint8_t plane0,
ptrdiff_t  stride0,
uint8_t plane1,
ptrdiff_t  stride1,
const uint8_t block 
)
static

Definition at line 111 of file dxv.c.

Referenced by dxv_decode().

◆ yao_subblock()

static void yao_subblock ( uint8_t dst,
uint8_t yo_indices,
ptrdiff_t  stride,
const uint8_t block 
)
static

Definition at line 141 of file dxv.c.

Referenced by yao_block(), and yo_block().

◆ yo_block()

static int yo_block ( uint8_t dst,
ptrdiff_t  stride,
uint8_t unused0,
ptrdiff_t  unused1,
const uint8_t block 
)
static

Definition at line 160 of file dxv.c.

Referenced by dxv_decode().

◆ yao_block()

static int yao_block ( uint8_t plane0,
ptrdiff_t  stride0,
uint8_t plane3,
ptrdiff_t  stride1,
const uint8_t block 
)
static

Definition at line 174 of file dxv.c.

Referenced by dxv_decode().

◆ decompress_texture_thread()

static int decompress_texture_thread ( AVCodecContext avctx,
void arg,
int  slice,
int  thread_nb 
)
static

Definition at line 193 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_dxt1()

static int dxv_decompress_dxt1 ( AVCodecContext avctx)
static

Definition at line 288 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 343 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 387 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 428 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 470 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 495 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 735 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 791 of file dxv.c.

Referenced by dxv_decompress_ycg6().

◆ dxv_decompress_ycg6()

static int dxv_decompress_ycg6 ( AVCodecContext avctx)
static

Definition at line 833 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_yg10()

static int dxv_decompress_yg10 ( AVCodecContext avctx)
static

Definition at line 849 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_dxt5()

static int dxv_decompress_dxt5 ( AVCodecContext avctx)
static

Definition at line 866 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_lzf()

static int dxv_decompress_lzf ( AVCodecContext avctx)
static

Definition at line 1023 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decompress_raw()

static int dxv_decompress_raw ( AVCodecContext avctx)
static

Definition at line 1029 of file dxv.c.

Referenced by dxv_decode().

◆ dxv_decode()

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

Definition at line 1041 of file dxv.c.

◆ dxv_init()

static int dxv_init ( AVCodecContext avctx)
static

Definition at line 1231 of file dxv.c.

◆ dxv_close()

static int dxv_close ( AVCodecContext avctx)
static

Definition at line 1251 of file dxv.c.

Variable Documentation

◆ ff_dxv_decoder

AVCodec ff_dxv_decoder
Initial value:
= {
.name = "dxv",
.long_name = NULL_IF_CONFIG_SMALL("Resolume DXV"),
.init = dxv_init,
.decode = dxv_decode,
.close = dxv_close,
.priv_data_size = sizeof(DXVContext),
.capabilities = AV_CODEC_CAP_DR1 |
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}

Definition at line 1265 of file dxv.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:40
dxv_init
static int dxv_init(AVCodecContext *avctx)
Definition: dxv.c:1231
x
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
Definition: fate.txt:150
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
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:75
dxv_close
static int dxv_close(AVCodecContext *avctx)
Definition: dxv.c:1251
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:106
bytestream2_get_bytes_left
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:154
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:50
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:186
AV_CODEC_ID_DXV
@ AV_CODEC_ID_DXV
Definition: codec_id.h:240
state
static struct @314 state
AV_CODEC_CAP_SLICE_THREADS
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: codec.h:110
DXVContext
Definition: dxv.c:35
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: internal.h:48
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
dxv_decode
static int dxv_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: dxv.c:1041
pos
unsigned int pos
Definition: spdifenc.c:410
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59