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

Lossless Fraps 'FPS1' decoder. More...

#include "config.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "get_bits.h"
#include "huffman.h"
#include "bytestream.h"
#include "bswapdsp.h"
#include "codec_internal.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  FrapsContext
 local variable storage More...
 

Macros

#define CACHED_BITSTREAM_READER   HAVE_FAST_64BIT
 
#define UNCHECKED_BITSTREAM_READER   1
 
#define FPS_TAG   MKTAG('F', 'P', 'S', 'x')
 
#define VLC_BITS   11
 

Functions

static av_cold int decode_init (AVCodecContext *avctx)
 initializes decoder
 
static int huff_cmp (const void *va, const void *vb)
 Comparator - our nodes should ascend by count but with preserved symbol order.
 
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
 
static int decode_frame (AVCodecContext *avctx, AVFrame *f, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_end (AVCodecContext *avctx)
 closes decoder
 

Variables

const FFCodec 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

◆ CACHED_BITSTREAM_READER

#define CACHED_BITSTREAM_READER   HAVE_FAST_64BIT

Definition at line 36 of file fraps.c.

◆ UNCHECKED_BITSTREAM_READER

#define UNCHECKED_BITSTREAM_READER   1

Definition at line 37 of file fraps.c.

◆ FPS_TAG

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

Definition at line 47 of file fraps.c.

Referenced by decode_frame().

◆ VLC_BITS

#define VLC_BITS   11

Definition at line 48 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 65 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 81 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 90 of file fraps.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext * avctx,
AVFrame * f,
int * got_frame,
AVPacket * avpkt )
static

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

Definition at line 136 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 328 of file fraps.c.

Variable Documentation

◆ ff_fraps_decoder

const FFCodec ff_fraps_decoder
Initial value:
= {
.p.name = "fraps",
CODEC_LONG_NAME("Fraps"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(FrapsContext),
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition codec.h:98
@ AV_CODEC_ID_FRAPS
Definition codec_id.h:126
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int decode_init(AVCodecContext *avctx)
Definition 4xm.c:998
static av_cold int decode_end(AVCodecContext *avctx)
Definition 4xm.c:980
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition 4xm.c:837
local variable storage
Definition fraps.c:53

Definition at line 336 of file fraps.c.