Go to the documentation of this file.
23 #ifndef AVCODEC_JPEG2000_H
24 #define AVCODEC_JPEG2000_H
69 #define JPEG2000_SOP_FIXED_BYTES 0xFF910004
70 #define JPEG2000_SOP_BYTE_LENGTH 6
78 #define JPEG2000_MAX_DECLEVELS 33
79 #define JPEG2000_MAX_RESLEVELS (JPEG2000_MAX_DECLEVELS + 1)
81 #define JPEG2000_MAX_PASSES 100
85 #define JPEG2000_T1_SIG_N 0x0001
86 #define JPEG2000_T1_SIG_E 0x0002
87 #define JPEG2000_T1_SIG_W 0x0004
88 #define JPEG2000_T1_SIG_S 0x0008
89 #define JPEG2000_T1_SIG_NE 0x0010
90 #define JPEG2000_T1_SIG_NW 0x0020
91 #define JPEG2000_T1_SIG_SE 0x0040
92 #define JPEG2000_T1_SIG_SW 0x0080
93 #define JPEG2000_T1_SIG_NB (JPEG2000_T1_SIG_N | JPEG2000_T1_SIG_E | \
94 JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_W | \
95 JPEG2000_T1_SIG_NE | JPEG2000_T1_SIG_NW | \
96 JPEG2000_T1_SIG_SE | JPEG2000_T1_SIG_SW)
98 #define JPEG2000_T1_SGN_N 0x0100
99 #define JPEG2000_T1_SGN_S 0x0200
100 #define JPEG2000_T1_SGN_W 0x0400
101 #define JPEG2000_T1_SGN_E 0x0800
103 #define JPEG2000_T1_VIS 0x1000
104 #define JPEG2000_T1_SIG 0x2000
105 #define JPEG2000_T1_REF 0x4000
107 #define JPEG2000_T1_SGN 0x8000
110 #define JPEG2000_CBLK_BYPASS 0x01 // Selective arithmetic coding bypass
111 #define JPEG2000_CBLK_RESET 0x02 // Reset context probabilities
112 #define JPEG2000_CBLK_TERMALL 0x04 // Terminate after each coding pass
113 #define JPEG2000_CBLK_VSC 0x08 // Vertical stripe causal context formation
114 #define JPEG2000_CBLK_PREDTERM 0x10 // Predictable termination
115 #define JPEG2000_CBLK_SEGSYM 0x20 // Segmentation symbols present
118 #define JPEG2000_CSTY_PREC 0x01 // Precincts defined in coding style
119 #define JPEG2000_CSTY_SOP 0x02 // SOP marker present
120 #define JPEG2000_CSTY_EPH 0x04 // EPH marker present
121 #define JPEG2000_CTSY_HTJ2K_F 0x40 // Only HT code-blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) are present
122 #define JPEG2000_CTSY_HTJ2K_M 0xC0 // HT code-blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) can be present
125 #define JPEG2000_PGOD_LRCP 0x00 // Layer-resolution level-component-position progression
126 #define JPEG2000_PGOD_RLCP 0x01 // Resolution level-layer-component-position progression
127 #define JPEG2000_PGOD_RPCL 0x02 // Resolution level-position-component-layer progression
128 #define JPEG2000_PGOD_PCRL 0x03 // Position-component-resolution level-layer progression
129 #define JPEG2000_PGOD_CPRL 0x04 // Component-position-resolution level-layer progression
251 return (
a +
b - 1) /
b;
262 int x,
int y,
int negative);
295 int cbps,
int dx,
int dy,
304 int type = passno % 3;
306 if (
type == 0 && passno > 2)
308 if (
type == 2 && passno > 2)
311 return passno > 2 ? 2 : 1;
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
#define JPEG2000_MAX_RESLEVELS
void ff_jpeg2000_reinit(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
static int needs_termination(int style, int passno)
Jpeg2000TgtNode * zerobits
void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, int x, int y, int negative)
static int ff_jpeg2000_ceildiv(int a, int64_t b)
#define JPEG2000_CBLK_TERMALL
struct Jpeg2000TgtNode * parent
uint8_t ff_jpeg2000_xorbit_lut[16][16]
static int ff_jpeg2000_getrefctxno(int flag)
int ff_jpeg2000_init_component(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty, Jpeg2000QuantStyle *qntsty, int cbps, int dx, int dy, AVCodecContext *ctx)
uint8_t log2_prec_heights[JPEG2000_MAX_RESLEVELS]
static double val(void *priv, double ch)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
uint8_t ff_jpeg2000_sgnctxno_lut[16][16]
Jpeg2000ResLevel * reslevel
#define JPEG2000_CBLK_BYPASS
uint8_t log2_prec_widths[JPEG2000_MAX_RESLEVELS]
JPEG2000_Ccap15_b14_15_params
uint16_t log2_cblk_height
Jpeg2000TgtNode * cblkincl
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static int ff_jpeg2000_getsgnctxno(int flag, int *xorbit)
uint8_t expn[JPEG2000_MAX_DECLEVELS *3]
void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h, int val)
static int ff_jpeg2000_getsigctxno(int flag, int bandno)
uint8_t ff_jpeg2000_sigctxno_lut[256][4]
uint16_t mant[JPEG2000_MAX_DECLEVELS *3]
main external API structure.
static int ff_jpeg2000_ceildivpow2(int a, int b)
void ff_jpeg2000_init_tier1_luts(void)
#define JPEG2000_MAX_DECLEVELS
static const uint8_t refctxno_lut[2][2]
void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)