summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-22 01:56:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-22 02:00:57 +0200
commit6c7b1597c7790da6018695dda6cd8a6b6690d6e5 (patch)
tree5ac13be044df20137f52aa7cbb5d34056f5f45b4 /libavcodec/jpeg2000.c
parent69f7ccef8e12a9995ae08c9cca429bd4402bed69 (diff)
avcodec/jpeg2000: Move H band scaling from wavelet into quantization code
This reduces the number of operations done and is equivalent except for rounding Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r--libavcodec/jpeg2000.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index 3bb55786b7..b61e8fec33 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -314,8 +314,17 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
av_log(avctx, AV_LOG_ERROR, "Unknown quantization format\n");
break;
}
- band->f_stepsize *= 1<<lut_gain[codsty->transform != FF_DWT53][bandno + (reslevelno > 0)];
-
+ if (codsty->transform != FF_DWT53) {
+ switch (bandno + (reslevelno > 0)) {
+ case 1:
+ case 2:
+ band->f_stepsize *= F_LFTG_X * 2;
+ break;
+ case 3:
+ band->f_stepsize *= F_LFTG_X * F_LFTG_X * 4;
+ 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))