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
46246567
Commit
46246567
authored
Jun 17, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/j2kenc: Properly flush the end of the truncated AC stream
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e6190045
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
36 deletions
+40
-36
j2kenc.c
libavcodec/j2kenc.c
+6
-4
jpeg2000.h
libavcodec/jpeg2000.h
+2
-0
vsynth1-jpeg2000
tests/ref/vsynth/vsynth1-jpeg2000
+4
-4
vsynth1-jpeg2000-97
tests/ref/vsynth/vsynth1-jpeg2000-97
+4
-4
vsynth2-jpeg2000
tests/ref/vsynth/vsynth2-jpeg2000
+4
-4
vsynth2-jpeg2000-97
tests/ref/vsynth/vsynth2-jpeg2000-97
+4
-4
vsynth3-jpeg2000
tests/ref/vsynth/vsynth3-jpeg2000
+4
-4
vsynth3-jpeg2000-97
tests/ref/vsynth/vsynth3-jpeg2000-97
+4
-4
vsynth_lena-jpeg2000
tests/ref/vsynth/vsynth_lena-jpeg2000
+4
-4
vsynth_lena-jpeg2000-97
tests/ref/vsynth/vsynth_lena-jpeg2000-97
+4
-4
No files found.
libavcodec/j2kenc.c
View file @
46246567
...
...
@@ -612,7 +612,7 @@ static void encode_cblk(Jpeg2000EncoderContext *s, Jpeg2000T1Context *t1, Jpeg20
break
;
}
cblk
->
passes
[
passno
].
rate
=
3
+
ff_mqc_length
(
&
t1
->
mqc
);
cblk
->
passes
[
passno
].
rate
=
ff_mqc_flush_to
(
&
t1
->
mqc
,
cblk
->
passes
[
passno
].
flushed
,
&
cblk
->
passes
[
passno
].
flushed_len
);
wmsedec
+=
(
int64_t
)
nmsedec
<<
(
2
*
bpno
);
cblk
->
passes
[
passno
].
disto
=
wmsedec
;
...
...
@@ -624,8 +624,7 @@ static void encode_cblk(Jpeg2000EncoderContext *s, Jpeg2000T1Context *t1, Jpeg20
cblk
->
npasses
=
passno
;
cblk
->
ninclpasses
=
passno
;
// TODO: optional flush on each pass
cblk
->
passes
[
passno
-
1
].
rate
=
ff_mqc_flush
(
&
t1
->
mqc
);
cblk
->
passes
[
passno
-
1
].
rate
=
ff_mqc_flush_to
(
&
t1
->
mqc
,
cblk
->
passes
[
passno
-
1
].
flushed
,
&
cblk
->
passes
[
passno
-
1
].
flushed_len
);
}
/* tier-2 routines: */
...
...
@@ -732,7 +731,10 @@ static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, in
if
(
cblk
->
ninclpasses
){
if
(
s
->
buf_end
-
s
->
buf
<
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
rate
)
return
-
1
;
bytestream_put_buffer
(
&
s
->
buf
,
cblk
->
data
,
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
rate
);
bytestream_put_buffer
(
&
s
->
buf
,
cblk
->
data
,
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
rate
-
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
flushed_len
);
bytestream_put_buffer
(
&
s
->
buf
,
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
flushed
,
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
flushed_len
);
}
}
}
...
...
libavcodec/jpeg2000.h
View file @
46246567
...
...
@@ -159,6 +159,8 @@ typedef struct Jpeg2000QuantStyle {
typedef
struct
Jpeg2000Pass
{
uint16_t
rate
;
int64_t
disto
;
uint8_t
flushed
[
4
];
int
flushed_len
;
}
Jpeg2000Pass
;
typedef
struct
Jpeg2000Cblk
{
...
...
tests/ref/vsynth/vsynth1-jpeg2000
View file @
46246567
ed9c45dc090a03c2eb9c35cf76e4d914
*tests/data/fate/vsynth1-jpeg2000.avi
2
306906
tests/data/fate/vsynth1-jpeg2000.avi
64166a8fbb730a7a132c50ee8959267
2 *tests/data/fate/vsynth1-jpeg2000.out.rawvideo
stddev: 5.
41 PSNR: 33.46 MAXDIFF: 63
bytes: 7603200/ 7603200
445742f01d5ace759fef5c6bdcfda473
*tests/data/fate/vsynth1-jpeg2000.avi
2
257170
tests/data/fate/vsynth1-jpeg2000.avi
5cdeb5efd2343994b949718e278819f
2 *tests/data/fate/vsynth1-jpeg2000.out.rawvideo
stddev: 5.
37 PSNR: 33.53 MAXDIFF: 60
bytes: 7603200/ 7603200
tests/ref/vsynth/vsynth1-jpeg2000-97
View file @
46246567
95a06cbed5f085f5081653ec55a4dfe3
*tests/data/fate/vsynth1-jpeg2000-97.avi
2
243132
tests/data/fate/vsynth1-jpeg2000-97.avi
cc52cfa56b1bbd0fb011af37a2b9417
0 *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
stddev: 6.2
3 PSNR: 32.23 MAXDIFF: 75
bytes: 7603200/ 7603200
a6d84f1c576f3eb7d4ea37d0e4a3b84b
*tests/data/fate/vsynth1-jpeg2000-97.avi
2
195974
tests/data/fate/vsynth1-jpeg2000-97.avi
99f8f9436e6d9d42a71e3d2a90de61d
0 *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
stddev: 6.2
1 PSNR: 32.27 MAXDIFF: 60
bytes: 7603200/ 7603200
tests/ref/vsynth/vsynth2-jpeg2000
View file @
46246567
b918de21dec4310f87af3788ed458462
*tests/data/fate/vsynth2-jpeg2000.avi
1
513144
tests/data/fate/vsynth2-jpeg2000.avi
d30f637670a60de6cc8d177047f32a59
*tests/data/fate/vsynth2-jpeg2000.out.rawvideo
stddev: 5.0
4 PSNR: 34.07 MAXDIFF: 71
bytes: 7603200/ 7603200
5e6963f14c74c374158bca007f9fd704
*tests/data/fate/vsynth2-jpeg2000.avi
1
491518
tests/data/fate/vsynth2-jpeg2000.avi
025b1592f31bc71bb249af7e1124b50b
*tests/data/fate/vsynth2-jpeg2000.out.rawvideo
stddev: 5.0
0 PSNR: 34.14 MAXDIFF: 59
bytes: 7603200/ 7603200
tests/ref/vsynth/vsynth2-jpeg2000-97
View file @
46246567
156d67def9f0c1818a3e338bf85059c6
*tests/data/fate/vsynth2-jpeg2000-97.avi
14
67526
tests/data/fate/vsynth2-jpeg2000-97.avi
f9bd95734ebc92843cfd66b418bbdb96
*tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
stddev: 5.4
4 PSNR: 33.42 MAXDIFF: 57
bytes: 7603200/ 7603200
228d4e9f4fde3cd5ef78c65506a1f85b
*tests/data/fate/vsynth2-jpeg2000-97.avi
14
47470
tests/data/fate/vsynth2-jpeg2000-97.avi
3351e4a11b4da2971194be7f571f2655
*tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
stddev: 5.4
0 PSNR: 33.47 MAXDIFF: 58
bytes: 7603200/ 7603200
tests/ref/vsynth/vsynth3-jpeg2000
View file @
46246567
7ea4e3901817f06a3de59ee70836f5d9
*tests/data/fate/vsynth3-jpeg2000.avi
6
3772
tests/data/fate/vsynth3-jpeg2000.avi
ddfc0e8e033aeecf334c1450148dab44
*tests/data/fate/vsynth3-jpeg2000.out.rawvideo
stddev: 5.
52 PSNR: 33.28 MAXDIFF: 48
bytes: 86700/ 86700
9840f4a4fac08b00762fd377d6586772
*tests/data/fate/vsynth3-jpeg2000.avi
6
1294
tests/data/fate/vsynth3-jpeg2000.avi
861d660c6618202cbbc70b71d5eae25b
*tests/data/fate/vsynth3-jpeg2000.out.rawvideo
stddev: 5.
49 PSNR: 33.32 MAXDIFF: 47
bytes: 86700/ 86700
tests/ref/vsynth/vsynth3-jpeg2000-97
View file @
46246567
3e2f1e7d009d05e2bb9e8c3b10fab134
*tests/data/fate/vsynth3-jpeg2000-97.avi
6
5364
tests/data/fate/vsynth3-jpeg2000-97.avi
f9dad7a31175e400ca35de60aec826fd
*tests/data/fate/vsynth3-jpeg2000-97.out.rawvideo
stddev: 6.2
7 PSNR: 32.17 MAXDIFF: 52
bytes: 86700/ 86700
65bf9803b13ae90b71e0e3caaa68719b
*tests/data/fate/vsynth3-jpeg2000-97.avi
6
2672
tests/data/fate/vsynth3-jpeg2000-97.avi
38058e324177a0ff064b48497ac2af4b
*tests/data/fate/vsynth3-jpeg2000-97.out.rawvideo
stddev: 6.2
6 PSNR: 32.19 MAXDIFF: 54
bytes: 86700/ 86700
tests/ref/vsynth/vsynth_lena-jpeg2000
View file @
46246567
9283c83bc8dc830bd48ad66f71ae42e
8 *tests/data/fate/vsynth_lena-jpeg2000.avi
11
5114
8 tests/data/fate/vsynth_lena-jpeg2000.avi
7
1a9ee7ad7c3dad60aa6641712c1f9e4
*tests/data/fate/vsynth_lena-jpeg2000.out.rawvideo
stddev: 4.4
4 PSNR: 35.17 MAXDIFF: 61
bytes: 7603200/ 7603200
b312f1eddda3aed23030495029d5588
8 *tests/data/fate/vsynth_lena-jpeg2000.avi
11
3318
8 tests/data/fate/vsynth_lena-jpeg2000.avi
7
630a7f2ae57be5827b4ade8323717e5
*tests/data/fate/vsynth_lena-jpeg2000.out.rawvideo
stddev: 4.4
1 PSNR: 35.24 MAXDIFF: 58
bytes: 7603200/ 7603200
tests/ref/vsynth/vsynth_lena-jpeg2000-97
View file @
46246567
52771e812599277d65585b5849836bda
*tests/data/fate/vsynth_lena-jpeg2000-97.avi
11
18958
tests/data/fate/vsynth_lena-jpeg2000-97.avi
1e53a235d1378010e14859d4d0d740f7
*tests/data/fate/vsynth_lena-jpeg2000-97.out.rawvideo
stddev: 4.9
4 PSNR: 34.24 MAXDIFF: 60
bytes: 7603200/ 7603200
8e34a7e90f1363994fc2ce071b9bfc0f
*tests/data/fate/vsynth_lena-jpeg2000-97.avi
11
02144
tests/data/fate/vsynth_lena-jpeg2000-97.avi
44f4d7a4cb6b0de932e2538fa75e983c
*tests/data/fate/vsynth_lena-jpeg2000-97.out.rawvideo
stddev: 4.9
1 PSNR: 34.30 MAXDIFF: 54
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