Libav
Data Structures | Macros | Functions | Variables
libopenjpegdec.c File Reference

JPEG 2000 decoder using libopenjpeg. More...

#include <openjpeg.h>
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "internal.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  LibOpenJPEGContext
 

Macros

#define OPJ_STATIC
 
#define JP2_SIG_TYPE   0x6A502020
 
#define JP2_SIG_VALUE   0x0D0A870A
 
#define RGB_PIXEL_FORMATS
 
#define GRAY_PIXEL_FORMATS
 
#define YUV_PIXEL_FORMATS
 
#define XYZ_PIXEL_FORMATS   AV_PIX_FMT_XYZ12
 
#define OFFSET(x)   offsetof(LibOpenJPEGContext, x)
 
#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static int libopenjpeg_matches_pix_fmt (const opj_image_t *img, enum AVPixelFormat pix_fmt)
 
static enum AVPixelFormat libopenjpeg_guess_pix_fmt (const opj_image_t *image)
 
static int libopenjpeg_ispacked (enum AVPixelFormat pix_fmt)
 
static void libopenjpeg_copy_to_packed8 (AVFrame *picture, opj_image_t *image)
 
static void libopenjpeg_copy_to_packed16 (AVFrame *picture, opj_image_t *image)
 
static void libopenjpeg_copyto8 (AVFrame *picture, opj_image_t *image)
 
static void libopenjpeg_copyto16 (AVFrame *p, opj_image_t *image)
 
static av_cold int libopenjpeg_decode_init (AVCodecContext *avctx)
 
static int libopenjpeg_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 

Variables

static enum AVPixelFormat rgb_pix_fmts []
 
static enum AVPixelFormat gray_pix_fmts []
 
static enum AVPixelFormat yuv_pix_fmts []
 
static enum AVPixelFormat any_pix_fmts []
 
static const AVOption options []
 
