libavcodec/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 "thread.h"

Go to the source code of this file.

Data Structures

struct  LibOpenJPEGContext

Defines

#define OPJ_STATIC
#define JP2_SIG_TYPE   0x6A502020
#define JP2_SIG_VALUE   0x0D0A870A
#define RGB_PIXEL_FORMATS   PIX_FMT_RGB24,PIX_FMT_RGBA,PIX_FMT_RGB48,PIX_FMT_RGBA64
#define GRAY_PIXEL_FORMATS   PIX_FMT_GRAY8,PIX_FMT_GRAY8A,PIX_FMT_GRAY16
#define YUV_PIXEL_FORMATS
#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 *image, enum PixelFormat pix_fmt)
static enum PixelFormat libopenjpeg_guess_pix_fmt (const opj_image_t *image)
static int libopenjpeg_ispacked (enum PixelFormat 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 *picture, opj_image_t *image)
static av_cold int libopenjpeg_decode_init (AVCodecContext *avctx)
static av_cold int libopenjpeg_decode_init_thread_copy (AVCodecContext *avctx)
static int libopenjpeg_decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static av_cold int libopenjpeg_decode_close (AVCodecContext *avctx)

Variables

static enum PixelFormat libopenjpeg_rgb_pix_fmts [] = {RGB_PIXEL_FORMATS}
static enum PixelFormat libopenjpeg_gray_pix_fmts [] = {GRAY_PIXEL_FORMATS}
static enum PixelFormat libopenjpeg_yuv_pix_fmts [] = {YUV_PIXEL_FORMATS}
static enum PixelFormat libopenjpeg_all_pix_fmts [] = {RGB_PIXEL_FORMATS,GRAY_PIXEL_FORMATS,YUV_PIXEL_FORMATS}
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.


Define Documentation

#define GRAY_PIXEL_FORMATS   PIX_FMT_GRAY8,PIX_FMT_GRAY8A,PIX_FMT_GRAY16

Definition at line 44 of file libopenjpegdec.c.

#define JP2_SIG_TYPE   0x6A502020

Definition at line 38 of file libopenjpegdec.c.

#define JP2_SIG_VALUE   0x0D0A870A

Definition at line 39 of file libopenjpegdec.c.

#define OFFSET (  )     offsetof(LibOpenJPEGContext, x)

Definition at line 395 of file libopenjpegdec.c.

#define OPJ_STATIC

Definition at line 27 of file libopenjpegdec.c.

#define RGB_PIXEL_FORMATS   PIX_FMT_RGB24,PIX_FMT_RGBA,PIX_FMT_RGB48,PIX_FMT_RGBA64

Definition at line 43 of file libopenjpegdec.c.

#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM

Definition at line 396 of file libopenjpegdec.c.

#define YUV_PIXEL_FORMATS


Function Documentation

static void libopenjpeg_copy_to_packed16 ( AVFrame picture,
opj_image_t *  image 
) [inline, static]

Definition at line 156 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static void libopenjpeg_copy_to_packed8 ( AVFrame picture,
opj_image_t *  image 
) [inline, static]

Definition at line 142 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static void libopenjpeg_copyto16 ( AVFrame picture,
opj_image_t *  image 
) [inline, static]

Definition at line 192 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static void libopenjpeg_copyto8 ( AVFrame picture,
opj_image_t *  image 
) [inline, static]

Definition at line 174 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static av_cold int libopenjpeg_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 386 of file libopenjpegdec.c.

static int libopenjpeg_decode_frame ( AVCodecContext avctx,
void *  data,
int data_size,
AVPacket avpkt 
) [static]

Definition at line 227 of file libopenjpegdec.c.

static av_cold int libopenjpeg_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 209 of file libopenjpegdec.c.

static av_cold int libopenjpeg_decode_init_thread_copy ( AVCodecContext avctx  )  [static]

Definition at line 219 of file libopenjpegdec.c.

static enum PixelFormat libopenjpeg_guess_pix_fmt ( const opj_image_t *  image  )  [inline, static]

Definition at line 95 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static int libopenjpeg_ispacked ( enum PixelFormat  pix_fmt  )  [inline, static]

Definition at line 128 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame().

static int libopenjpeg_matches_pix_fmt ( const opj_image_t *  image,
enum PixelFormat  pix_fmt 
) [inline, static]

Definition at line 66 of file libopenjpegdec.c.

Referenced by libopenjpeg_decode_frame(), and libopenjpeg_guess_pix_fmt().


Variable Documentation

const { ... } [static]

class_name = "libopenjpeg"

Definition at line 404 of file libopenjpegdec.c.

Initial value:

 {
    .name             = "libopenjpeg",
    .type             = AVMEDIA_TYPE_VIDEO,
    .id               = AV_CODEC_ID_JPEG2000,
    .priv_data_size   = sizeof(LibOpenJPEGContext),
    .init             = libopenjpeg_decode_init,
    .close            = libopenjpeg_decode_close,
    .decode           = libopenjpeg_decode_frame,
    .capabilities     = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
    .max_lowres       = 31,
    .long_name        = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
    .priv_class       = &class,
    .init_thread_copy = ONLY_IF_THREADS_ENABLED(libopenjpeg_decode_init_thread_copy),
}

Definition at line 410 of file libopenjpegdec.c.

item_name = av_default_item_name

Definition at line 405 of file libopenjpegdec.c.

enum PixelFormat libopenjpeg_all_pix_fmts[] = {RGB_PIXEL_FORMATS,GRAY_PIXEL_FORMATS,YUV_PIXEL_FORMATS} [static]

Definition at line 57 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

enum PixelFormat libopenjpeg_gray_pix_fmts[] = {GRAY_PIXEL_FORMATS} [static]

Definition at line 55 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

enum PixelFormat libopenjpeg_rgb_pix_fmts[] = {RGB_PIXEL_FORMATS} [static]

Definition at line 54 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

enum PixelFormat libopenjpeg_yuv_pix_fmts[] = {YUV_PIXEL_FORMATS} [static]

Definition at line 56 of file libopenjpegdec.c.

Referenced by libopenjpeg_guess_pix_fmt().

Definition at line 406 of file libopenjpegdec.c.

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 },
    { NULL },
}

Definition at line 398 of file libopenjpegdec.c.

Definition at line 407 of file libopenjpegdec.c.


Generated on Fri Oct 26 02:50:06 2012 for FFmpeg by  doxygen 1.5.8