FFmpeg
Macros | Functions | Variables
jpeg2000.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "jpeg2000.h"

Go to the source code of this file.

Macros

#define SHL(a, n)   ((n) >= 0 ? (a) << (n) : (a) >> -(n))
 

Functions

static int32_t tag_tree_size (int w, int h)
 
static Jpeg2000TgtNodeff_jpeg2000_tag_tree_init (int w, int h)
 
void ff_tag_tree_zero (Jpeg2000TgtNode *t, int w, int h, int val)
 
static int getsigctxno (int flag, int bandno)
 
static int getsgnctxno (int flag, uint8_t *xorbit)
 
static void av_cold jpeg2000_init_tier1_luts (void)
 
void av_cold ff_jpeg2000_init_tier1_luts (void)
 
void ff_jpeg2000_set_significance (Jpeg2000T1Context *t1, int x, int y, int negative)
 
static av_always_inline float exp2fi (int x)
 2^(x) for integer x in the range -126..128. More...
 
static void init_band_stepsize (AVCodecContext *avctx, Jpeg2000Band *band, Jpeg2000CodingStyle *codsty, Jpeg2000QuantStyle *qntsty, int bandno, int gbandno, int reslevelno, int cbps)
 
static int init_prec (AVCodecContext *avctx, Jpeg2000Band *band, Jpeg2000ResLevel *reslevel, Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty, int precno, int bandno, int reslevelno, int log2_band_prec_width, int log2_band_prec_height)
 
static int init_band (AVCodecContext *avctx, Jpeg2000ResLevel *reslevel, Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty, Jpeg2000QuantStyle *qntsty, int bandno, int gbandno, int reslevelno, const int cbps, int dx, int dy)
 
int ff_jpeg2000_init_component (Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty, Jpeg2000QuantStyle *qntsty, const int cbps, int dx, int dy, AVCodecContext *avctx)
 
