diff options
author | Rukhsana Ruby <rukhsana.afroz@gmail.com> | 2011-05-23 23:56:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-24 01:31:54 +0200 |
commit | 88e9397ef1e8c854e00b329cc866f88d046893d9 (patch) | |
tree | 32e0b97d08eb18c7cb5101205223738dbe5f1578 /libavcodec/j2k.c | |
parent | cbe60f34515dcfcbd08c00685d5810857ba9513e (diff) | |
download | ffmpeg-streaming-88e9397ef1e8c854e00b329cc866f88d046893d9.zip ffmpeg-streaming-88e9397ef1e8c854e00b329cc866f88d046893d9.tar.gz |
j2k[c/h] j2kdec.c: Implement 2 code block styles
Diffstat (limited to 'libavcodec/j2k.c')
-rw-r--r-- | libavcodec/j2k.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/j2k.c b/libavcodec/j2k.c index a58167b..33a7e31 100644 --- a/libavcodec/j2k.c +++ b/libavcodec/j2k.c @@ -105,18 +105,20 @@ static void tag_tree_zero(J2kTgtNode *t, int w, int h) uint8_t ff_j2k_nbctxno_lut[256][4]; -static int getnbctxno(int flag, int bandno) +static int getnbctxno(int flag, int bandno, int vert_causal_ctx_csty_symbol) { int h, v, d; h = ((flag & J2K_T1_SIG_E) ? 1:0)+ ((flag & J2K_T1_SIG_W) ? 1:0); - v = ((flag & J2K_T1_SIG_N) ? 1:0)+ - ((flag & J2K_T1_SIG_S) ? 1:0); + v = ((flag & J2K_T1_SIG_N) ? 1:0); + if (!vert_causal_ctx_csty_symbol) + v = v + ((flag & J2K_T1_SIG_S) ? 1:0); d = ((flag & J2K_T1_SIG_NE) ? 1:0)+ - ((flag & J2K_T1_SIG_NW) ? 1:0)+ - ((flag & J2K_T1_SIG_SE) ? 1:0)+ - ((flag & J2K_T1_SIG_SW) ? 1:0); + ((flag & J2K_T1_SIG_NW) ? 1:0); + if (!vert_causal_ctx_csty_symbol) + d = d + ((flag & J2K_T1_SIG_SE) ? 1:0)+ + ((flag & J2K_T1_SIG_SW) ? 1:0); if (bandno < 3){ if (bandno == 1) FFSWAP(int, h, v); @@ -171,7 +173,7 @@ void ff_j2k_init_tier1_luts(void) int i, j; for (i = 0; i < 256; i++) for (j = 0; j < 4; j++) - ff_j2k_nbctxno_lut[i][j] = getnbctxno(i, j); + ff_j2k_nbctxno_lut[i][j] = getnbctxno(i, j, 0); for (i = 0; i < 16; i++) for (j = 0; j < 16; j++) ff_j2k_sgnctxno_lut[i][j] = getsgnctxno(i + (j << 8), &ff_j2k_xorbit_lut[i][j]); |