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/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixfmt.h"
#include "libavutil/opt.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 [] = {RGB_PIXEL_FORMATS}
static enum AVPixelFormat gray_pix_fmts [] = {GRAY_PIXEL_FORMATS}
static enum AVPixelFormat yuv_pix_fmts [] = {YUV_PIXEL_FORMATS}
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

#define OPJ_STATIC

Definition at line 27 of file libopenjpegdec.c.

#define JP2_SIG_TYPE   0x6A502020

Definition at line 39 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

#define JP2_SIG_VALUE   0x0D0A870A

Definition at line 40 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

#define RGB_PIXEL_FORMATS
Value:
AV_PIX_FMT_RGB48

Definition at line 44 of file libopenjpegdec.c.

#define GRAY_PIXEL_FORMATS
Value:
AV_PIX_FMT_GRAY16

Definition at line 47 of file libopenjpegdec.c.

#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

Definition at line 50 of file libopenjpegdec.c.

#define XYZ_PIXEL_FORMATS   AV_PIX_FMT_XYZ12

Definition at line 61 of file libopenjpegdec.c.

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

Definition at line 413 of file libopenjpegdec.c.

Definition at line 414 of file libopenjpegdec.c.

Function Documentation

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

Definition at line 78 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame(), and libopenjpeg_guess_pix_fmt().

static enum AVPixelFormat libopenjpeg_guess_pix_fmt ( const opj_image_t *  image)
static

Definition at line 116 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static int libopenjpeg_ispacked ( enum AVPixelFormat  pix_fmt)
inlinestatic

Definition at line 150 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

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

Definition at line 166 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

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

Definition at line 182 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

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

Definition at line 202 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

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

Definition at line 221 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static av_cold int libopenjpeg_decode_init ( AVCodecContext avctx)
static

Definition at line 240 of file libopenjpegdec.c.

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

enum AVPixelFormat rgb_pix_fmts[] = {RGB_PIXEL_FORMATS}
static

Definition at line 63 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

enum AVPixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS}
static

Definition at line 64 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

enum AVPixelFormat yuv_pix_fmts[] = {YUV_PIXEL_FORMATS}
static

Definition at line 65 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

enum AVPixelFormat any_pix_fmts[]
static
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 },
}

Definition at line 416 of file libopenjpegdec.c.

class_name = "libopenjpeg"

Definition at line 423 of file libopenjpegdec.c.

item_name = av_default_item_name

Definition at line 424 of file libopenjpegdec.c.

option = options

Definition at line 425 of file libopenjpegdec.c.

Definition at line 426 of file libopenjpegdec.c.

const { ... }
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,
}

Definition at line 429 of file libopenjpegdec.c.