summaryrefslogtreecommitdiff
path: root/libavcodec/j2k.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-28 14:27:49 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-28 19:02:00 +0200
commit32475f56f38d321b123fce116bc4521f6af0d738 (patch)
tree3795b719acbc76697c58d949b951024b1498533b /libavcodec/j2k.c
parentf0a2c8285a4e14b977b7d949cc7323f9be876b1f (diff)
j2kdec/jpeg2000dec: partially merge quantization code
The quantization code needs more work, not so much work merging but more work investigating what is correct. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/j2k.c')
-rw-r--r--libavcodec/j2k.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/j2k.c b/libavcodec/j2k.c
index 2a86dcedd4..7da05a8701 100644
--- a/libavcodec/j2k.c
+++ b/libavcodec/j2k.c
@@ -278,15 +278,16 @@ int ff_j2k_init_component(Jpeg2000Component *comp,
gain = cbps;
stepsize = pow(2.0, gain - qntsty->expn[gbandno]);
stepsize *= (qntsty->mant[gbandno] / 2048.0 + 1.0);
- /* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
- * If not set output of entropic decoder is not correct. */
-// stepsize *= 0.5;
break;
default:
stepsize = 0;
av_log(avctx, AV_LOG_ERROR, "Unknown quantization format\n");
break;
}
+ /* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
+ * If not set output of entropic decoder is not correct. */
+ if (!av_codec_is_encoder(avctx->codec))
+ stepsize *= 0.5;
/* BITEXACT computing case --> convert to int */
// if (avctx->flags & CODEC_FLAG_BITEXACT)
band->stepsize = stepsize * (1 << 16);