FFmpeg  4.4
Macros | Functions | Variables
pgxdec.c File Reference
#include "avcodec.h"
#include "internal.h"
#include "bytestream.h"
#include "libavutil/imgutils.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, void *data, int *got_frame, AVPacket *avpkt)
 

Variables

AVCodec 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) \
{ \
int i, j; \
for (i = 0; i < height; i++) { \
PIXEL *line = (PIXEL*)frame->data[0] + i*frame->linesize[0]/sizeof(PIXEL); \
for (j = 0; j < width; j++) { \
unsigned val; \
if (sign) \
val = (PIXEL)bytestream2_get_ ##suffix(g) + (1 << (depth - 1)); \
else \
val = bytestream2_get_ ##suffix(g); \
val <<= (D - depth); \
*(line + j) = val; \
} \
} \
} \
static double val(void *priv, double ch)
Definition: aeval.c:76
const char * suffix
Definition: checkasm.c:208
static AVFrame * frame
int i
Definition: input.c:407
D(D(float, sse)
Definition: rematrix_init.c:28
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:332
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:349
Definition: graph2dot.c:48
#define height
#define width
#define PIXEL(img, x, y, w, h, stride, def)
Definition: transform.c:36
const char * g
Definition: vf_curves.c:117

Definition at line 97 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,
void data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 119 of file pgxdec.c.

Variable Documentation

◆ ff_pgx_decoder

AVCodec ff_pgx_decoder
Initial value:
= {
.name = "pgx",
.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"),
.decode = pgx_decode_frame,
.capabilities = 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
@ AV_CODEC_ID_PGX
Definition: codec_id.h:244
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
static int pgx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: pgxdec.c:119

Definition at line 161 of file pgxdec.c.