FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
tdsc.c File Reference
#include <stdint.h>
#include <zlib.h>
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"

Go to the source code of this file.

Data Structures

struct  TDSCContext
 

Macros

#define BITMAPINFOHEADER_SIZE   0x28
 
#define TDSF_HEADER_SIZE   0x56
 
#define TDSB_HEADER_SIZE   0x08
 
#define APPLY_ALPHA(src, new, alpha)   src = (src * (256 - alpha) + new * alpha) >> 8
 

Enumerations

enum  TDSCCursorFormat { CUR_FMT_MONO = 0x01010004, CUR_FMT_BGRA = 0x20010004, CUR_FMT_RGBA = 0x20010008 }
 

Functions

static av_cold int tdsc_close (AVCodecContext *avctx)
 
static av_cold int tdsc_init (AVCodecContext *avctx)
 
static void tdsc_paint_cursor (AVCodecContext *avctx, uint8_t *dst, int stride)
 
static int tdsc_load_cursor (AVCodecContext *avctx)
 
static void tdsc_yuv2rgb (uint8_t *out, int Y, int U, int V)
 
static av_always_inline void tdsc_blit (uint8_t *dst, int dst_stride, const uint8_t *srcy, int srcy_stride, const uint8_t *srcu, const uint8_t *srcv, int srcuv_stride, int width, int height)
 
static int tdsc_decode_jpeg_tile (AVCodecContext *avctx, int tile_size, int x, int y, int w, int h)
 
static int tdsc_decode_tiles (AVCodecContext *avctx, int number_tiles)
 
static int tdsc_parse_tdsf (AVCodecContext *avctx, int number_tiles)
 
static int tdsc_parse_dtsm (AVCodecContext *avctx)
 
static int tdsc_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_tdsc_decoder
 

Detailed Description

TDSC decoder

Fourcc: TSDC

TDSC is very simple. It codes picture by tiles, storing them in raw BGR24 format or compressing them in JPEG. Frames can be full pictures or just updates to the previous frame. Cursor is found in its own frame or at the bottom of the picture. Every frame is then packed with zlib.

Supports: BGR24

Definition in file tdsc.c.

Macro Definition Documentation

◆ BITMAPINFOHEADER_SIZE

#define BITMAPINFOHEADER_SIZE   0x28

Definition at line 46 of file tdsc.c.

◆ TDSF_HEADER_SIZE

#define TDSF_HEADER_SIZE   0x56

Definition at line 47 of file tdsc.c.

◆ TDSB_HEADER_SIZE

#define TDSB_HEADER_SIZE   0x08

Definition at line 48 of file tdsc.c.

◆ APPLY_ALPHA

#define APPLY_ALPHA (   src,
  new,
  alpha 
)    src = (src * (256 - alpha) + new * alpha) >> 8

Definition at line 142 of file tdsc.c.

Enumeration Type Documentation

◆ TDSCCursorFormat

Enumerator
CUR_FMT_MONO 
CUR_FMT_BGRA 
CUR_FMT_RGBA 

Definition at line 73 of file tdsc.c.

Function Documentation

◆ tdsc_close()

static av_cold int tdsc_close ( AVCodecContext avctx)
static

Definition at line 79 of file tdsc.c.

◆ tdsc_init()

static av_cold int tdsc_init ( AVCodecContext avctx)
static

Definition at line 94 of file tdsc.c.

◆ tdsc_paint_cursor()

static void tdsc_paint_cursor ( AVCodecContext avctx,
uint8_t *  dst,
int  stride 
)
static

Definition at line 146 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_load_cursor()

static int tdsc_load_cursor ( AVCodecContext avctx)
static

Definition at line 191 of file tdsc.c.

Referenced by tdsc_parse_dtsm().

◆ tdsc_yuv2rgb()

static void tdsc_yuv2rgb ( uint8_t *  out,
int  Y,
int  U,
int  V 
)
inlinestatic

Definition at line 318 of file tdsc.c.

Referenced by tdsc_blit().

◆ tdsc_blit()

static av_always_inline void tdsc_blit ( uint8_t *  dst,
int  dst_stride,
const uint8_t *  srcy,
int  srcy_stride,
const uint8_t *  srcu,
const uint8_t *  srcv,
int  srcuv_stride,
int  width,
int  height 
)
static

Definition at line 326 of file tdsc.c.

Referenced by tdsc_decode_jpeg_tile().

◆ tdsc_decode_jpeg_tile()

static int tdsc_decode_jpeg_tile ( AVCodecContext avctx,
int  tile_size,
int  x,
int  y,
int  w,
int  h 
)
static

Definition at line 345 of file tdsc.c.

Referenced by tdsc_decode_tiles().

◆ tdsc_decode_tiles()

static int tdsc_decode_tiles ( AVCodecContext avctx,
int  number_tiles 
)
static

Definition at line 387 of file tdsc.c.

Referenced by tdsc_parse_tdsf().

◆ tdsc_parse_tdsf()

static int tdsc_parse_tdsf ( AVCodecContext avctx,
int  number_tiles 
)
static

Definition at line 455 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_parse_dtsm()

static int tdsc_parse_dtsm ( AVCodecContext avctx)
static

Definition at line 498 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_decode_frame()

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

Definition at line 525 of file tdsc.c.

Variable Documentation

◆ ff_tdsc_decoder

const FFCodec ff_tdsc_decoder
Initial value:
= {
.p.name = "tdsc",
CODEC_LONG_NAME("TDSC"),
.p.type = AVMEDIA_TYPE_VIDEO,
.init = tdsc_init,
.close = tdsc_close,
.priv_data_size = sizeof(TDSCContext),
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 624 of file tdsc.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:42
tdsc_decode_frame
static int tdsc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: tdsc.c:525
tdsc_init
static av_cold int tdsc_init(AVCodecContext *avctx)
Definition: tdsc.c:94
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_ID_TDSC
@ AV_CODEC_ID_TDSC
Definition: codec_id.h:239
TDSCContext
Definition: tdsc.c:50
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
tdsc_close
static av_cold int tdsc_close(AVCodecContext *avctx)
Definition: tdsc.c:79