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
d9841e53
Commit
d9841e53
authored
Jun 14, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/jpeg2000: Change precinct coords to same origin as bands
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
59c10729
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
jpeg2000.c
libavcodec/jpeg2000.c
+12
-12
No files found.
libavcodec/jpeg2000.c
View file @
d9841e53
...
...
@@ -382,24 +382,24 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
/* TODO: Verify with previous count of codeblocks per band */
/* Compute P_x0 */
prec
->
coord
[
0
][
0
]
=
(
precno
%
reslevel
->
num_precincts_x
)
*
prec
->
coord
[
0
][
0
]
=
(
(
band
->
coord
[
0
][
0
]
>>
reslevel
->
log2_prec_width
)
+
precno
%
reslevel
->
num_precincts_x
)
*
(
1
<<
log2_band_prec_width
);
prec
->
coord
[
0
][
0
]
=
FFMAX
(
prec
->
coord
[
0
][
0
],
band
->
coord
[
0
][
0
]
-
band
->
coord
[
0
][
0
]
);
prec
->
coord
[
0
][
0
]
=
FFMAX
(
prec
->
coord
[
0
][
0
],
band
->
coord
[
0
][
0
]);
/* Compute P_y0 */
prec
->
coord
[
1
][
0
]
=
(
precno
/
reslevel
->
num_precincts_x
)
*
prec
->
coord
[
1
][
0
]
=
(
(
band
->
coord
[
1
][
0
]
>>
reslevel
->
log2_prec_height
)
+
precno
/
reslevel
->
num_precincts_x
)
*
(
1
<<
log2_band_prec_height
);
prec
->
coord
[
1
][
0
]
=
FFMAX
(
prec
->
coord
[
1
][
0
],
band
->
coord
[
1
][
0
]
-
band
->
coord
[
1
][
0
]
);
prec
->
coord
[
1
][
0
]
=
FFMAX
(
prec
->
coord
[
1
][
0
],
band
->
coord
[
1
][
0
]);
/* Compute P_x1 */
prec
->
coord
[
0
][
1
]
=
prec
->
coord
[
0
][
0
]
+
(
1
<<
log2_band_prec_width
);
prec
->
coord
[
0
][
1
]
=
FFMIN
(
prec
->
coord
[
0
][
1
],
band
->
coord
[
0
][
1
]
-
band
->
coord
[
0
][
0
]
);
prec
->
coord
[
0
][
1
]
=
FFMIN
(
prec
->
coord
[
0
][
1
],
band
->
coord
[
0
][
1
]);
/* Compute P_y1 */
prec
->
coord
[
1
][
1
]
=
prec
->
coord
[
1
][
0
]
+
(
1
<<
log2_band_prec_height
);
prec
->
coord
[
1
][
1
]
=
FFMIN
(
prec
->
coord
[
1
][
1
],
band
->
coord
[
1
][
1
]
-
band
->
coord
[
1
][
0
]
);
prec
->
coord
[
1
][
1
]
=
FFMIN
(
prec
->
coord
[
1
][
1
],
band
->
coord
[
1
][
1
]);
prec
->
nb_codeblocks_width
=
ff_jpeg2000_ceildivpow2
(
prec
->
coord
[
0
][
1
]
-
...
...
@@ -437,22 +437,22 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
/* Compute coordinates of codeblocks */
/* Compute Cx0*/
Cx0
=
(
prec
->
coord
[
0
][
0
]
>>
band
->
log2_cblk_width
)
<<
band
->
log2_cblk_width
;
Cx0
=
(
(
prec
->
coord
[
0
][
0
]
-
band
->
coord
[
0
][
0
])
>>
band
->
log2_cblk_width
)
<<
band
->
log2_cblk_width
;
Cx0
=
Cx0
+
((
cblkno
%
prec
->
nb_codeblocks_width
)
<<
band
->
log2_cblk_width
);
cblk
->
coord
[
0
][
0
]
=
FFMAX
(
Cx0
,
prec
->
coord
[
0
][
0
]);
cblk
->
coord
[
0
][
0
]
=
FFMAX
(
Cx0
,
prec
->
coord
[
0
][
0
]
-
band
->
coord
[
0
][
0
]
);
/* Compute Cy0*/
Cy0
=
(
prec
->
coord
[
1
][
0
]
>>
band
->
log2_cblk_height
)
<<
band
->
log2_cblk_height
;
Cy0
=
(
(
prec
->
coord
[
1
][
0
]
-
band
->
coord
[
1
][
0
])
>>
band
->
log2_cblk_height
)
<<
band
->
log2_cblk_height
;
Cy0
=
Cy0
+
((
cblkno
/
prec
->
nb_codeblocks_width
)
<<
band
->
log2_cblk_height
);
cblk
->
coord
[
1
][
0
]
=
FFMAX
(
Cy0
,
prec
->
coord
[
1
][
0
]);
cblk
->
coord
[
1
][
0
]
=
FFMAX
(
Cy0
,
prec
->
coord
[
1
][
0
]
-
band
->
coord
[
1
][
0
]
);
/* Compute Cx1 */
cblk
->
coord
[
0
][
1
]
=
FFMIN
(
Cx0
+
(
1
<<
band
->
log2_cblk_width
),
prec
->
coord
[
0
][
1
]);
prec
->
coord
[
0
][
1
]
-
band
->
coord
[
0
][
0
]
);
/* Compute Cy1 */
cblk
->
coord
[
1
][
1
]
=
FFMIN
(
Cy0
+
(
1
<<
band
->
log2_cblk_height
),
prec
->
coord
[
1
][
1
]);
prec
->
coord
[
1
][
1
]
-
band
->
coord
[
1
][
0
]
);
/* Update code-blocks coordinates according sub-band position */
if
((
bandno
+
!!
reslevelno
)
&
1
)
{
cblk
->
coord
[
0
][
0
]
+=
comp
->
reslevel
[
reslevelno
-
1
].
coord
[
0
][
1
]
-
...
...
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