libavcodec/rl2.c File Reference

RL2 Video Decoder. More...

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

Go to the source code of this file.

Data Structures

struct  Rl2Context

Defines

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

Functions

static void rl2_rle_decode (Rl2Context *s, const unsigned char *in, int size, unsigned char *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 *data_size, AVPacket *avpkt)
static av_cold int rl2_decode_end (AVCodecContext *avctx)
 Uninit decoder.

Variables

AVCodec ff_rl2_decoder


Detailed Description

RL2 Video Decoder.

Author:
Sascha Sommer (saschasommer@freenet.de)
See also:
http://wiki.multimedia.cx/index.php?title=RL2

Definition in file rl2.c.


Define Documentation

#define EXTRADATA1_SIZE   (6 + 256 * 3)

video base, clr count, palette

Definition at line 37 of file rl2.c.

Referenced by rl2_decode_init(), and rl2_read_header().


Function Documentation

static av_cold int rl2_decode_end ( AVCodecContext avctx  )  [static]

Uninit decoder.

Parameters:
avctx decoder context
Returns:
0 success, -1 on error

Definition at line 209 of file rl2.c.

static int rl2_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
AVPacket avpkt 
) [static]

get buffer

run length decode

make the palette available on the way out

report that the buffer was completely consumed

Definition at line 172 of file rl2.c.

static av_cold int rl2_decode_init ( AVCodecContext avctx  )  [static]

Initialize the decoder.

Parameters:
avctx decoder context
Returns:
0 success, -1 on error

parse extra data

get frame_offset

initialize palette

decode background frame if present

Definition at line 129 of file rl2.c.

static void rl2_rle_decode ( Rl2Context s,
const unsigned char *  in,
int  size,
unsigned char *  out,
int  stride,
int  video_base 
) [static]

Run Length Decode a single 320x200 frame.

Parameters:
s rl2 context
in input buffer
size input buffer size
out ouput buffer
stride stride of the output buffer
video_base offset 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 58 of file rl2.c.

Referenced by rl2_decode_frame(), and rl2_decode_init().


Variable Documentation

Initial value:

 {
    .name           = "rl2",
    .type           = AVMEDIA_TYPE_VIDEO,
    .id             = CODEC_ID_RL2,
    .priv_data_size = sizeof(Rl2Context),
    .init           = rl2_decode_init,
    .close          = rl2_decode_end,
    .decode         = rl2_decode_frame,
    .capabilities   = CODEC_CAP_DR1,
    .long_name = NULL_IF_CONFIG_SMALL("RL2 video"),
}

Definition at line 222 of file rl2.c.


Generated on Fri Oct 26 02:43:49 2012 for FFmpeg by  doxygen 1.5.8