FFmpeg
Loading...
Searching...
No Matches
tdsc.c File Reference

TDSC decoder. More...

#include <stdint.h>
#include <zlib.h>
#include "libavutil/attributes_internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.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)
 

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

Referenced by tdsc_parse_tdsf().

◆ TDSF_HEADER_SIZE

#define TDSF_HEADER_SIZE   0x56

Definition at line 49 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ TDSB_HEADER_SIZE

#define TDSB_HEADER_SIZE   0x08

Definition at line 50 of file tdsc.c.

Referenced by tdsc_decode_tiles().

◆ APPLY_ALPHA

#define APPLY_ALPHA ( src,
new,
alpha )
Value:
src = (src * (256 - alpha) + new * alpha) >> 8
static const int16_t alpha[]
Definition ilbcdata.h:55
#define src
Definition vp8dsp.c:248

Definition at line 141 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 75 of file tdsc.c.

Function Documentation

◆ tdsc_close()

static av_cold int tdsc_close ( AVCodecContext * avctx)
static

Definition at line 81 of file tdsc.c.

◆ tdsc_init()

static av_cold int tdsc_init ( AVCodecContext * avctx)
static

Definition at line 96 of file tdsc.c.

◆ tdsc_paint_cursor()

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

Definition at line 145 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_load_cursor()

static int tdsc_load_cursor ( AVCodecContext * avctx)
static

Definition at line 199 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 388 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 459 of file tdsc.c.

Referenced by tdsc_decode_frame().

◆ tdsc_parse_dtsm()

static int tdsc_parse_dtsm ( AVCodecContext * avctx)
static

Definition at line 506 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 533 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,
}
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_TDSC
Definition codec_id.h:236
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int tdsc_close(AVCodecContext *avctx)
Definition tdsc.c:81
static int tdsc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition tdsc.c:533
static av_cold int tdsc_init(AVCodecContext *avctx)
Definition tdsc.c:96

Definition at line 632 of file tdsc.c.