From 2f16b6a52581ead0d908498f2fc87b6cf82c5afd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 27 Sep 2011 19:11:08 +0200 Subject: [PATCH] j2kenc: fix arguments for ff_j2k_getnbctxno() Signed-off-by: Michael Niedermayer --- libavcodec/j2kenc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c index 41308f998f..1103a2ef16 100644 --- a/libavcodec/j2kenc.c +++ b/libavcodec/j2kenc.c @@ -487,11 +487,12 @@ static int getnmsedec_ref(int x, int bpno) static void encode_sigpass(J2kT1Context *t1, int width, int height, int bandno, int *nmsedec, int bpno) { int y0, x, y, mask = 1 << (bpno + NMSEDEC_FRACBITS); + int vert_causal_ctx_csty_loc_symbol; for (y0 = 0; y0 < height; y0 += 4) for (x = 0; x < width; x++) for (y = y0; y < height && y < y0+4; y++){ if (!(t1->flags[y+1][x+1] & J2K_T1_SIG) && (t1->flags[y+1][x+1] & J2K_T1_SIG_NB)){ - int ctxno = ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno), + int ctxno = ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno, vert_causal_ctx_csty_loc_symbol), bit = t1->data[y][x] & mask ? 1 : 0; ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, bit); if (bit){ @@ -523,6 +524,7 @@ static void encode_refpass(J2kT1Context *t1, int width, int height, int *nmsedec static void encode_clnpass(J2kT1Context *t1, int width, int height, int bandno, int *nmsedec, int bpno) { int y0, x, y, mask = 1 << (bpno + NMSEDEC_FRACBITS); + int vert_causal_ctx_csty_loc_symbol; for (y0 = 0; y0 < height; y0 += 4) for (x = 0; x < width; x++){ if (y0 + 3 < height && !( @@ -543,7 +545,7 @@ static void encode_clnpass(J2kT1Context *t1, int width, int height, int bandno, ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + MQC_CX_UNI, rlen & 1); for (y = y0 + rlen; y < y0 + 4; y++){ if (!(t1->flags[y+1][x+1] & (J2K_T1_SIG | J2K_T1_VIS))){ - int ctxno = ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno); + int ctxno = ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno, vert_causal_ctx_csty_loc_symbol); if (y > y0 + rlen) ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[y][x] & mask ? 1:0); if (t1->data[y][x] & mask){ // newly significant @@ -559,7 +561,7 @@ static void encode_clnpass(J2kT1Context *t1, int width, int height, int bandno, } else{ for (y = y0; y < y0 + 4 && y < height; y++){ if (!(t1->flags[y+1][x+1] & (J2K_T1_SIG | J2K_T1_VIS))){ - int ctxno = ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno); + int ctxno = ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno, vert_causal_ctx_csty_loc_symbol); ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[y][x] & mask ? 1:0); if (t1->data[y][x] & mask){ // newly significant int xorbit;