FFmpeg
Data Structures | Macros | Functions | Variables
fraps.c File Reference
#include "avcodec.h"
#include "get_bits.h"
#include "huffman.h"
#include "bytestream.h"
#include "bswapdsp.h"
#include "internal.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  FrapsContext
 local variable storage More...
 

Macros

#define FPS_TAG   MKTAG('F', 'P', 'S', 'x')
 
#define VLC_BITS   11
 

Functions

static av_cold int decode_init (AVCodecContext *avctx)
 initializes decoder More...
 
static int huff_cmp (const void *va, const void *vb)
 Comparator - our nodes should ascend by count but with preserved symbol order. More...
 
static int fraps2_decode_plane (FrapsContext *s, uint8_t *dst, int stride, int w, int h, const uint8_t *src, int size, int Uoff, const int step)
 decode Fraps v2 packed plane More...
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_end (AVCodecContext *avctx)
 closes decoder More...
 

Variables

AVCodec ff_fraps_decoder
 

Detailed Description

Lossless Fraps 'FPS1' decoder

Author
Roine Gustafsson (roine at users sf net)
Konstantin Shishkov

Codec algorithm for version 0 is taken from Transcode <www.transcoding.org>

Version 2 files support by Konstantin Shishkov

Definition in file fraps.c.

Macro Definition Documentation

◆ FPS_TAG

#define FPS_TAG   MKTAG('F', 'P', 'S', 'x')

Definition at line 42 of file fraps.c.

◆ VLC_BITS

#define VLC_BITS   11

Definition at line 43 of file fraps.c.

Function Documentation

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

initializes decoder

Parameters
avctxcodec context
Returns
0 on success or negative if fails

Definition at line 61 of file fraps.c.

◆ huff_cmp()

static int huff_cmp ( const void *  va,
const void *  vb 
)
static

Comparator - our nodes should ascend by count but with preserved symbol order.

Definition at line 77 of file fraps.c.

Referenced by fraps2_decode_plane().

◆ fraps2_decode_plane()

static int fraps2_decode_plane ( FrapsContext s,
uint8_t dst,
int  stride,
int  w,
int  h,
const uint8_t src,
int  size,
int  Uoff,
const int  step 
)
static

decode Fraps v2 packed plane

Definition at line 86 of file fraps.c.

Referenced by decode_frame().

◆ decode_frame()

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

Fraps v2 is Huffman-coded YUV420 planes Fraps v4 is virtually the same

Definition at line 132 of file fraps.c.

◆ decode_end()

static av_cold int decode_end ( AVCodecContext avctx)
static

closes decoder

Parameters
avctxcodec context
Returns
0 on success or negative if fails

Definition at line 332 of file fraps.c.

Variable Documentation

◆ ff_fraps_decoder

AVCodec ff_fraps_decoder
Initial value:
= {
.name = "fraps",
.long_name = NULL_IF_CONFIG_SMALL("Fraps"),
.priv_data_size = sizeof(FrapsContext),
.close = decode_end,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 341 of file fraps.c.

FF_CODEC_CAP_INIT_THREADSAFE
#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
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
closes decoder
Definition: fraps.c:332
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: fraps.c:132
FrapsContext
local variable storage
Definition: fraps.c:48
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:106
AV_CODEC_ID_FRAPS
@ AV_CODEC_ID_FRAPS
Definition: codec_id.h:125
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:50
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
initializes decoder
Definition: fraps.c:61
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201