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
8c2e201c
Commit
8c2e201c
authored
May 27, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
j2k/jpeg2000: drop xi/yi0/1 from Jpeg2000Prec
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a05db52c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
50 deletions
+10
-50
j2k.c
libavcodec/j2k.c
+2
-38
j2k.h
libavcodec/j2k.h
+0
-1
j2kenc.c
libavcodec/j2kenc.c
+8
-8
jpeg2000.h
libavcodec/jpeg2000.h
+0
-1
jpeg2000dec.c
libavcodec/jpeg2000dec.c
+0
-2
No files found.
libavcodec/j2k.c
View file @
8c2e201c
...
...
@@ -243,10 +243,6 @@ int ff_j2k_init_component(Jpeg2000Component *comp,
for
(
bandno
=
0
;
bandno
<
reslevel
->
nbands
;
bandno
++
,
gbandno
++
)
{
Jpeg2000Band
*
band
=
reslevel
->
band
+
bandno
;
int
precx
,
precy
;
int
x0
,
y0
,
x1
,
y1
;
int
xi0
,
yi0
,
xi1
,
yi1
;
int
cblkperprecw
,
cblkperprech
;
int
cblkno
,
precno
;
int
nb_precincts
;
...
...
@@ -314,38 +310,6 @@ int ff_j2k_init_component(Jpeg2000Component *comp,
nb_precincts
=
reslevel
->
num_precincts_x
*
reslevel
->
num_precincts_y
;
y0
=
band
->
coord
[
1
][
0
];
y1
=
((
band
->
coord
[
1
][
0
]
+
(
1
<<
reslevel
->
log2_prec_height
))
&
~
((
1
<<
reslevel
->
log2_prec_height
)
-
1
))
-
y0
;
yi0
=
0
;
yi1
=
ff_jpeg2000_ceildivpow2
(
y1
-
y0
,
codsty
->
log2_cblk_height
)
<<
codsty
->
log2_cblk_height
;
yi1
=
FFMIN
(
yi1
,
band
->
cblkny
);
cblkperprech
=
1
<<
(
reslevel
->
log2_prec_height
-
codsty
->
log2_cblk_height
);
for
(
precy
=
0
,
precno
=
0
;
precy
<
reslevel
->
num_precincts_y
;
precy
++
)
{
for
(
precx
=
0
;
precx
<
reslevel
->
num_precincts_x
;
precx
++
,
precno
++
)
{
band
->
prec
[
precno
].
yi0
=
yi0
;
band
->
prec
[
precno
].
yi1
=
yi1
;
}
yi1
+=
cblkperprech
;
yi0
=
yi1
-
cblkperprech
;
yi1
=
FFMIN
(
yi1
,
band
->
cblkny
);
}
x0
=
band
->
coord
[
0
][
0
];
x1
=
((
band
->
coord
[
0
][
0
]
+
(
1
<<
reslevel
->
log2_prec_width
))
&
~
((
1
<<
reslevel
->
log2_prec_width
)
-
1
))
-
x0
;
xi0
=
0
;
xi1
=
ff_jpeg2000_ceildivpow2
(
x1
-
x0
,
codsty
->
log2_cblk_width
)
<<
codsty
->
log2_cblk_width
;
xi1
=
FFMIN
(
xi1
,
band
->
cblknx
);
cblkperprecw
=
1
<<
(
reslevel
->
log2_prec_width
-
codsty
->
log2_cblk_width
);
for
(
precx
=
0
,
precno
=
0
;
precx
<
reslevel
->
num_precincts_x
;
precx
++
)
{
for
(
precy
=
0
;
precy
<
reslevel
->
num_precincts_y
;
precy
++
,
precno
=
0
)
{
Jpeg2000Prec
*
prec
=
band
->
prec
+
precno
;
prec
->
xi0
=
xi0
;
prec
->
xi1
=
xi1
;
}
xi1
+=
cblkperprecw
;
xi0
=
xi1
-
cblkperprecw
;
xi1
=
FFMIN
(
xi1
,
band
->
cblknx
);
}
for
(
precno
=
0
;
precno
<
nb_precincts
;
precno
++
)
{
Jpeg2000Prec
*
prec
=
band
->
prec
+
precno
;
...
...
@@ -452,8 +416,8 @@ void ff_j2k_reinit(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
Jpeg2000Band
*
band
=
rlevel
->
band
+
bandno
;
for
(
precno
=
0
;
precno
<
rlevel
->
num_precincts_x
*
rlevel
->
num_precincts_y
;
precno
++
)
{
Jpeg2000Prec
*
prec
=
band
->
prec
+
precno
;
tag_tree_zero
(
prec
->
zerobits
,
prec
->
xi1
-
prec
->
xi0
,
prec
->
yi1
-
prec
->
yi0
);
tag_tree_zero
(
prec
->
cblkincl
,
prec
->
xi1
-
prec
->
xi0
,
prec
->
yi1
-
prec
->
yi0
);
tag_tree_zero
(
prec
->
zerobits
,
prec
->
nb_codeblocks_width
,
prec
->
nb_codeblocks_height
);
tag_tree_zero
(
prec
->
cblkincl
,
prec
->
nb_codeblocks_width
,
prec
->
nb_codeblocks_height
);
for
(
cblkno
=
0
;
cblkno
<
prec
->
nb_codeblocks_width
*
prec
->
nb_codeblocks_height
;
cblkno
++
)
{
Jpeg2000Cblk
*
cblk
=
prec
->
cblk
+
cblkno
;
cblk
->
length
=
0
;
...
...
libavcodec/j2k.h
View file @
8c2e201c
...
...
@@ -167,7 +167,6 @@ typedef struct Jpeg2000Cblk {
}
Jpeg2000Cblk
;
// code block
typedef
struct
Jpeg2000Prec
{
uint16_t
xi0
,
xi1
,
yi0
,
yi1
;
// codeblock indexes ([xi0, xi1))
uint16_t
nb_codeblocks_width
;
uint16_t
nb_codeblocks_height
;
Jpeg2000TgtNode
*
zerobits
;
...
...
libavcodec/j2kenc.c
View file @
8c2e201c
...
...
@@ -668,14 +668,14 @@ static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, in
Jpeg2000Band
*
band
=
rlevel
->
band
+
bandno
;
Jpeg2000Prec
*
prec
=
band
->
prec
+
precno
;
int
yi
,
xi
,
pos
;
int
cblknw
=
prec
->
xi1
-
prec
->
xi0
;
int
cblknw
=
prec
->
nb_codeblocks_width
;
if
(
band
->
coord
[
0
][
0
]
==
band
->
coord
[
0
][
1
]
||
band
->
coord
[
1
][
0
]
==
band
->
coord
[
1
][
1
])
continue
;
for
(
pos
=
0
,
yi
=
prec
->
yi0
;
yi
<
prec
->
yi1
;
yi
++
){
for
(
xi
=
prec
->
xi0
;
xi
<
prec
->
xi1
;
xi
++
,
pos
++
){
for
(
pos
=
0
,
yi
=
0
;
yi
<
prec
->
nb_codeblocks_height
;
yi
++
){
for
(
xi
=
0
;
xi
<
cblknw
;
xi
++
,
pos
++
){
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
-
prec
->
cblk
[
yi
*
cblknw
+
xi
].
nonzerobits
;
...
...
@@ -683,8 +683,8 @@ 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
++
){
for
(
pos
=
0
,
yi
=
0
;
yi
<
prec
->
nb_codeblocks_height
;
yi
++
){
for
(
xi
=
0
;
xi
<
cblknw
;
xi
++
,
pos
++
){
int
pad
=
0
,
llen
,
length
;
Jpeg2000Cblk
*
cblk
=
prec
->
cblk
+
yi
*
cblknw
+
xi
;
...
...
@@ -717,10 +717,10 @@ static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, in
for
(
bandno
=
0
;
bandno
<
rlevel
->
nbands
;
bandno
++
){
Jpeg2000Band
*
band
=
rlevel
->
band
+
bandno
;
Jpeg2000Prec
*
prec
=
band
->
prec
+
precno
;
int
yi
,
cblknw
=
prec
->
xi1
-
prec
->
xi0
;
for
(
yi
=
prec
->
yi0
;
yi
<
prec
->
yi1
;
yi
++
){
int
yi
,
cblknw
=
prec
->
nb_codeblocks_width
;
for
(
yi
=
0
;
yi
<
prec
->
nb_codeblocks_height
;
yi
++
){
int
xi
;
for
(
xi
=
prec
->
xi0
;
xi
<
prec
->
xi1
;
xi
++
){
for
(
xi
=
0
;
xi
<
cblknw
;
xi
++
){
Jpeg2000Cblk
*
cblk
=
prec
->
cblk
+
yi
*
cblknw
+
xi
;
if
(
cblk
->
ninclpasses
){
if
(
s
->
buf_end
-
s
->
buf
<
cblk
->
passes
[
cblk
->
ninclpasses
-
1
].
rate
)
...
...
libavcodec/jpeg2000.h
View file @
8c2e201c
...
...
@@ -168,7 +168,6 @@ typedef struct Jpeg2000Cblk {
}
Jpeg2000Cblk
;
// code block
typedef
struct
Jpeg2000Prec
{
uint16_t
xi0
,
yi0
;
// codeblock indexes ([xi0, xi1))
uint16_t
nb_codeblocks_width
;
uint16_t
nb_codeblocks_height
;
Jpeg2000TgtNode
*
zerobits
;
...
...
libavcodec/jpeg2000dec.c
View file @
8c2e201c
...
...
@@ -605,8 +605,6 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
if
(
band
->
coord
[
0
][
0
]
==
band
->
coord
[
0
][
1
]
||
band
->
coord
[
1
][
0
]
==
band
->
coord
[
1
][
1
])
continue
;
prec
->
yi0
=
0
;
prec
->
xi0
=
0
;
nb_code_blocks
=
prec
->
nb_codeblocks_height
*
prec
->
nb_codeblocks_width
;
for
(
cblkno
=
0
;
cblkno
<
nb_code_blocks
;
cblkno
++
)
{
...
...
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