FFmpeg  4.0
Data Structures | Macros | Enumerations | Functions | Variables
tdsc.c File Reference

TDSC decoder. More...

#include <stdint.h>
#include <zlib.h>
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.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, void *data, int *got_frame, AVPacket *avpkt)
 

Variables

AVCodec 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 45 of file tdsc.c.

Referenced by tdsc_parse_tdsf().

◆ TDSF_HEADER_SIZE

#define TDSF_HEADER_SIZE   0x56

Definition at line 46 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ TDSB_HEADER_SIZE

#define TDSB_HEADER_SIZE   0x08

Definition at line 47 of file tdsc.c.

Referenced by tdsc_decode_tiles().

◆ APPLY_ALPHA

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

Definition at line 138 of file tdsc.c.

Referenced by tdsc_paint_cursor().

Enumeration Type Documentation

◆ TDSCCursorFormat

Enumerator
CUR_FMT_MONO 
CUR_FMT_BGRA 
CUR_FMT_RGBA 

Definition at line 71 of file tdsc.c.

Function Documentation

◆ tdsc_close()

static av_cold int tdsc_close ( AVCodecContext avctx)
static

Definition at line 77 of file tdsc.c.

◆ tdsc_init()

static av_cold int tdsc_init ( AVCodecContext avctx)
static

Definition at line 91 of file tdsc.c.

◆ tdsc_paint_cursor()

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

Definition at line 142 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_load_cursor()

static int tdsc_load_cursor ( AVCodecContext avctx)
static

Definition at line 187 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 314 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 322 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 341 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 384 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 453 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_parse_dtsm()

static int tdsc_parse_dtsm ( AVCodecContext avctx)
static

Definition at line 496 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_decode_frame()

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

Definition at line 523 of file tdsc.c.

Variable Documentation

◆ ff_tdsc_decoder

AVCodec ff_tdsc_decoder
Initial value:
= {
.name = "tdsc",
.long_name = NULL_IF_CONFIG_SMALL("TDSC"),
.init = tdsc_init,
.decode = tdsc_decode_frame,
.close = tdsc_close,
.priv_data_size = sizeof(TDSCContext),
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}
#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
static av_cold int tdsc_init(AVCodecContext *avctx)
Definition: tdsc.c:91
#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
static av_cold int tdsc_close(AVCodecContext *avctx)
Definition: tdsc.c:77
static int tdsc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: tdsc.c:523
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959

Definition at line 618 of file tdsc.c.