qtrle.c File Reference

QT RLE Video Decoder by Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t) For more information about the QT RLE format, visit: http://www.pcisys.net/~melanson/codecs/. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
Include dependency graph for qtrle.c:

Go to the source code of this file.

Data Structures

struct  QtrleContext
 

Macros

#define CHECK_PIXEL_PTR(n)
 

Typedefs

typedef struct QtrleContext QtrleContext
 

Functions

static void qtrle_decode_1bpp (QtrleContext *s, int row_ptr, int lines_to_change)
 
static void qtrle_decode_2n4bpp (QtrleContext *s, int row_ptr, int lines_to_change, int bpp)
 
static void qtrle_decode_8bpp (QtrleContext *s, int row_ptr, int lines_to_change)
 
static void qtrle_decode_16bpp (QtrleContext *s, int row_ptr, int lines_to_change)
 
static void qtrle_decode_24bpp (QtrleContext *s, int row_ptr, int lines_to_change)
 
static void qtrle_decode_32bpp (QtrleContext *s, int row_ptr, int lines_to_change)
 
static av_cold int qtrle_decode_init (AVCodecContext *avctx)
 
static int qtrle_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int qtrle_decode_end (AVCodecContext *avctx)
 

Variables

AVCodec ff_qtrle_decoder
 

Detailed Description

QT RLE Video Decoder by Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t) For more information about the QT RLE format, visit: http://www.pcisys.net/~melanson/codecs/.

The QT RLE decoder has seven modes of operation: 1, 2, 4, 8, 16, 24, and 32 bits per pixel. For modes 1, 2, 4, and 8 the decoder outputs PAL8 colorspace data. 16-bit data yields RGB555 data. 24-bit data is RGB24 and 32-bit data is RGB32.

Definition in file qtrle.c.

Macro Definition Documentation

#define CHECK_PIXEL_PTR (   n)
Value:
if ((pixel_ptr + n > pixel_limit) || (pixel_ptr + n < 0)) { \
av_log (s->avctx, AV_LOG_ERROR, "Problem: pixel_ptr = %d, pixel_limit = %d\n",\
pixel_ptr + n, pixel_limit); \
} \
const char * s
Definition: avisynth_c.h:668
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:148
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return

Definition at line 50 of file qtrle.c.

Referenced by qtrle_decode_16bpp(), qtrle_decode_1bpp(), qtrle_decode_24bpp(), qtrle_decode_2n4bpp(), qtrle_decode_32bpp(), and qtrle_decode_8bpp().

Typedef Documentation

typedef struct QtrleContext QtrleContext

Function Documentation

static void qtrle_decode_16bpp ( QtrleContext s,
int  row_ptr,
int  lines_to_change 
)
static

Definition at line 226 of file qtrle.c.

Referenced by qtrle_decode_frame().

static void qtrle_decode_1bpp ( QtrleContext s,
int  row_ptr,
int  lines_to_change 
)
static

Definition at line 57 of file qtrle.c.

Referenced by qtrle_decode_frame().

static void qtrle_decode_24bpp ( QtrleContext s,
int  row_ptr,
int  lines_to_change 
)
static

Definition at line 270 of file qtrle.c.

Referenced by qtrle_decode_frame().

static void qtrle_decode_2n4bpp ( QtrleContext s,
int  row_ptr,
int  lines_to_change,
int  bpp 
)
inlinestatic

Definition at line 119 of file qtrle.c.

Referenced by qtrle_decode_frame().

static void qtrle_decode_32bpp ( QtrleContext s,
int  row_ptr,
int  lines_to_change 
)
static

Definition at line 317 of file qtrle.c.

Referenced by qtrle_decode_frame().

static void qtrle_decode_8bpp ( QtrleContext s,
int  row_ptr,
int  lines_to_change 
)
static

Definition at line 176 of file qtrle.c.

Referenced by qtrle_decode_frame().

static av_cold int qtrle_decode_end ( AVCodecContext avctx)
static

Definition at line 507 of file qtrle.c.

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

Definition at line 404 of file qtrle.c.

static av_cold int qtrle_decode_init ( AVCodecContext avctx)
static

Definition at line 361 of file qtrle.c.

Variable Documentation

AVCodec ff_qtrle_decoder
Initial value:
= {
.name = "qtrle",
.priv_data_size = sizeof(QtrleContext),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static av_cold int qtrle_decode_init(AVCodecContext *avctx)
Definition: qtrle.c:361
struct QtrleContext QtrleContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static int qtrle_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: qtrle.c:404
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
static av_cold int qtrle_decode_end(AVCodecContext *avctx)
Definition: qtrle.c:507

Definition at line 516 of file qtrle.c.