summaryrefslogtreecommitdiff
path: root/libavcodec/j2k.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-26 16:33:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-26 18:07:48 +0200
commit5157ec89ef88848add4a2586b10a665f6f73d556 (patch)
tree90badaa6487d124700e6bf9a7f6570ee058ea19b /libavcodec/j2k.c
parentc8e9c9275ff9f9edcbaf0ce69d84efe26bc0637f (diff)
j2k: redesign vert_causal_ctx_csty implementation
The old implementation was incomplete and could not have worked This also fixes some warnings New code is untested as i dont seem to have a sample file that uses this. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/j2k.c')
-rw-r--r--libavcodec/j2k.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/j2k.c b/libavcodec/j2k.c
index 02b58920ba..96d6851b2d 100644
--- a/libavcodec/j2k.c
+++ b/libavcodec/j2k.c
@@ -103,20 +103,18 @@ static void tag_tree_zero(Jpeg2000TgtNode *t, int w, int h)
}
}
-static int getnbctxno(int flag, int bandno, int vert_causal_ctx_csty_symbol)
+static int getnbctxno(int flag, int bandno)
{
int h, v, d;
h = ((flag & JPEG2000_T1_SIG_E) ? 1:0)+
((flag & JPEG2000_T1_SIG_W) ? 1:0);
v = ((flag & JPEG2000_T1_SIG_N) ? 1:0);
- if (!vert_causal_ctx_csty_symbol)
- v = v + ((flag & JPEG2000_T1_SIG_S) ? 1:0);
+ v = v + ((flag & JPEG2000_T1_SIG_S) ? 1:0);
d = ((flag & JPEG2000_T1_SIG_NE) ? 1:0)+
((flag & JPEG2000_T1_SIG_NW) ? 1:0);
- if (!vert_causal_ctx_csty_symbol)
- d = d + ((flag & JPEG2000_T1_SIG_SE) ? 1:0)+
- ((flag & JPEG2000_T1_SIG_SW) ? 1:0);
+ d = d + ((flag & JPEG2000_T1_SIG_SE) ? 1:0)+
+ ((flag & JPEG2000_T1_SIG_SW) ? 1:0);
if (bandno < 3){
if (bandno == 1)
FFSWAP(int, h, v);
@@ -168,7 +166,7 @@ void ff_j2k_init_tier1_luts(void)
int i, j;
for (i = 0; i < 256; i++)
for (j = 0; j < 4; j++)
- ff_jpeg2000_sigctxno_lut[i][j] = getnbctxno(i, j, 0);
+ ff_jpeg2000_sigctxno_lut[i][j] = getnbctxno(i, j);
for (i = 0; i < 16; i++)
for (j = 0; j < 16; j++)
ff_jpeg2000_sgnctxno_lut[i][j] = getsgnctxno(i + (j << 8), &ff_jpeg2000_xorbit_lut[i][j]);