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
c2e94209
Commit
c2e94209
authored
May 27, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
j2k: drop cblknx/y from Jpeg2000Band
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8c2e201c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
9 deletions
+4
-9
j2k.c
libavcodec/j2k.c
+0
-5
j2k.h
libavcodec/j2k.h
+0
-1
j2kenc.c
libavcodec/j2kenc.c
+4
-3
No files found.
libavcodec/j2k.c
View file @
c2e94209
...
...
@@ -291,17 +291,12 @@ int ff_j2k_init_component(Jpeg2000Component *comp,
log2_band_prec_width
=
reslevel
->
log2_prec_width
-
1
;
log2_band_prec_height
=
reslevel
->
log2_prec_height
-
1
;
}
band
->
cblknx
=
ff_jpeg2000_ceildivpow2
(
band
->
coord
[
0
][
1
],
band
->
log2_cblk_width
)
-
(
band
->
coord
[
0
][
0
]
>>
band
->
log2_cblk_width
);
band
->
cblkny
=
ff_jpeg2000_ceildivpow2
(
band
->
coord
[
1
][
1
],
band
->
log2_cblk_height
)
-
(
band
->
coord
[
1
][
0
]
>>
band
->
log2_cblk_height
);
for
(
j
=
0
;
j
<
2
;
j
++
)
band
->
coord
[
0
][
j
]
=
ff_jpeg2000_ceildiv
(
band
->
coord
[
0
][
j
],
dx
);
for
(
j
=
0
;
j
<
2
;
j
++
)
band
->
coord
[
1
][
j
]
=
ff_jpeg2000_ceildiv
(
band
->
coord
[
1
][
j
],
dy
);
band
->
cblknx
=
ff_jpeg2000_ceildiv
(
band
->
cblknx
,
dx
);
band
->
cblkny
=
ff_jpeg2000_ceildiv
(
band
->
cblkny
,
dy
);
band
->
prec
=
av_malloc_array
(
reslevel
->
num_precincts_x
*
reslevel
->
num_precincts_y
,
sizeof
(
*
band
->
prec
));
...
...
libavcodec/j2k.h
View file @
c2e94209
...
...
@@ -178,7 +178,6 @@ typedef struct Jpeg2000Prec {
typedef
struct
Jpeg2000Band
{
uint16_t
coord
[
2
][
2
];
// border coordinates {{x0, x1}, {y0, y1}}
uint16_t
log2_cblk_width
,
log2_cblk_height
;
uint16_t
cblknx
,
cblkny
;
uint32_t
stepsize
;
// quantization stepsize (* 2^13)
Jpeg2000Prec
*
prec
;
}
Jpeg2000Band
;
// subband
...
...
libavcodec/j2kenc.c
View file @
c2e94209
...
...
@@ -821,6 +821,7 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
for
(
bandno
=
0
;
bandno
<
reslevel
->
nbands
;
bandno
++
){
Jpeg2000Band
*
band
=
reslevel
->
band
+
bandno
;
Jpeg2000Prec
*
prec
=
band
->
prec
;
// we support only 1 precinct per band ATM in the encoder
int
cblkx
,
cblky
,
cblkno
=
0
,
xx0
,
x0
,
xx1
,
y0
,
yy0
,
yy1
,
bandpos
;
yy0
=
bandno
==
0
?
0
:
comp
->
reslevel
[
reslevelno
-
1
].
coord
[
1
][
1
]
-
comp
->
reslevel
[
reslevelno
-
1
].
coord
[
1
][
0
];
y0
=
yy0
;
...
...
@@ -832,7 +833,7 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
bandpos
=
bandno
+
(
reslevelno
>
0
);
for
(
cblky
=
0
;
cblky
<
band
->
cblkny
;
cblky
++
){
for
(
cblky
=
0
;
cblky
<
prec
->
nb_codeblocks_height
;
cblky
++
){
if
(
reslevelno
==
0
||
bandno
==
1
)
xx0
=
0
;
else
...
...
@@ -841,7 +842,7 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
xx1
=
FFMIN
(
ff_jpeg2000_ceildivpow2
(
band
->
coord
[
0
][
0
]
+
1
,
band
->
log2_cblk_width
)
<<
band
->
log2_cblk_width
,
band
->
coord
[
0
][
1
])
-
band
->
coord
[
0
][
0
]
+
xx0
;
for
(
cblkx
=
0
;
cblkx
<
band
->
cblknx
;
cblkx
++
,
cblkno
++
){
for
(
cblkx
=
0
;
cblkx
<
prec
->
nb_codeblocks_width
;
cblkx
++
,
cblkno
++
){
int
y
,
x
;
if
(
codsty
->
transform
==
FF_DWT53
){
for
(
y
=
yy0
;
y
<
yy1
;
y
++
){
...
...
@@ -860,7 +861,7 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
}
}
}
encode_cblk
(
s
,
&
t1
,
band
->
prec
->
cblk
+
cblkno
,
tile
,
xx1
-
xx0
,
yy1
-
yy0
,
encode_cblk
(
s
,
&
t1
,
prec
->
cblk
+
cblkno
,
tile
,
xx1
-
xx0
,
yy1
-
yy0
,
bandpos
,
codsty
->
nreslevels
-
reslevelno
-
1
);
xx0
=
xx1
;
xx1
=
FFMIN
(
xx1
+
(
1
<<
band
->
log2_cblk_width
),
band
->
coord
[
0
][
1
]
-
band
->
coord
[
0
][
0
]
+
x0
);
...
...
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