FFmpeg
Data Structures | Functions | Variables
screenpresso.c File Reference
#include <stdint.h>
#include <string.h>
#include <zlib.h>
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ScreenpressoContext
 

Functions

static av_cold int screenpresso_close (AVCodecContext *avctx)
 
static av_cold int screenpresso_init (AVCodecContext *avctx)
 
static void sum_delta_flipped (uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
 
static int screenpresso_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_screenpresso_decoder
 

Detailed Description

Screenpresso decoder

Fourcc: SPV1

Screenpresso simply horizontally flips and then deflates frames, alternating full pictures and deltas. Deltas are related to the currently rebuilt frame (not the reference), and since there is no coordinate system they contain exactly as many pixel as the keyframe.

Supports: BGR0, BGR24, RGB555

Definition in file screenpresso.c.

Function Documentation

◆ screenpresso_close()

static av_cold int screenpresso_close ( AVCodecContext avctx)
static

Definition at line 56 of file screenpresso.c.

◆ screenpresso_init()

static av_cold int screenpresso_init ( AVCodecContext avctx)
static

Definition at line 66 of file screenpresso.c.

◆ sum_delta_flipped()

static void sum_delta_flipped ( uint8_t *  dst,
int  dst_linesize,
const uint8_t *  src,
int  src_linesize,
int  bytewidth,
int  height 
)
static

Definition at line 92 of file screenpresso.c.

Referenced by screenpresso_decode_frame().

◆ screenpresso_decode_frame()

static int screenpresso_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 105 of file screenpresso.c.

Variable Documentation

◆ ff_screenpresso_decoder

const FFCodec ff_screenpresso_decoder
Initial value:
= {
.p.name = "screenpresso",
.p.long_name = NULL_IF_CONFIG_SMALL("Screenpresso"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(ScreenpressoContext),
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}

Definition at line 186 of file screenpresso.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:39
AV_CODEC_ID_SCREENPRESSO
@ AV_CODEC_ID_SCREENPRESSO
Definition: codec_id.h:242
ScreenpressoContext
Definition: screenpresso.c:48
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:254
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
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:116
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: codec_internal.h:31
screenpresso_decode_frame
static int screenpresso_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: screenpresso.c:105
screenpresso_init
static av_cold int screenpresso_init(AVCodecContext *avctx)
Definition: screenpresso.c:66
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
screenpresso_close
static av_cold int screenpresso_close(AVCodecContext *avctx)
Definition: screenpresso.c:56