Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
96e73fa6
Commit
96e73fa6
authored
Jun 28, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/jpeg2000dec: Merge i_stepsize/2 decoder special case into dequant
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9a345802
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
11 deletions
+12
-11
jpeg2000.c
libavcodec/jpeg2000.c
+3
-2
jpeg2000dec.c
libavcodec/jpeg2000dec.c
+3
-3
jpeg2000-dcinema
tests/ref/fate/jpeg2000-dcinema
+2
-2
vsynth1-jpeg2000-97
tests/ref/vsynth/vsynth1-jpeg2000-97
+1
-1
vsynth2-jpeg2000-97
tests/ref/vsynth/vsynth2-jpeg2000-97
+1
-1
vsynth3-jpeg2000-97
tests/ref/vsynth/vsynth3-jpeg2000-97
+1
-1
vsynth_lena-jpeg2000-97
tests/ref/vsynth/vsynth_lena-jpeg2000-97
+1
-1
No files found.
libavcodec/jpeg2000.c
View file @
96e73fa6
...
@@ -330,13 +330,14 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
...
@@ -330,13 +330,14 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
band
->
f_stepsize
*=
pow
(
F_LFTG_K
,
2
*
(
codsty
->
nreslevels2decode
-
reslevelno
)
+
lband
-
2
);
band
->
f_stepsize
*=
pow
(
F_LFTG_K
,
2
*
(
codsty
->
nreslevels2decode
-
reslevelno
)
+
lband
-
2
);
}
}
}
}
band
->
i_stepsize
=
band
->
f_stepsize
*
(
1
<<
15
);
/* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
/* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
* If not set output of entropic decoder is not correct. */
* If not set output of entropic decoder is not correct. */
if
(
!
av_codec_is_encoder
(
avctx
->
codec
))
if
(
!
av_codec_is_encoder
(
avctx
->
codec
))
band
->
f_stepsize
*=
0
.
5
;
band
->
f_stepsize
*=
0
.
5
;
band
->
i_stepsize
=
band
->
f_stepsize
*
(
1
<<
15
);
/* computation of tbx_0, tbx_1, tby_0, tby_1
/* computation of tbx_0, tbx_1, tby_0, tby_1
* see ISO/IEC 15444-1:2002 B.5 eq. B-15 and tbl B.1
* see ISO/IEC 15444-1:2002 B.5 eq. B-15 and tbl B.1
* codeblock width and height is computed for
* codeblock width and height is computed for
...
...
libavcodec/jpeg2000dec.c
View file @
96e73fa6
...
@@ -1559,13 +1559,13 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
...
@@ -1559,13 +1559,13 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
for
(
j
=
0
;
j
<
(
cblk
->
coord
[
1
][
1
]
-
cblk
->
coord
[
1
][
0
]);
++
j
)
{
for
(
j
=
0
;
j
<
(
cblk
->
coord
[
1
][
1
]
-
cblk
->
coord
[
1
][
0
]);
++
j
)
{
int32_t
*
datap
=
&
comp
->
i_data
[(
comp
->
coord
[
0
][
1
]
-
comp
->
coord
[
0
][
0
])
*
(
y
+
j
)
+
x
];
int32_t
*
datap
=
&
comp
->
i_data
[(
comp
->
coord
[
0
][
1
]
-
comp
->
coord
[
0
][
0
])
*
(
y
+
j
)
+
x
];
int
*
src
=
t1
->
data
+
j
*
t1
->
stride
;
int
*
src
=
t1
->
data
+
j
*
t1
->
stride
;
if
(
band
->
i_stepsize
==
16384
)
{
if
(
band
->
i_stepsize
==
32768
)
{
for
(
i
=
0
;
i
<
w
;
++
i
)
for
(
i
=
0
;
i
<
w
;
++
i
)
datap
[
i
]
=
src
[
i
]
/
2
;
datap
[
i
]
=
src
[
i
]
/
2
;
}
else
{
}
else
{
// This should be VERY uncommon
// This should be VERY uncommon
for
(
i
=
0
;
i
<
w
;
++
i
)
for
(
i
=
0
;
i
<
w
;
++
i
)
datap
[
i
]
=
(
src
[
i
]
*
(
int64_t
)
band
->
i_stepsize
)
/
32768
;
datap
[
i
]
=
(
src
[
i
]
*
(
int64_t
)
band
->
i_stepsize
)
/
65536
;
}
}
}
}
}
}
...
@@ -1580,7 +1580,7 @@ static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
...
@@ -1580,7 +1580,7 @@ static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
int32_t
*
datap
=
&
comp
->
i_data
[(
comp
->
coord
[
0
][
1
]
-
comp
->
coord
[
0
][
0
])
*
(
y
+
j
)
+
x
];
int32_t
*
datap
=
&
comp
->
i_data
[(
comp
->
coord
[
0
][
1
]
-
comp
->
coord
[
0
][
0
])
*
(
y
+
j
)
+
x
];
int
*
src
=
t1
->
data
+
j
*
t1
->
stride
;
int
*
src
=
t1
->
data
+
j
*
t1
->
stride
;
for
(
i
=
0
;
i
<
w
;
++
i
)
for
(
i
=
0
;
i
<
w
;
++
i
)
datap
[
i
]
=
(
src
[
i
]
*
(
int64_t
)
band
->
i_stepsize
+
(
1
<<
1
4
))
>>
15
;
datap
[
i
]
=
(
src
[
i
]
*
(
int64_t
)
band
->
i_stepsize
+
(
1
<<
1
5
))
>>
16
;
}
}
}
}
...
...
tests/ref/fate/jpeg2000-dcinema
View file @
96e73fa6
#tb 0: 1/24
#tb 0: 1/24
0, 0, 0, 1, 12441600, 0x
da6b6cde
0, 0, 0, 1, 12441600, 0x
fcf6a127
0, 1, 1, 1, 12441600, 0x
b09946
64
0, 1, 1, 1, 12441600, 0x
577b6a
64
tests/ref/vsynth/vsynth1-jpeg2000-97
View file @
96e73fa6
a19cc0e1a1c1bf76ff5a0b63a0bdfbd1 *tests/data/fate/vsynth1-jpeg2000-97.avi
a19cc0e1a1c1bf76ff5a0b63a0bdfbd1 *tests/data/fate/vsynth1-jpeg2000-97.avi
3654420 tests/data/fate/vsynth1-jpeg2000-97.avi
3654420 tests/data/fate/vsynth1-jpeg2000-97.avi
3b71c0f8aebf45122da77d892a6ebf00
*tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
5073771a78e1f5366a7eb0df341662fc
*tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
stddev: 4.23 PSNR: 35.59 MAXDIFF: 53 bytes: 7603200/ 7603200
stddev: 4.23 PSNR: 35.59 MAXDIFF: 53 bytes: 7603200/ 7603200
tests/ref/vsynth/vsynth2-jpeg2000-97
View file @
96e73fa6
b86217f0bcbd84a9368ad3f98af32157 *tests/data/fate/vsynth2-jpeg2000-97.avi
b86217f0bcbd84a9368ad3f98af32157 *tests/data/fate/vsynth2-jpeg2000-97.avi
2448506 tests/data/fate/vsynth2-jpeg2000-97.avi
2448506 tests/data/fate/vsynth2-jpeg2000-97.avi
4d9d9db91075a1eca2a6b9f152e4defc
*tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
a6e2453118a0de135836a868b2ca0e60
*tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
stddev: 3.23 PSNR: 37.94 MAXDIFF: 29 bytes: 7603200/ 7603200
stddev: 3.23 PSNR: 37.94 MAXDIFF: 29 bytes: 7603200/ 7603200
tests/ref/vsynth/vsynth3-jpeg2000-97
View file @
96e73fa6
5e17fdaae1a22f3eef8c82b512e4b1b9 *tests/data/fate/vsynth3-jpeg2000-97.avi
5e17fdaae1a22f3eef8c82b512e4b1b9 *tests/data/fate/vsynth3-jpeg2000-97.avi
83670 tests/data/fate/vsynth3-jpeg2000-97.avi
83670 tests/data/fate/vsynth3-jpeg2000-97.avi
8ec04513b2e6645c9ea340e3fe9fe8f2
*tests/data/fate/vsynth3-jpeg2000-97.out.rawvideo
0cd707bfb1bbe5312b00c094f695b1fa
*tests/data/fate/vsynth3-jpeg2000-97.out.rawvideo
stddev: 4.52 PSNR: 35.02 MAXDIFF: 47 bytes: 86700/ 86700
stddev: 4.52 PSNR: 35.02 MAXDIFF: 47 bytes: 86700/ 86700
tests/ref/vsynth/vsynth_lena-jpeg2000-97
View file @
96e73fa6
ca78db12e1af7cbf44fdce165aaa5130 *tests/data/fate/vsynth_lena-jpeg2000-97.avi
ca78db12e1af7cbf44fdce165aaa5130 *tests/data/fate/vsynth_lena-jpeg2000-97.avi
1918756 tests/data/fate/vsynth_lena-jpeg2000-97.avi
1918756 tests/data/fate/vsynth_lena-jpeg2000-97.avi
5fd8a2e35503b48af302b3ef5e317683
*tests/data/fate/vsynth_lena-jpeg2000-97.out.rawvideo
93a4ba0c230f2430a813df594676e58a
*tests/data/fate/vsynth_lena-jpeg2000-97.out.rawvideo
stddev: 2.84 PSNR: 39.04 MAXDIFF: 28 bytes: 7603200/ 7603200
stddev: 2.84 PSNR: 39.04 MAXDIFF: 28 bytes: 7603200/ 7603200
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment