j2kdec.c File Reference

JPEG2000 image decoder. More...

#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "j2k.h"
#include "libavutil/common.h"
Include dependency graph for j2kdec.c:

Go to the source code of this file.

Data Structures

struct  J2kTile
 
struct  J2kDecoderContext
 

Macros

#define JP2_SIG_TYPE   0x6A502020
 
#define JP2_SIG_VALUE   0x0D0A870A
 
#define JP2_CODESTREAM   0x6A703263
 
#define HAD_COC   0x01
 
#define HAD_QCC   0x02
 

Functions

static int get_bits (J2kDecoderContext *s, int n)
 
static void j2k_flush (J2kDecoderContext *s)
 
static int tag_tree_decode (J2kDecoderContext *s, J2kTgtNode *node, int threshold)
 decode the value stored in node More...
 
static int get_siz (J2kDecoderContext *s)
 get sizes and offsets of image, tiles; number of components More...
 
static int get_cox (J2kDecoderContext *s, J2kCodingStyle *c)
 get common part for COD and COC segments More...
 
static int get_cod (J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties)
 get coding parameters for a particular tile or whole image More...
 
static int get_coc (J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties)
 get coding parameters for a component in the whole image on a particular tile More...
 
static int get_qcx (J2kDecoderContext *s, int n, J2kQuantStyle *q)
 get common part for QCD and QCC segments More...
 
static int get_qcd (J2kDecoderContext *s, int n, J2kQuantStyle *q, uint8_t *properties)
 get quantization parameters for a particular tile or a whole image More...
 
static int get_qcc (J2kDecoderContext *s, int n, J2kQuantStyle *q, uint8_t *properties)
 get quantization parameters for a component in the whole image on in a particular tile More...
 
static uint8_t get_sot (J2kDecoderContext *s)
 get start of tile segment More...
 
static int init_tile (J2kDecoderContext *s, int tileno)
 
static int getnpasses (J2kDecoderContext *s)
 read the number of coding passes More...
 
static int getlblockinc (J2kDecoderContext *s)
 
static int decode_packet (J2kDecoderContext *s, J2kCodingStyle *codsty, J2kResLevel *rlevel, int precno, int layno, uint8_t *expn, int numgbits)
 
static int decode_packets (J2kDecoderContext *s, J2kTile *tile)
 
static void decode_sigpass (J2kT1Context *t1, int width, int height, int bpno, int bandno, int bpass_csty_symbol, int vert_causal_ctx_csty_symbol)
 
static void decode_refpass (J2kT1Context *t1, int width, int height, int bpno)
 
static void decode_clnpass (J2kDecoderContext *s, J2kT1Context *t1, int width, int height, int bpno, int bandno, int seg_symbols)
 
static int decode_cblk (J2kDecoderContext *s, J2kCodingStyle *codsty, J2kT1Context *t1, J2kCblk *cblk, int width, int height, int bandpos)
 
static void mct_decode (J2kDecoderContext *s, J2kTile *tile)
 
static int decode_tile (J2kDecoderContext *s, J2kTile *tile)
 
static void cleanup (J2kDecoderContext *s)
 
static int decode_codestream (J2kDecoderContext *s)
 
static int jp2_find_codestream (J2kDecoderContext *s)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int j2kdec_init (AVCodecContext *avctx)
 

Variables

AVCodec ff_jpeg2000_decoder
 

Detailed Description

JPEG2000 image decoder.

Author
Kamil Nowosad

Definition in file j2kdec.c.

Macro Definition Documentation

#define HAD_COC   0x01

Definition at line 40 of file j2kdec.c.

Referenced by get_coc(), and get_cod().

#define HAD_QCC   0x02

Definition at line 41 of file j2kdec.c.

Referenced by get_qcc(), and get_qcd().

#define JP2_CODESTREAM   0x6A703263

Definition at line 38 of file j2kdec.c.

Referenced by jp2_find_codestream().

#define JP2_SIG_TYPE   0x6A502020

Definition at line 36 of file j2kdec.c.

Referenced by decode_frame().

#define JP2_SIG_VALUE   0x0D0A870A

Definition at line 37 of file j2kdec.c.

Referenced by decode_frame().

Function Documentation

static void cleanup ( J2kDecoderContext s)
static

Definition at line 904 of file j2kdec.c.

Referenced by decode_frame().

static int decode_cblk ( J2kDecoderContext s,
J2kCodingStyle codsty,
J2kT1Context t1,
J2kCblk cblk,
int  width,
int  height,
int  bandpos 
)
static

Definition at line 713 of file j2kdec.c.

Referenced by decode_tile().

static void decode_clnpass ( J2kDecoderContext s,
J2kT1Context t1,
int  width,
int  height,
int  bpno,
int  bandno,
int  seg_symbols 
)
static

Definition at line 663 of file j2kdec.c.

Referenced by decode_cblk().

static int decode_codestream ( J2kDecoderContext s)
static

Definition at line 919 of file j2kdec.c.

Referenced by decode_frame().

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

