FFmpeg
Macros | Typedefs | Functions | Variables
dxtory.c File Reference
#include <inttypes.h>
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "get_bits.h"
#include "unary.h"
#include "thread.h"

Go to the source code of this file.

Macros

#define BITSTREAM_READER_LE
 

Typedefs

typedef int(* decode_slice_func) (GetBitContext *gb, AVFrame *frame, int line, int height, uint8_t lru[3][8])
 
typedef void(* setup_lru_func) (uint8_t lru[3][8])
 

Functions

static int64_t get_raw_size (enum AVPixelFormat fmt, int width, int height)
 
static void do_vflip (AVCodecContext *avctx, AVFrame *pic, int vflip)
 
static int dxtory_decode_v1_rgb (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, int id, int bpp, uint32_t vflipped)
 
static int dxtory_decode_v1_410 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, uint32_t vflipped)
 
static int dxtory_decode_v1_420 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, uint32_t vflipped)
 
static int dxtory_decode_v1_444 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, uint32_t vflipped)
 
static uint8_t decode_sym (GetBitContext *gb, uint8_t lru[8])
 
static int check_slice_size (AVCodecContext *avctx, const uint8_t *src, int src_size, int slice_size, int off)
 
static int load_buffer (AVCodecContext *avctx, const uint8_t *src, int src_size, GetByteContext *gb, int *nslices, int *off)
 
static uint8_t decode_sym_565 (GetBitContext *gb, uint8_t lru[8], int bits)
 
static int dxtory_decode_v2 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, decode_slice_func decode_slice, setup_lru_func setup_lru, enum AVPixelFormat fmt, uint32_t vflipped)
 
static av_always_inline int dx2_decode_slice_5x5 (GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8], int is_565)
 
static void setup_lru_555 (uint8_t lru[3][8])
 
static void setup_lru_565 (uint8_t lru[3][8])
 
static int dx2_decode_slice_555 (GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8])
 
static int dx2_decode_slice_565 (GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8])
 
static int dxtory_decode_v2_565 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, int is_565, uint32_t vflipped)
 
static int dx2_decode_slice_rgb (GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8])
 
static void default_setup_lru (uint8_t lru[3][8])
 
static int dxtory_decode_v2_rgb (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, uint32_t vflipped)
 
static int dx2_decode_slice_410 (GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8])
 
static int dxtory_decode_v2_410 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, uint32_t vflipped)
 
static int dx2_decode_slice_420 (GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8])
 
static int dxtory_decode_v2_420 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, uint32_t vflipped)
 
static int dx2_decode_slice_444 (GetBitContext *gb, AVFrame *frame, int line, int left, uint8_t lru[3][8])
 
static int dxtory_decode_v2_444 (AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, uint32_t vflipped)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt)
 

Variables

static const uint8_t def_lru [8] = { 0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xFF }
 
static const uint8_t def_lru_555 [8] = { 0x00, 0x08, 0x10, 0x18, 0x1F }
 
static const uint8_t def_lru_565 [8] = { 0x00, 0x08, 0x10, 0x20, 0x30, 0x3F }
 
const FFCodec ff_dxtory_decoder
 

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 28 of file dxtory.c.

Typedef Documentation

◆ decode_slice_func

typedef int(* decode_slice_func) (GetBitContext *gb, AVFrame *frame, int line, int height, uint8_t lru[3][8])

Definition at line 417 of file dxtory.c.

◆ setup_lru_func

typedef void(* setup_lru_func) (uint8_t lru[3][8])

Definition at line 420 of file dxtory.c.

Function Documentation

◆ get_raw_size()

static int64_t get_raw_size ( enum AVPixelFormat  fmt,
int  width,
int  height 
)
static

◆ do_vflip()

static void do_vflip ( AVCodecContext avctx,
AVFrame pic,
int  vflip 
)
static

◆ dxtory_decode_v1_rgb()

static int dxtory_decode_v1_rgb ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
int  id,
int  bpp,
uint32_t  vflipped 
)
static

Definition at line 92 of file dxtory.c.

Referenced by decode_frame().

◆ dxtory_decode_v1_410()

static int dxtory_decode_v1_410 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
uint32_t  vflipped 
)
static

Definition at line 123 of file dxtory.c.

Referenced by decode_frame().

◆ dxtory_decode_v1_420()

static int dxtory_decode_v1_420 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
uint32_t  vflipped 
)
static

Definition at line 218 of file dxtory.c.

Referenced by decode_frame().

◆ dxtory_decode_v1_444()

static int dxtory_decode_v1_444 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
uint32_t  vflipped 
)
static

Definition at line 290 of file dxtory.c.

Referenced by decode_frame().

◆ decode_sym()

static uint8_t decode_sym ( GetBitContext gb,
uint8_t  lru[8] 
)
inlinestatic

◆ check_slice_size()

static int check_slice_size ( AVCodecContext avctx,
const uint8_t *  src,
int  src_size,
int  slice_size,
int  off 
)
static

Definition at line 349 of file dxtory.c.

Referenced by dxtory_decode_v2().

◆ load_buffer()

static int load_buffer ( AVCodecContext avctx,
const uint8_t *  src,
int  src_size,
GetByteContext gb,
int nslices,
int off 
)
static

Definition at line 377 of file dxtory.c.

Referenced by dxtory_decode_v2().

◆ decode_sym_565()

