summaryrefslogtreecommitdiff
path: root/libavcodec/j2kenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-27 19:11:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-27 19:30:19 +0200
commit2f16b6a52581ead0d908498f2fc87b6cf82c5afd (patch)
tree713d0ea137f7a65206f4f9450eb8c92f8f3faf0d /libavcodec/j2kenc.c
parent0db973e0d78baa83e24c6c066449b52adc479809 (diff)
downloadffmpeg-2f16b6a52581ead0d908498f2fc87b6cf82c5afd.tar.gz
j2kenc: fix arguments for ff_j2k_getnbctxno()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/j2kenc.c')
-rw-r--r--libavcodec/j2kenc.c8
1 files 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;