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
cbaa0871
Commit
cbaa0871
authored
May 27, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
j2kenc: switch to cblk in prec
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9fd23baa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
j2kenc.c
libavcodec/j2kenc.c
+16
-13
No files found.
libavcodec/j2kenc.c
View file @
cbaa0871
...
...
@@ -676,9 +676,9 @@ static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, in
for
(
pos
=
0
,
yi
=
prec
->
yi0
;
yi
<
prec
->
yi1
;
yi
++
){
for
(
xi
=
prec
->
xi0
;
xi
<
prec
->
xi1
;
xi
++
,
pos
++
){
prec
->
cblkincl
[
pos
].
val
=
band
->
cblk
[
yi
*
cblknw
+
xi
].
ninclpasses
==
0
;
prec
->
cblkincl
[
pos
].
val
=
prec
->
cblk
[
yi
*
cblknw
+
xi
].
ninclpasses
==
0
;
tag_tree_update
(
prec
->
cblkincl
+
pos
);
prec
->
zerobits
[
pos
].
val
=
expn
[
bandno
]
+
numgbits
-
1
-
band
->
cblk
[
yi
*
cblknw
+
xi
].
nonzerobits
;
prec
->
zerobits
[
pos
].
val
=
expn
[
bandno
]
+
numgbits
-
1
-
prec
->
cblk
[
yi
*
cblknw
+
xi
].
nonzerobits
;
tag_tree_update
(
prec
->
zerobits
+
pos
);
}
}
...
...
@@ -686,7 +686,7 @@ static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, in
for
(
pos
=
0
,
yi
=
prec
->
yi0
;
yi
<
prec
->
yi1
;
yi
++
){
for
(
xi
=
prec
->
xi0
;
xi
<
prec
->
xi1
;
xi
++
,
pos
++
){
int
pad
=
0
,
llen
,
length
;
Jpeg2000Cblk
*
cblk
=
band
->
cblk
+
yi
*
cblknw
+
xi
;
Jpeg2000Cblk
*
cblk
=
prec
->
cblk
+
yi
*
cblknw
+
xi
;
if
(
s
->
buf_end
-
s
->
buf
<
20
)
// approximately
return
-
1
;
...
...
@@ -721,7 +721,7 @@ static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, in
for
(
yi
=
prec
->
yi0
;
yi
<
prec
->
yi1
;
yi
++
){
int
xi
;
for
(
xi
=
prec
->
xi0
;
xi
<
prec
->
xi1
;
xi
++
){
Jpeg2000Cblk
*
cblk
=
band
->
cblk
+
yi
*
cblknw
+
xi
;
Jpeg2000Cblk
*
cblk
=
prec
->
cblk
+
yi
*
cblknw
+
xi
;
if
(
cblk
->
ninclpasses
){
if
(
s
->
buf_end
-
s
->
buf
<
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
rate
)
return
-
1
;
...
...
@@ -776,7 +776,7 @@ static int getcut(Jpeg2000Cblk *cblk, int64_t lambda, int dwt_norm)
static
void
truncpasses
(
Jpeg2000EncoderContext
*
s
,
Jpeg2000Tile
*
tile
)
{
int
compno
,
reslevelno
,
bandno
,
cblkno
,
lev
;
int
precno
,
compno
,
reslevelno
,
bandno
,
cblkno
,
lev
;
Jpeg2000CodingStyle
*
codsty
=
&
s
->
codsty
;
for
(
compno
=
0
;
compno
<
s
->
ncomponents
;
compno
++
){
...
...
@@ -785,15 +785,18 @@ static void truncpasses(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile)
for
(
reslevelno
=
0
,
lev
=
codsty
->
nreslevels
-
1
;
reslevelno
<
codsty
->
nreslevels
;
reslevelno
++
,
lev
--
){
Jpeg2000ResLevel
*
reslevel
=
comp
->
reslevel
+
reslevelno
;
for
(
bandno
=
0
;
bandno
<
reslevel
->
nbands
;
bandno
++
){
int
bandpos
=
bandno
+
(
reslevelno
>
0
);
Jpeg2000Band
*
band
=
reslevel
->
band
+
bandno
;
for
(
precno
=
0
;
precno
<
reslevel
->
num_precincts_x
*
reslevel
->
num_precincts_y
;
precno
++
){
for
(
bandno
=
0
;
bandno
<
reslevel
->
nbands
;
bandno
++
){
int
bandpos
=
bandno
+
(
reslevelno
>
0
);
Jpeg2000Band
*
band
=
reslevel
->
band
+
bandno
;
Jpeg2000Prec
*
prec
=
band
->
prec
+
precno
;
for
(
cblkno
=
0
;
cblkno
<
band
->
cblknx
*
band
->
cblkny
;
cblkno
++
){
Jpeg2000Cblk
*
cblk
=
band
->
cblk
+
cblkno
;
for
(
cblkno
=
0
;
cblkno
<
prec
->
nb_codeblocks_height
*
prec
->
nb_codeblocks_width
;
cblkno
++
){
Jpeg2000Cblk
*
cblk
=
prec
->
cblk
+
cblkno
;
cblk
->
ninclpasses
=
getcut
(
cblk
,
s
->
lambda
,
(
int64_t
)
dwt_norms
[
codsty
->
transform
][
bandpos
][
lev
]
*
(
int64_t
)
band
->
stepsize
>>
13
);
cblk
->
ninclpasses
=
getcut
(
cblk
,
s
->
lambda
,
(
int64_t
)
dwt_norms
[
codsty
->
transform
][
bandpos
][
lev
]
*
(
int64_t
)
band
->
stepsize
>>
13
);
}
}
}
}
...
...
@@ -857,7 +860,7 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
}
}
}
encode_cblk
(
s
,
&
t1
,
band
->
cblk
+
cblkno
,
tile
,
xx1
-
xx0
,
yy1
-
yy0
,
encode_cblk
(
s
,
&
t1
,
band
->
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