static uint8_t decode_sym_565 ( GetBitContext gb,
uint8_t  lru[8],
int  bits 
)
inlinestatic

Definition at line 399 of file dxtory.c.

Referenced by dx2_decode_slice_5x5().

◆ dxtory_decode_v2()

static int dxtory_decode_v2 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
decode_slice_func  decode_slice,
setup_lru_func  setup_lru,
enum AVPixelFormat  fmt,
uint32_t  vflipped 
)
static

◆ dx2_decode_slice_5x5()

static av_always_inline int dx2_decode_slice_5x5 ( GetBitContext gb,
AVFrame frame,
int  line,
int  left,
uint8_t  lru[3][8],
int  is_565 
)
static

Definition at line 487 of file dxtory.c.

Referenced by dx2_decode_slice_555(), and dx2_decode_slice_565().

◆ setup_lru_555()

static void setup_lru_555 ( uint8_t  lru[3][8])
static

Definition at line 513 of file dxtory.c.

Referenced by dxtory_decode_v2_565().

◆ setup_lru_565()

static void setup_lru_565 ( uint8_t  lru[3][8])
static

Definition at line 520 of file dxtory.c.

Referenced by dxtory_decode_v2_565().

◆ dx2_decode_slice_555()

static int dx2_decode_slice_555 ( GetBitContext gb,
AVFrame frame,
int  line,
int  left,
uint8_t  lru[3][8] 
)
static

Definition at line 527 of file dxtory.c.

Referenced by dxtory_decode_v2_565().

◆ dx2_decode_slice_565()

static int dx2_decode_slice_565 ( GetBitContext gb,
AVFrame frame,
int  line,
int  left,
uint8_t  lru[3][8] 
)
static

Definition at line 533 of file dxtory.c.

Referenced by dxtory_decode_v2_565().

◆ dxtory_decode_v2_565()

static int dxtory_decode_v2_565 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
int  is_565,
uint32_t  vflipped 
)
static

Definition at line 539 of file dxtory.c.

Referenced by decode_frame().

◆ dx2_decode_slice_rgb()

static int dx2_decode_slice_rgb ( GetBitContext gb,
AVFrame frame,
int  line,
int  left,
uint8_t  lru[3][8] 
)
static

Definition at line 556 of file dxtory.c.

Referenced by dxtory_decode_v2_rgb().

◆ default_setup_lru()

static void default_setup_lru ( uint8_t  lru[3][8])
static

◆ dxtory_decode_v2_rgb()

static int dxtory_decode_v2_rgb ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
uint32_t  vflipped 
)
static

Definition at line 585 of file dxtory.c.

Referenced by decode_frame().

◆ dx2_decode_slice_410()

static int dx2_decode_slice_410 ( GetBitContext gb,
AVFrame frame,
int  line,
int  left,
uint8_t  lru[3][8] 
)
static

Definition at line 595 of file dxtory.c.

Referenced by dxtory_decode_v2_410().

◆ dxtory_decode_v2_410()

static int dxtory_decode_v2_410 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
uint32_t  vflipped 
)
static

Definition at line 664 of file dxtory.c.

Referenced by decode_frame().

◆ dx2_decode_slice_420()

static int dx2_decode_slice_420 ( GetBitContext gb,
AVFrame frame,
int  line,
int  left,
uint8_t  lru[3][8] 
)
static

Definition at line 674 of file dxtory.c.

Referenced by dxtory_decode_v2_420().

◆ dxtory_decode_v2_420()

static int dxtory_decode_v2_420 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
uint32_t  vflipped 
)
static

Definition at line 736 of file dxtory.c.

Referenced by decode_frame().

◆ dx2_decode_slice_444()

static int dx2_decode_slice_444 ( GetBitContext gb,
AVFrame frame,
int  line,
int  left,
uint8_t  lru[3][8] 
)
static

Definition at line 746 of file dxtory.c.

Referenced by dxtory_decode_v2_444().

◆ dxtory_decode_v2_444()

static int dxtory_decode_v2_444 ( AVCodecContext avctx,
AVFrame pic,
const uint8_t *  src,
int  src_size,
uint32_t  vflipped 
)
static

Definition at line 777 of file dxtory.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame pic,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 787 of file dxtory.c.

Variable Documentation

◆ def_lru

const uint8_t def_lru[8] = { 0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xFF }
static

Definition at line 328 of file dxtory.c.

Referenced by default_setup_lru(), setup_lru_555(), and setup_lru_565().

◆ def_lru_555

const uint8_t def_lru_555[8] = { 0x00, 0x08, 0x10, 0x18, 0x1F }
static

Definition at line 329 of file dxtory.c.

Referenced by setup_lru_555(), and setup_lru_565().

◆ def_lru_565

const uint8_t def_lru_565[8] = { 0x00, 0x08, 0x10, 0x20, 0x30, 0x3F }
static

Definition at line 330 of file dxtory.c.

Referenced by setup_lru_565().

◆ ff_dxtory_decoder

const FFCodec ff_dxtory_decoder
Initial value:
= {
.p.name = "dxtory",
CODEC_LONG_NAME("Dxtory"),
.p.type = AVMEDIA_TYPE_VIDEO,
}

Definition at line 873 of file dxtory.c.

FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:110
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
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt)
Definition: dxtory.c:787
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_DXTORY
@ AV_CODEC_ID_DXTORY
Definition: codec_id.h:208