FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
jpeg2000.h File Reference
#include <stdint.h>
#include "avcodec.h"
#include "mqc.h"
#include "jpeg2000dwt.h"

Go to the source code of this file.

Data Structures

struct  Jpeg2000T1Context
 
struct  Jpeg2000TgtNode
 
struct  Jpeg2000CodingStyle
 
struct  Jpeg2000QuantStyle
 
struct  Jpeg2000Pass
 
struct  Jpeg2000Layer
 
struct  Jpeg2000Cblk
 
struct  Jpeg2000Prec
 
struct  Jpeg2000Band
 
struct  Jpeg2000ResLevel
 
struct  Jpeg2000Component
 

Macros

#define JPEG2000_SOP_FIXED_BYTES   0xFF910004
 
#define JPEG2000_SOP_BYTE_LENGTH   6
 
#define JPEG2000_MAX_DECLEVELS   33
 
#define JPEG2000_MAX_RESLEVELS   (JPEG2000_MAX_DECLEVELS + 1)
 
#define JPEG2000_MAX_PASSES   100
 
#define JPEG2000_T1_SIG_N   0x0001
 
#define JPEG2000_T1_SIG_E   0x0002
 
#define JPEG2000_T1_SIG_W   0x0004
 
#define JPEG2000_T1_SIG_S   0x0008
 
#define JPEG2000_T1_SIG_NE   0x0010
 
#define JPEG2000_T1_SIG_NW   0x0020
 
#define JPEG2000_T1_SIG_SE   0x0040
 
#define JPEG2000_T1_SIG_SW   0x0080
 
#define JPEG2000_T1_SIG_NB
 
#define JPEG2000_T1_SGN_N   0x0100
 
#define JPEG2000_T1_SGN_S   0x0200
 
#define JPEG2000_T1_SGN_W   0x0400
 
#define JPEG2000_T1_SGN_E   0x0800
 
#define JPEG2000_T1_VIS   0x1000
 
#define JPEG2000_T1_SIG   0x2000
 
#define JPEG2000_T1_REF   0x4000
 
#define JPEG2000_T1_SGN   0x8000
 
#define JPEG2000_CBLK_BYPASS   0x01
 
#define JPEG2000_CBLK_RESET   0x02
 
#define JPEG2000_CBLK_TERMALL   0x04
 
#define JPEG2000_CBLK_VSC   0x08
 
#define JPEG2000_CBLK_PREDTERM   0x10
 
#define JPEG2000_CBLK_SEGSYM   0x20
 
#define JPEG2000_CSTY_PREC   0x01
 
#define JPEG2000_CSTY_SOP   0x02
 
#define JPEG2000_CSTY_EPH   0x04
 
#define JPEG2000_CTSY_HTJ2K_F   0x40
 
#define JPEG2000_CTSY_HTJ2K_M   0xC0
 
#define JPEG2000_PGOD_LRCP   0x00
 
#define JPEG2000_PGOD_RLCP   0x01
 
#define JPEG2000_PGOD_RPCL   0x02
 
#define JPEG2000_PGOD_PCRL   0x03
 
#define JPEG2000_PGOD_CPRL   0x04
 

Enumerations

enum  Jpeg2000Markers {
  JPEG2000_SOC = 0xff4f, JPEG2000_SIZ = 0xff51, JPEG2000_COD, JPEG2000_COC,
  JPEG2000_TLM = 0xff55, JPEG2000_PLM = 0xff57, JPEG2000_PLT, JPEG2000_QCD = 0xff5c,
  JPEG2000_QCC, JPEG2000_RGN, JPEG2000_POC, JPEG2000_PPM,
  JPEG2000_PPT, JPEG2000_CRG = 0xff63, JPEG2000_COM, JPEG2000_SOT = 0xff90,
  JPEG2000_SOP, JPEG2000_EPH, JPEG2000_SOD, JPEG2000_EOC = 0xffd9
}
 
enum  Jpeg2000Quantsty { JPEG2000_QSTY_NONE, JPEG2000_QSTY_SI, JPEG2000_QSTY_SE }
 

Functions

static int ff_jpeg2000_ceildivpow2 (int a, int b)
 
static int ff_jpeg2000_ceildiv (int a, int64_t b)
 
void ff_jpeg2000_init_tier1_luts (void)
 