Definition at line 1018 of file j2kdec.c.

static int decode_packet ( J2kDecoderContext s,
J2kCodingStyle codsty,
J2kResLevel rlevel,
int  precno,
int  layno,
uint8_t expn,
int  numgbits 
)
static

Definition at line 514 of file j2kdec.c.

Referenced by decode_packets().

static int decode_packets ( J2kDecoderContext s,
J2kTile tile 
)
static

Definition at line 589 of file j2kdec.c.

Referenced by decode_codestream().

static void decode_refpass ( J2kT1Context t1,
int  width,
int  height,
int  bpno 
)
static

Definition at line 643 of file j2kdec.c.

Referenced by decode_cblk().

static void decode_sigpass ( J2kT1Context t1,
int  width,
int  height,
int  bpno,
int  bandno,
int  bpass_csty_symbol,
int  vert_causal_ctx_csty_symbol 
)
static

Definition at line 616 of file j2kdec.c.

Referenced by decode_cblk().

static int decode_tile ( J2kDecoderContext s,
J2kTile tile 
)
static

Definition at line 787 of file j2kdec.c.

Referenced by decode_frame().

static int get_bits ( J2kDecoderContext s,
int  n 
)
static

Definition at line 78 of file j2kdec.c.

Referenced by decode_packet(), getlblockinc(), getnpasses(), and tag_tree_decode().

static int get_coc ( J2kDecoderContext s,
J2kCodingStyle c,
uint8_t properties 
)
static

get coding parameters for a component in the whole image on a particular tile

Definition at line 348 of file j2kdec.c.

Referenced by decode_codestream().

static int get_cod ( J2kDecoderContext s,
J2kCodingStyle c,
uint8_t properties 
)
static

get coding parameters for a particular tile or whole image

Definition at line 318 of file j2kdec.c.

Referenced by decode_codestream().

static int get_cox ( J2kDecoderContext s,
J2kCodingStyle c 
)
static

get common part for COD and COC segments

Definition at line 295 of file j2kdec.c.

Referenced by get_coc(), and get_cod().

static int get_qcc ( J2kDecoderContext s,
int  n,
J2kQuantStyle q,
uint8_t properties 
)
static

get quantization parameters for a component in the whole image on in a particular tile

Definition at line 423 of file j2kdec.c.

Referenced by decode_codestream().

static int get_qcd ( J2kDecoderContext s,
int  n,
J2kQuantStyle q,
uint8_t properties 
)
static

get quantization parameters for a particular tile or a whole image

Definition at line 409 of file j2kdec.c.

Referenced by decode_codestream().

static int get_qcx ( J2kDecoderContext s,
int  n,
J2kQuantStyle q 
)
static

get common part for QCD and QCC segments

Definition at line 366 of file j2kdec.c.

Referenced by get_qcc(), and get_qcd().

static int get_siz ( J2kDecoderContext s)
static

get sizes and offsets of image, tiles; number of components

Definition at line 205 of file j2kdec.c.

Referenced by decode_codestream().

static uint8_t get_sot ( J2kDecoderContext s)
static

get start of tile segment

< Isot

< Psot (ignored)

< TPsot

< TNsot

Definition at line 436 of file j2kdec.c.

Referenced by decode_codestream().

static int getlblockinc ( J2kDecoderContext s)
static

Definition at line 503 of file j2kdec.c.

Referenced by decode_packet().

static int getnpasses ( J2kDecoderContext s)
static

read the number of coding passes

Definition at line 488 of file j2kdec.c.

Referenced by decode_packet().

static int init_tile ( J2kDecoderContext s,
int  tileno 
)
static

Definition at line 461 of file j2kdec.c.

Referenced by decode_codestream().

static void j2k_flush ( J2kDecoderContext s)
static

Definition at line 93 of file j2kdec.c.

Referenced by decode_packet().

static av_cold int j2kdec_init ( AVCodecContext avctx)
static

Definition at line 1073 of file j2kdec.c.

static int jp2_find_codestream ( J2kDecoderContext s)
static

Definition at line 995 of file j2kdec.c.

Referenced by decode_frame().

static void mct_decode ( J2kDecoderContext s,
J2kTile tile 
)
static

Definition at line 756 of file j2kdec.c.

Referenced by decode_tile().

static int tag_tree_decode ( J2kDecoderContext s,
J2kTgtNode node,
int  threshold 
)
static

decode the value stored in node

Definition at line 166 of file j2kdec.c.

Referenced by decode_packet().

Variable Documentation

AVCodec ff_jpeg2000_decoder
Initial value:
= {
.name = "j2k",
.priv_data_size = sizeof(J2kDecoderContext),
.capabilities = CODEC_CAP_EXPERIMENTAL,
.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int j2kdec_init(AVCodecContext *avctx)
Definition: j2kdec.c:1073
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: j2kdec.c:1018
#define CODEC_CAP_EXPERIMENTAL
Codec is experimental and is thus avoided in favor of non experimental encoders.
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868

Definition at line 1084 of file j2kdec.c.