FFmpeg
Data Structures | Macros | Functions | Variables
tscc2.c File Reference
#include <inttypes.h>
#include "libavutil/mem.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "mathops.h"
#include "tscc2data.h"

Go to the source code of this file.

Data Structures

struct  TSCC2Context
 

Macros

#define BITSTREAM_READER_LE
 
#define TSCC2_VLC_BITS   9
 
#define DEQUANT(val, q)   (((q) * (val) + 0x80) >> 8)
 
#define DCT1D(d0, d1, d2, d3, s0, s1, s2, s3, OP)
 
#define COL_OP(a, b)   a = (b)
 
#define ROW_OP(a, b)   a = ((b) + 0x20) >> 6
 

Functions

static av_cold void tscc2_init_vlc (VLC *vlc, int *offset, int nb_codes, const uint8_t *lens, const void *syms, int sym_length)
 
static av_cold void tscc2_init_vlcs (void)
 
static void tscc2_idct4_put (int *in, int q[3], uint8_t *dst, int stride)
 
static int tscc2_decode_mb (TSCC2Context *c, int *q, int vlc_set, uint8_t *dst, int stride, int plane)
 
static int tscc2_decode_slice (TSCC2Context *c, int mb_y, const uint8_t *buf, int buf_size)
 
static int tscc2_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
static av_cold int tscc2_decode_end (AVCodecContext *avctx)
 
static av_cold int tscc2_decode_init (AVCodecContext *avctx)
 

Variables

static VLC dc_vlc
 
static VLC nc_vlc [NUM_VLC_SETS]
 
static VLC ac_vlc [NUM_VLC_SETS]
 
const FFCodec ff_tscc2_decoder
 

Detailed Description

TechSmith Screen Codec 2 decoder

Definition in file tscc2.c.

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 32 of file tscc2.c.

◆ TSCC2_VLC_BITS

#define TSCC2_VLC_BITS   9

Definition at line 41 of file tscc2.c.

◆ DEQUANT

#define DEQUANT (   val,
 
)    (((q) * (val) + 0x80) >> 8)

Definition at line 91 of file tscc2.c.

◆ DCT1D

#define DCT1D (   d0,
  d1,
  d2,
  d3,
  s0,
  s1,
  s2,
  s3,
  OP 
)
Value:
OP(d0, 5 * ((s0) + (s1) + (s2)) + 2 * (s3)); \
OP(d1, 5 * ((s0) - (s2) - (s3)) + 2 * (s1)); \
OP(d2, 5 * ((s0) - (s2) + (s3)) - 2 * (s1)); \
OP(d3, 5 * ((s0) - (s1) + (s2)) - 2 * (s3)); \

Definition at line 92 of file tscc2.c.

◆ COL_OP

#define COL_OP (   a,
  b 
)    a = (b)

Definition at line 98 of file tscc2.c.

◆ ROW_OP

#define ROW_OP (   a,
  b 
)    a = ((b) + 0x20) >> 6

Definition at line 99 of file tscc2.c.

Function Documentation

◆ tscc2_init_vlc()

static av_cold void tscc2_init_vlc ( VLC vlc,
int *  offset,
int  nb_codes,
const uint8_t *  lens,
const void *  syms,
int  sym_length 
)
static

Definition at line 57 of file tscc2.c.

Referenced by tscc2_init_vlcs().

◆ tscc2_init_vlcs()

static av_cold void tscc2_init_vlcs ( void  )
static

Definition at line 71 of file tscc2.c.

Referenced by tscc2_decode_init().

◆ tscc2_idct4_put()

static void tscc2_idct4_put ( int *  in,
int  q[3],
uint8_t *  dst,
int  stride 
)
static

Definition at line 101 of file tscc2.c.

Referenced by tscc2_decode_mb().

◆ tscc2_decode_mb()

static int tscc2_decode_mb ( TSCC2Context c,
int *  q,
int  vlc_set,
uint8_t *  dst,
int  stride,
int  plane 
)
static

Definition at line 124 of file tscc2.c.

Referenced by tscc2_decode_slice().

◆ tscc2_decode_slice()

static int tscc2_decode_slice ( TSCC2Context c,
int  mb_y,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 183 of file tscc2.c.

Referenced by tscc2_decode_frame().

◆ tscc2_decode_frame()

static int tscc2_decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 209 of file tscc2.c.

◆ tscc2_decode_end()

static av_cold int tscc2_decode_end ( AVCodecContext avctx)
static

Definition at line 324 of file tscc2.c.

◆ tscc2_decode_init()

static av_cold int tscc2_decode_init ( AVCodecContext avctx)
static

Definition at line 334 of file tscc2.c.

Variable Documentation

◆ dc_vlc

VLC dc_vlc
static

Definition at line 55 of file tscc2.c.

Referenced by tscc2_decode_mb(), and tscc2_init_vlcs().

◆ nc_vlc

VLC nc_vlc[NUM_VLC_SETS]
static

Definition at line 55 of file tscc2.c.

Referenced by tscc2_decode_mb(), and tscc2_init_vlcs().

◆ ac_vlc

VLC ac_vlc[NUM_VLC_SETS]
static

Definition at line 55 of file tscc2.c.

Referenced by tscc2_decode_mb(), and tscc2_init_vlcs().

◆ ff_tscc2_decoder

const FFCodec ff_tscc2_decoder
Initial value:
= {
.p.name = "tscc2",
CODEC_LONG_NAME("TechSmith Screen Codec 2"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(TSCC2Context),
.close = tscc2_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 360 of file tscc2.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:43
tscc2_decode_init
static av_cold int tscc2_decode_init(AVCodecContext *avctx)
Definition: tscc2.c:334
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
TSCC2Context
Definition: tscc2.c:43
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
AV_CODEC_ID_TSCC2
@ AV_CODEC_ID_TSCC2
Definition: codec_id.h:216
OP
#define OP(gb, pixel, count)
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
tscc2_decode_end
static av_cold int tscc2_decode_end(AVCodecContext *avctx)
Definition: tscc2.c:324
tscc2_decode_frame
static int tscc2_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: tscc2.c:209