class {
      class_name = "libopenjpeg"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
AVCodec ff_libopenjpeg_decoder
 

Detailed Description

JPEG 2000 decoder using libopenjpeg.

Definition in file libopenjpegdec.c.

Macro Definition Documentation

§ OPJ_STATIC

#define OPJ_STATIC

Definition at line 27 of file libopenjpegdec.c.

§ JP2_SIG_TYPE

#define JP2_SIG_TYPE   0x6A502020

Definition at line 40 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ JP2_SIG_VALUE

#define JP2_SIG_VALUE   0x0D0A870A

Definition at line 41 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ RGB_PIXEL_FORMATS

#define RGB_PIXEL_FORMATS
Value:
AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:67
#define AV_PIX_FMT_RGBA64
Definition: pixfmt.h:233
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:96

Definition at line 45 of file libopenjpegdec.c.

§ GRAY_PIXEL_FORMATS

#define GRAY_PIXEL_FORMATS
Value:
AV_PIX_FMT_GRAY16
8bit gray, 8bit alpha
Definition: pixfmt.h:144
Y , 8bpp.
Definition: pixfmt.h:73

Definition at line 48 of file libopenjpegdec.c.

§ YUV_PIXEL_FORMATS

#define YUV_PIXEL_FORMATS
Value:
AV_PIX_FMT_YUVA420P, \
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, \
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, \
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, \
AV_PIX_FMT_YUV444P9, \
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, \
AV_PIX_FMT_YUV444P10, \
AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, \
AV_PIX_FMT_YUV444P16
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:70
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:69
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:241
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:71
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:244
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:72
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:247

Definition at line 51 of file libopenjpegdec.c.

§ XYZ_PIXEL_FORMATS

#define XYZ_PIXEL_FORMATS   AV_PIX_FMT_XYZ12

Definition at line 62 of file libopenjpegdec.c.

§ OFFSET

#define OFFSET (   x)    offsetof(LibOpenJPEGContext, x)

Definition at line 413 of file libopenjpegdec.c.

§ VD

Definition at line 414 of file libopenjpegdec.c.

Function Documentation

§ libopenjpeg_matches_pix_fmt()

static int libopenjpeg_matches_pix_fmt ( const opj_image_t *  img,
enum AVPixelFormat  pix_fmt 
)
static

Definition at line 84 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame(), and libopenjpeg_guess_pix_fmt().

§ libopenjpeg_guess_pix_fmt()

static enum AVPixelFormat libopenjpeg_guess_pix_fmt ( const opj_image_t *  image)
static

Definition at line 122 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ libopenjpeg_ispacked()

static int libopenjpeg_ispacked ( enum AVPixelFormat  pix_fmt)
inlinestatic

Definition at line 155 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ libopenjpeg_copy_to_packed8()

static void libopenjpeg_copy_to_packed8 ( AVFrame picture,
opj_image_t *  image 
)
static

Definition at line 170 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ libopenjpeg_copy_to_packed16()

static void libopenjpeg_copy_to_packed16 ( AVFrame picture,
opj_image_t *  image 
)
static

Definition at line 184 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ libopenjpeg_copyto8()

static void libopenjpeg_copyto8 ( AVFrame picture,
opj_image_t *  image 
)
static

Definition at line 202 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ libopenjpeg_copyto16()

static void libopenjpeg_copyto16 ( AVFrame p,
opj_image_t *  image 
)
static

Definition at line 221 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

§ libopenjpeg_decode_init()

static av_cold int libopenjpeg_decode_init ( AVCodecContext avctx)
static

Definition at line 240 of file libopenjpegdec.c.

§ libopenjpeg_decode_frame()

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

Definition at line 248 of file libopenjpegdec.c.

Variable Documentation

§ rgb_pix_fmts

enum AVPixelFormat rgb_pix_fmts[]
static
Initial value:
= {
}
#define RGB_PIXEL_FORMATS

Definition at line 64 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

§ gray_pix_fmts

enum AVPixelFormat gray_pix_fmts[]
static
Initial value:
= {
}
#define GRAY_PIXEL_FORMATS

Definition at line 67 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

§ yuv_pix_fmts

enum AVPixelFormat yuv_pix_fmts[]
static
Initial value:
= {
}
#define YUV_PIXEL_FORMATS

Definition at line 70 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

§ any_pix_fmts

enum AVPixelFormat any_pix_fmts[]
static
Initial value:
= {
}
#define XYZ_PIXEL_FORMATS
#define YUV_PIXEL_FORMATS
#define RGB_PIXEL_FORMATS
#define GRAY_PIXEL_FORMATS

Definition at line 73 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

§ options

const AVOption options[]
static
Initial value:
= {
{ "lowqual", "Limit the number of layers used for decoding",
OFFSET(lowqual), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VD },
{ "lowres", "Lower the decoding resolution by a power of two",
OFFSET(lowres), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VD },
{ NULL },
}
NULL
Definition: eval.c:55
#define VD
#define OFFSET(x)

Definition at line 416 of file libopenjpegdec.c.

§ class_name

class_name = "libopenjpeg"
private

Definition at line 425 of file libopenjpegdec.c.

§ item_name

item_name = av_default_item_name
private

Definition at line 426 of file libopenjpegdec.c.

§ option

option = options
private

Definition at line 427 of file libopenjpegdec.c.

§ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 428 of file libopenjpegdec.c.

§ @34

const { ... }

§ ff_libopenjpeg_decoder

AVCodec ff_libopenjpeg_decoder
Initial value:
= {
.name = "libopenjpeg",
.long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
.priv_data_size = sizeof(LibOpenJPEGContext),
.priv_class = &class,
}
static int libopenjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:275
static av_cold int libopenjpeg_decode_init(AVCodecContext *avctx)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:684
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:145
#define CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:755
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:499

Definition at line 431 of file libopenjpegdec.c.