void ff_jpeg2000_reinit (Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
 
void ff_jpeg2000_cleanup (Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
 

Variables

uint8_t ff_jpeg2000_sigctxno_lut [256][4]
 
uint8_t ff_jpeg2000_sgnctxno_lut [16][16]
 
uint8_t ff_jpeg2000_xorbit_lut [16][16]
 
static const int contribtab [3][3] = { { 0, -1, 1 }, { -1, -1, 0 }, { 1, 0, 1 } }
 
static const int ctxlbltab [3][3] = { { 13, 12, 11 }, { 10, 9, 10 }, { 11, 12, 13 } }
 
static const int xorbittab [3][3] = { { 1, 1, 1 }, { 1, 0, 0 }, { 0, 0, 0 } }
 

Detailed Description

JPEG 2000 image encoder and decoder common functions

Definition in file jpeg2000.c.

Macro Definition Documentation

◆ SHL

#define SHL (   a,
 
)    ((n) >= 0 ? (a) << (n) : (a) >> -(n))

Definition at line 37 of file jpeg2000.c.

Function Documentation

◆ tag_tree_size()

static int32_t tag_tree_size ( int  w,
int  h 
)
static

Definition at line 41 of file jpeg2000.c.

Referenced by ff_jpeg2000_tag_tree_init(), and ff_tag_tree_zero().

◆ ff_jpeg2000_tag_tree_init()

static Jpeg2000TgtNode* ff_jpeg2000_tag_tree_init ( int  w,
int  h 
)
static

Definition at line 54 of file jpeg2000.c.

Referenced by init_prec().

◆ ff_tag_tree_zero()

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

Definition at line 85 of file jpeg2000.c.

Referenced by encode_packet(), and ff_jpeg2000_reinit().

◆ getsigctxno()

static int getsigctxno ( int  flag,
int  bandno 
)
static

Definition at line 98 of file jpeg2000.c.

Referenced by jpeg2000_init_tier1_luts().

◆ getsgnctxno()

static int getsgnctxno ( int  flag,
uint8_t *  xorbit 
)
static

Definition at line 147 of file jpeg2000.c.

Referenced by jpeg2000_init_tier1_luts().

◆ jpeg2000_init_tier1_luts()

static void av_cold jpeg2000_init_tier1_luts ( void  )
static

Definition at line 160 of file jpeg2000.c.

Referenced by ff_jpeg2000_init_tier1_luts().

◆ ff_jpeg2000_init_tier1_luts()

void av_cold ff_jpeg2000_init_tier1_luts ( void  )

Definition at line 172 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 178 of file jpeg2000.c.

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

◆ exp2fi()

static av_always_inline float exp2fi ( int  x)
static

2^(x) for integer x in the range -126..128.

Returns
correctly rounded float

Definition at line 207 of file jpeg2000.c.

Referenced by init_band_stepsize().

◆ init_band_stepsize()

static void init_band_stepsize ( AVCodecContext avctx,
Jpeg2000Band band,
Jpeg2000CodingStyle codsty,
Jpeg2000QuantStyle qntsty,
int  bandno,
int  gbandno,
int  reslevelno,
int  cbps 
)
static

Definition at line 214 of file jpeg2000.c.

Referenced by init_band().

◆ init_prec()

static int init_prec ( AVCodecContext avctx,
Jpeg2000Band band,
Jpeg2000ResLevel reslevel,
Jpeg2000Component comp,
Jpeg2000CodingStyle codsty,
int  precno,
int  bandno,
int  reslevelno,
int  log2_band_prec_width,
int  log2_band_prec_height 
)
static

Definition at line 281 of file jpeg2000.c.

Referenced by init_band().

◆ init_band()

static int init_band ( AVCodecContext avctx,
Jpeg2000ResLevel reslevel,
Jpeg2000Component comp,
Jpeg2000CodingStyle codsty,
Jpeg2000QuantStyle qntsty,
int  bandno,
int  gbandno,
int  reslevelno,
const int  cbps,
int  dx,
int  dy 
)
static

Definition at line 398 of file jpeg2000.c.

Referenced by ff_jpeg2000_init_component().

◆ ff_jpeg2000_init_component()

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

Definition at line 476 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 586 of file jpeg2000.c.

Referenced by reinit().

◆ ff_jpeg2000_cleanup()

void ff_jpeg2000_cleanup ( Jpeg2000Component comp,
Jpeg2000CodingStyle codsty 
)

Definition at line 607 of file jpeg2000.c.

Referenced by cleanup(), and jpeg2000_dec_cleanup().

Variable Documentation

◆ ff_jpeg2000_sigctxno_lut

uint8_t ff_jpeg2000_sigctxno_lut[256][4]

Definition at line 96 of file jpeg2000.c.

Referenced by ff_jpeg2000_getsigctxno(), and jpeg2000_init_tier1_luts().

◆ ff_jpeg2000_sgnctxno_lut

uint8_t ff_jpeg2000_sgnctxno_lut[16][16]

Definition at line 141 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 141 of file jpeg2000.c.

Referenced by ff_jpeg2000_getsgnctxno(), and jpeg2000_init_tier1_luts().

◆ contribtab

const int contribtab[3][3] = { { 0, -1, 1 }, { -1, -1, 0 }, { 1, 0, 1 } }
static

Definition at line 143 of file jpeg2000.c.

Referenced by getsgnctxno().

◆ ctxlbltab

const int ctxlbltab[3][3] = { { 13, 12, 11 }, { 10, 9, 10 }, { 11, 12, 13 } }
static

Definition at line 144 of file jpeg2000.c.

Referenced by getsgnctxno().

◆ xorbittab

const int xorbittab[3][3] = { { 1, 1, 1 }, { 1, 0, 0 }, { 0, 0, 0 } }
static

Definition at line 145 of file jpeg2000.c.

Referenced by getsgnctxno().