All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
rl2.c File Reference

RL2 Video Decoder. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  Rl2Context


#define EXTRADATA1_SIZE   (6 + 256 * 3)
 video base, clr count, palette


static void rl2_rle_decode (Rl2Context *s, const uint8_t *in, int size, uint8_t *out, int stride, int video_base)
 Run Length Decode a single 320x200 frame.
static av_cold int rl2_decode_init (AVCodecContext *avctx)
 Initialize the decoder.
static int rl2_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int rl2_decode_end (AVCodecContext *avctx)
 Uninit decoder.


AVCodec ff_rl2_decoder

Detailed Description

RL2 Video Decoder.

Sascha Sommer (sasch.nosp@m.asom.nosp@m.mer@f.nosp@m.reen.nosp@m.et.de)
See Also

Definition in file rl2.c.

Macro Definition Documentation

#define EXTRADATA1_SIZE   (6 + 256 * 3)

video base, clr count, palette

Definition at line 40 of file rl2.c.

Referenced by rl2_decode_init().

Function Documentation

static void rl2_rle_decode ( Rl2Context s,
const uint8_t in,
int  size,
uint8_t out,
int  stride,
int  video_base 

Run Length Decode a single 320x200 frame.

srl2 context
ininput buffer
sizeinput buffer size
outoutput buffer
stridestride of the output buffer
video_baseoffset of the rle data inside the frame

copy start of the background frame

decode the variable part of the frame

copy the rest from the background frame

Definition at line 61 of file rl2.c.

Referenced by rl2_decode_frame(), and rl2_decode_init().

static av_cold int rl2_decode_init ( AVCodecContext avctx)

Initialize the decoder.

avctxdecoder context
0 success, -1 on error

parse extra data

get frame_offset

initialize palette

decode background frame if present

Definition at line 133 of file rl2.c.

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

get buffer

run length decode

make the palette available on the way out

report that the buffer was completely consumed

Definition at line 177 of file rl2.c.

static av_cold int rl2_decode_end ( AVCodecContext avctx)

Uninit decoder.

avctxdecoder context
0 success, -1 on error

Definition at line 215 of file rl2.c.

Variable Documentation

AVCodec ff_rl2_decoder
Initial value:
= {
.name = "rl2",
.priv_data_size = sizeof(Rl2Context),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("RL2 video"),

Definition at line 228 of file rl2.c.