summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-22 02:46:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-22 03:01:24 +0200
commit4e926fb969acbb27415c2109d7339259875b6909 (patch)
tree3c5d53ef58d42b7161d9c2f1dd27626e6b6e565b /libavcodec/jpeg2000.c
parentb1fdf81c6eed786742c08037a9aa662ef7967ab2 (diff)
avcodec/jpeg2000: Move L band scaling from the 9/7f wavelet to quantization stage
This reduces the number of operations Its not done for 9/7i as that would overflow thanks to JPEG2000 allowing 32 decomposition levels Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r--libavcodec/jpeg2000.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index b61e8fec33..b333aad568 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -315,15 +315,20 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
break;
}
if (codsty->transform != FF_DWT53) {
+ int lband = 0;
switch (bandno + (reslevelno > 0)) {
case 1:
case 2:
band->f_stepsize *= F_LFTG_X * 2;
+ lband = 1;
break;
case 3:
band->f_stepsize *= F_LFTG_X * F_LFTG_X * 4;
break;
}
+ if (codsty->transform == FF_DWT97) {
+ band->f_stepsize *= pow(F_LFTG_K, 2*(codsty->nreslevels2decode - reslevelno) + lband - 2);
+ }
}
/* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
* If not set output of entropic decoder is not correct. */