FFmpeg
Macros | Functions | Variables
pgxdec.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"

Go to the source code of this file.

Macros

#define WRITE_FRAME(D, PIXEL, suffix)
 

Functions

static int pgx_get_number (AVCodecContext *avctx, GetByteContext *g, int *number)
 
static int pgx_decode_header (AVCodecContext *avctx, GetByteContext *g, int *depth, int *width, int *height, int *sign)
 
static int pgx_decode_frame (AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_pgx_decoder
 

Macro Definition Documentation

◆ WRITE_FRAME

#define WRITE_FRAME (   D,
  PIXEL,
  suffix 
)
Value:
static inline void write_frame_ ##D(AVFrame *frame, GetByteContext *g, \
int width, int height, int sign, int depth) \
{ \
const unsigned offset = sign ? (1 << (D - 1)) : 0; \
int i, j; \
for (i = 0; i < height; i++) { \
PIXEL *line = (PIXEL*)(frame->data[0] + i * frame->linesize[0]); \
for (j = 0; j < width; j++) { \
unsigned val = bytestream2_get_ ##suffix##u(g) << (D - depth); \
val ^= offset; \
*(line + j) = val; \
} \
} \
} \

Definition at line 93 of file pgxdec.c.

Function Documentation

◆ pgx_get_number()

static int pgx_get_number ( AVCodecContext avctx,
GetByteContext g,
int number 
)
static

Definition at line 27 of file pgxdec.c.

Referenced by pgx_decode_header().

◆ pgx_decode_header()

static int pgx_decode_header ( AVCodecContext avctx,
GetByteContext g,
int depth,
int width,
int height,
int sign 
)
static

Definition at line 52 of file pgxdec.c.

Referenced by pgx_decode_frame().

◆ pgx_decode_frame()

static int pgx_decode_frame ( AVCodecContext avctx,
AVFrame p,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 112 of file pgxdec.c.

Variable Documentation

◆ ff_pgx_decoder

const FFCodec ff_pgx_decoder
Initial value:
= {
.p.name = "pgx",
CODEC_LONG_NAME("PGX (JPEG2000 Test Format)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_PGX,
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 153 of file pgxdec.c.

GetByteContext
Definition: bytestream.h:33
u
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:250
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:344
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:365
D
D(D(float, sse)
Definition: rematrix_init.c:29
val
static double val(void *priv, double ch)
Definition: aeval.c:78
width
#define width
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
g
const char * g
Definition: vf_curves.c:127
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
frame
static AVFrame * frame
Definition: demux_decode.c:54
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
height
#define height
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
line
Definition: graph2dot.c:48
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
suffix
const char * suffix
Definition: checkasm.c:252
PIXEL
#define PIXEL
Definition: blend_modes.c:44
pgx_decode_frame
static int pgx_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition: pgxdec.c:112
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_PGX
@ AV_CODEC_ID_PGX
Definition: codec_id.h:247
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:389