void ff_jpeg2000_set_significance (Jpeg2000T1Context *t1, int x, int y, int negative)
 
static int ff_jpeg2000_getsigctxno (int flag, int bandno)
 
static int ff_jpeg2000_getrefctxno (int flag)
 
static int ff_jpeg2000_getsgnctxno (int flag, int *xorbit)
 
int ff_jpeg2000_init_component (Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty, Jpeg2000QuantStyle *qntsty, int cbps, int dx, int dy, AVCodecContext *ctx)
 
void ff_jpeg2000_reinit (Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
 
void ff_jpeg2000_cleanup (Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
 
static int needs_termination (int style, int passno)
 
void ff_tag_tree_zero (Jpeg2000TgtNode *t, int w, int h, int val)
 

Variables

uint8_t ff_jpeg2000_sigctxno_lut [256][4]
 
static const uint8_t refctxno_lut [2][2] = { { 14, 15 }, { 16, 16 } }
 
uint8_t ff_jpeg2000_sgnctxno_lut [16][16]
 
uint8_t ff_jpeg2000_xorbit_lut [16][16]
 

Detailed Description

JPEG 2000 structures and defines common to encoder and decoder

Definition in file jpeg2000.h.

Macro Definition Documentation

◆ JPEG2000_SOP_FIXED_BYTES

#define JPEG2000_SOP_FIXED_BYTES   0xFF910004

Definition at line 61 of file jpeg2000.h.

◆ JPEG2000_SOP_BYTE_LENGTH

#define JPEG2000_SOP_BYTE_LENGTH   6

Definition at line 62 of file jpeg2000.h.

◆ JPEG2000_MAX_DECLEVELS

#define JPEG2000_MAX_DECLEVELS   33

Definition at line 70 of file jpeg2000.h.

◆ JPEG2000_MAX_RESLEVELS

#define JPEG2000_MAX_RESLEVELS   (JPEG2000_MAX_DECLEVELS + 1)

Definition at line 71 of file jpeg2000.h.

◆ JPEG2000_MAX_PASSES

#define JPEG2000_MAX_PASSES   100

Definition at line 73 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_N

#define JPEG2000_T1_SIG_N   0x0001

Definition at line 77 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_E

#define JPEG2000_T1_SIG_E   0x0002

Definition at line 78 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_W

#define JPEG2000_T1_SIG_W   0x0004

Definition at line 79 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_S

#define JPEG2000_T1_SIG_S   0x0008

Definition at line 80 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_NE

#define JPEG2000_T1_SIG_NE   0x0010

Definition at line 81 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_NW

#define JPEG2000_T1_SIG_NW   0x0020

Definition at line 82 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_SE

#define JPEG2000_T1_SIG_SE   0x0040

Definition at line 83 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_SW

#define JPEG2000_T1_SIG_SW   0x0080

Definition at line 84 of file jpeg2000.h.

◆ JPEG2000_T1_SIG_NB

#define JPEG2000_T1_SIG_NB
Value:
JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_W | \
JPEG2000_T1_SIG_NE | JPEG2000_T1_SIG_NW | \
JPEG2000_T1_SIG_SE | JPEG2000_T1_SIG_SW)

Definition at line 85 of file jpeg2000.h.

◆ JPEG2000_T1_SGN_N

#define JPEG2000_T1_SGN_N   0x0100

Definition at line 90 of file jpeg2000.h.

◆ JPEG2000_T1_SGN_S

#define JPEG2000_T1_SGN_S   0x0200

Definition at line 91 of file jpeg2000.h.

◆ JPEG2000_T1_SGN_W

#define JPEG2000_T1_SGN_W   0x0400

Definition at line 92 of file jpeg2000.h.

◆ JPEG2000_T1_SGN_E

#define JPEG2000_T1_SGN_E   0x0800

Definition at line 93 of file jpeg2000.h.

◆ JPEG2000_T1_VIS

#define JPEG2000_T1_VIS   0x1000

Definition at line 95 of file jpeg2000.h.

◆ JPEG2000_T1_SIG

#define JPEG2000_T1_SIG   0x2000

Definition at line 96 of file jpeg2000.h.

◆ JPEG2000_T1_REF

#define JPEG2000_T1_REF   0x4000

Definition at line 97 of file jpeg2000.h.

◆ JPEG2000_T1_SGN

#define JPEG2000_T1_SGN   0x8000

Definition at line 99 of file jpeg2000.h.

◆ JPEG2000_CBLK_BYPASS

#define JPEG2000_CBLK_BYPASS   0x01

Definition at line 102 of file jpeg2000.h.

◆ JPEG2000_CBLK_RESET

#define JPEG2000_CBLK_RESET   0x02

Definition at line 103 of file jpeg2000.h.

◆ JPEG2000_CBLK_TERMALL

#define JPEG2000_CBLK_TERMALL   0x04

Definition at line 104 of file jpeg2000.h.

◆ JPEG2000_CBLK_VSC

#define JPEG2000_CBLK_VSC   0x08

Definition at line 105 of file jpeg2000.h.

◆ JPEG2000_CBLK_PREDTERM

#define JPEG2000_CBLK_PREDTERM   0x10

Definition at line 106 of file jpeg2000.h.

◆ JPEG2000_CBLK_SEGSYM

#define JPEG2000_CBLK_SEGSYM   0x20

Definition at line 107 of file jpeg2000.h.

◆ JPEG2000_CSTY_PREC

#define JPEG2000_CSTY_PREC   0x01

Definition at line 110 of file jpeg2000.h.

◆ JPEG2000_CSTY_SOP

#define JPEG2000_CSTY_SOP   0x02

Definition at line 111 of file jpeg2000.h.

◆ JPEG2000_CSTY_EPH

#define JPEG2000_CSTY_EPH   0x04

Definition at line 112 of file jpeg2000.h.

◆ JPEG2000_CTSY_HTJ2K_F

#define JPEG2000_CTSY_HTJ2K_F   0x40

Definition at line 113 of file jpeg2000.h.

◆ JPEG2000_CTSY_HTJ2K_M

#define JPEG2000_CTSY_HTJ2K_M   0xC0

Definition at line 114 of file jpeg2000.h.

◆ JPEG2000_PGOD_LRCP

#define JPEG2000_PGOD_LRCP   0x00

Definition at line 117 of file jpeg2000.h.

◆ JPEG2000_PGOD_RLCP

#define JPEG2000_PGOD_RLCP   0x01

Definition at line 118 of file jpeg2000.h.

◆ JPEG2000_PGOD_RPCL

#define JPEG2000_PGOD_RPCL   0x02

Definition at line 119 of file jpeg2000.h.

◆ JPEG2000_PGOD_PCRL

#define JPEG2000_PGOD_PCRL   0x03

Definition at line 120 of file jpeg2000.h.

◆ JPEG2000_PGOD_CPRL

#define JPEG2000_PGOD_CPRL   0x04

Definition at line 121 of file jpeg2000.h.

Enumeration Type Documentation

◆ Jpeg2000Markers

Enumerator
JPEG2000_SOC 
JPEG2000_SIZ 
JPEG2000_COD 
JPEG2000_COC 
JPEG2000_TLM 
JPEG2000_PLM 
JPEG2000_PLT 
JPEG2000_QCD 
JPEG2000_QCC 
JPEG2000_RGN 
JPEG2000_POC 
JPEG2000_PPM 
JPEG2000_PPT 
JPEG2000_CRG 
JPEG2000_COM 
JPEG2000_SOT 
JPEG2000_SOP 
JPEG2000_EPH 
JPEG2000_SOD 
JPEG2000_EOC 

Definition at line 38 of file jpeg2000.h.

◆ Jpeg2000Quantsty

Enumerator
JPEG2000_QSTY_NONE 
JPEG2000_QSTY_SI 
JPEG2000_QSTY_SE 

Definition at line 64 of file jpeg2000.h.

Function Documentation

◆ ff_jpeg2000_ceildivpow2()

static int ff_jpeg2000_ceildivpow2 ( int  a,
int  b 
)
inlinestatic

◆ ff_jpeg2000_ceildiv()

static int ff_jpeg2000_ceildiv ( int  a,
int64_t  b 
)
inlinestatic

Definition at line 239 of file jpeg2000.h.

Referenced by get_siz(), init_tile(), init_tiles(), and jpeg2000_decode_packets_po_iteration().

◆ ff_jpeg2000_init_tier1_luts()

void ff_jpeg2000_init_tier1_luts ( void  )

Definition at line 173 of file jpeg2000.c.

Referenced by init_luts(), and jpeg2000_decode_init().

◆ ff_jpeg2000_set_significance()

void ff_jpeg2000_set_significance ( Jpeg2000T1Context t1,
int  x,
int  y,
int  negative 
)

Definition at line 179 of file jpeg2000.c.

Referenced by decode_clnpass(), decode_sigpass(), encode_clnpass(), and encode_sigpass().

◆ ff_jpeg2000_getsigctxno()

static int ff_jpeg2000_getsigctxno ( int  flag,
int  bandno 
)
inlinestatic

Definition at line 258 of file jpeg2000.h.

Referenced by decode_clnpass(), decode_sigpass(), encode_clnpass(), and encode_sigpass().

◆ ff_jpeg2000_getrefctxno()

static int ff_jpeg2000_getrefctxno ( int  flag)
inlinestatic

Definition at line 267 of file jpeg2000.h.

Referenced by decode_refpass(), and encode_refpass().

◆ ff_jpeg2000_getsgnctxno()

static int ff_jpeg2000_getsgnctxno ( int  flag,
int xorbit 
)
inlinestatic

Definition at line 276 of file jpeg2000.h.

Referenced by decode_clnpass(), decode_sigpass(), encode_clnpass(), and encode_sigpass().

◆ ff_jpeg2000_init_component()

int ff_jpeg2000_init_component ( Jpeg2000Component comp,
Jpeg2000CodingStyle codsty,
Jpeg2000QuantStyle qntsty,
int  cbps,
int  dx,
int  dy,
AVCodecContext ctx 
)

Definition at line 466 of file jpeg2000.c.

Referenced by init_tile(), and init_tiles().

◆ ff_jpeg2000_reinit()

void ff_jpeg2000_reinit ( Jpeg2000Component comp,
Jpeg2000CodingStyle codsty 
)

Definition at line 576 of file jpeg2000.c.

Referenced by reinit().

◆ ff_jpeg2000_cleanup()

void ff_jpeg2000_cleanup ( Jpeg2000Component comp,
Jpeg2000CodingStyle codsty 
)

Definition at line 597 of file jpeg2000.c.

Referenced by cleanup(), and jpeg2000_dec_cleanup().

◆ needs_termination()

static int needs_termination ( int  style,
int  passno 
)
inlinestatic

Definition at line 292 of file jpeg2000.h.

Referenced by decode_cblk(), and jpeg2000_decode_packet().

◆ ff_tag_tree_zero()

void ff_tag_tree_zero ( Jpeg2000TgtNode t,
int  w,
int  h,
int  val 
)

Definition at line 86 of file jpeg2000.c.

Referenced by encode_packet(), and ff_jpeg2000_reinit().

Variable Documentation

◆ ff_jpeg2000_sigctxno_lut

uint8_t ff_jpeg2000_sigctxno_lut[256][4]

Definition at line 97 of file jpeg2000.c.

Referenced by ff_jpeg2000_getsigctxno(), and jpeg2000_init_tier1_luts().

◆ refctxno_lut

const uint8_t refctxno_lut[2][2] = { { 14, 15 }, { 16, 16 } }
static

Definition at line 263 of file jpeg2000.h.

Referenced by ff_jpeg2000_getrefctxno().

◆ ff_jpeg2000_sgnctxno_lut

uint8_t ff_jpeg2000_sgnctxno_lut[16][16]

Definition at line 142 of file jpeg2000.c.

Referenced by ff_jpeg2000_getsgnctxno(), and jpeg2000_init_tier1_luts().

◆ ff_jpeg2000_xorbit_lut

uint8_t ff_jpeg2000_xorbit_lut[16][16]

Definition at line 142 of file jpeg2000.c.

Referenced by ff_jpeg2000_getsgnctxno(), and jpeg2000_init_tier1_luts().

JPEG2000_T1_SIG_N
#define JPEG2000_T1_SIG_N
Definition: jpeg2000.h:77
JPEG2000_T1_SIG_E
#define JPEG2000_T1_SIG_E
Definition: jpeg2000.h:78
JPEG2000_T1_SIG_W
#define JPEG2000_T1_SIG_W
Definition: jpeg2000.h:79
JPEG2000_T1_SIG_SW
#define JPEG2000_T1_SIG_SW
Definition: jpeg2000.h:84
JPEG2000_T1_SIG_NW
#define JPEG2000_T1_SIG_NW
Definition: jpeg2000.h:82