FFmpeg
Data Structures | Macros | Functions | Variables
qtrle.c File Reference
#include <string.h>
#include "avcodec.h"
#include "decode.h"
#include "bytestream.h"
#include "codec_internal.h"

Go to the source code of this file.

Data Structures

struct  QtrleContext
 

Macros

#define CHECK_PIXEL_PTR(n)
 

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, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
static void qtrle_decode_flush (AVCodecContext *avctx)
 
static av_cold int qtrle_decode_end (AVCodecContext *avctx)
 

Variables

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

◆ CHECK_PIXEL_PTR

#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); \
return; \
} \

Definition at line 49 of file qtrle.c.

Function Documentation

◆ qtrle_decode_1bpp()

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

Definition at line 56 of file qtrle.c.

Referenced by qtrle_decode_frame().

◆ qtrle_decode_2n4bpp()

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

Definition at line 141 of file qtrle.c.

Referenced by qtrle_decode_frame().

◆ qtrle_decode_8bpp()

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

Definition at line 200 of file qtrle.c.

Referenced by qtrle_decode_frame().

◆ qtrle_decode_16bpp()

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

Definition at line 251 of file qtrle.c.

Referenced by qtrle_decode_frame().

◆ qtrle_decode_24bpp()

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

Definition at line 297 of file qtrle.c.

Referenced by qtrle_decode_frame().

◆ qtrle_decode_32bpp()

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

Definition at line 353 of file qtrle.c.

Referenced by qtrle_decode_frame().

◆ qtrle_decode_init()

static av_cold int qtrle_decode_init ( AVCodecContext avctx)
static

Definition at line 404 of file qtrle.c.

◆ qtrle_decode_frame()

static int qtrle_decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 446 of file qtrle.c.

◆ qtrle_decode_flush()

static void qtrle_decode_flush ( AVCodecContext avctx)
static

Definition at line 572 of file qtrle.c.

◆ qtrle_decode_end()

static av_cold int qtrle_decode_end ( AVCodecContext avctx)
static

Definition at line 579 of file qtrle.c.

Variable Documentation

◆ ff_qtrle_decoder

const FFCodec ff_qtrle_decoder
Initial value:
= {
.p.name = "qtrle",
CODEC_LONG_NAME("QuickTime Animation (RLE) video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(QtrleContext),
.close = qtrle_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 588 of file qtrle.c.

qtrle_decode_frame
static int qtrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: qtrle.c:446
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
s
#define s(width, name)
Definition: cbs_vp9.c:198
qtrle_decode_init
static av_cold int qtrle_decode_init(AVCodecContext *avctx)
Definition: qtrle.c:404
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
QtrleContext
Definition: qtrle.c:41
qtrle_decode_flush
static void qtrle_decode_flush(AVCodecContext *avctx)
Definition: qtrle.c:572
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_QTRLE
@ AV_CODEC_ID_QTRLE
Definition: codec_id.h:107
qtrle_decode_end
static av_cold int qtrle_decode_end(AVCodecContext *avctx)
Definition: qtrle.c:579