summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000dwt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-17 15:24:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-17 15:24:14 +0200
commit7c3f7e6ed1856ba17ee903427ca229a14771062b (patch)
tree1dcaa66c5bfbbde688e446c6ec621fff5fa10eeb /libavcodec/jpeg2000dwt.c
parent9841024402e83e0d239edf4f356d97e0519aaf4d (diff)
downloadffmpeg-7c3f7e6ed1856ba17ee903427ca229a14771062b.tar.gz
avcodec/jpeg2000dwt: Support 9/7 singularity cases on the encoder side
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000dwt.c')
-rw-r--r--libavcodec/jpeg2000dwt.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 511f223718..ae150fb433 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -150,8 +150,13 @@ static void sd_1d97_float(float *p, int i0, int i1)
{
int i;
- if (i1 == i0 + 1)
+ if (i1 <= i0 + 1) {
+ if (i0 == 1)
+ p[1] *= F_LFTG_X;
+ else
+ p[0] *= F_LFTG_K;
return;
+ }
extend97_float(p, i0, i1);
i0++; i1++;
@@ -222,8 +227,13 @@ static void sd_1d97_int(int *p, int i0, int i1)
{
int i;
- if (i1 == i0 + 1)
+ if (i1 <= i0 + 1) {
+ if (i0 == 1)
+ p[1] = (p[1] * I_LFTG_X + (1<<15)) >> 16;
+ else
+ p[0] = (p[0] * I_LFTG_K + (1<<15)) >> 16;
return;
+ }
extend97_int(p, i0, i1);
i0++; i1++;