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
fffa4530
Commit
fffa4530
authored
Nov 05, 2011
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify using get_bits_left.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
b9242fd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
rtjpeg.c
libavcodec/rtjpeg.c
+3
-3
No files found.
libavcodec/rtjpeg.c
View file @
fffa4530
...
...
@@ -56,7 +56,7 @@ static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *sc
// number of non-zero coefficients
coeff
=
get_bits
(
gb
,
6
);
if
(
get_bits_
count
(
gb
)
+
(
coeff
<<
1
)
>=
gb
->
size_in_bits
)
if
(
get_bits_
left
(
gb
)
<
(
coeff
<<
1
)
)
return
-
1
;
// normally we would only need to clear the (63 - coeff) last values,
...
...
@@ -73,7 +73,7 @@ static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *sc
// 4 bits per coefficient
ALIGN
(
4
);
if
(
get_bits_
count
(
gb
)
+
(
coeff
<<
2
)
>=
gb
->
size_in_bits
)
if
(
get_bits_
left
(
gb
)
<
(
coeff
<<
2
)
)
return
-
1
;
while
(
coeff
)
{
ac
=
get_sbits
(
gb
,
4
);
...
...
@@ -84,7 +84,7 @@ static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *sc
// 8 bits per coefficient
ALIGN
(
8
);
if
(
get_bits_
count
(
gb
)
+
(
coeff
<<
3
)
>=
gb
->
size_in_bits
)
if
(
get_bits_
left
(
gb
)
<
(
coeff
<<
3
)
)
return
-
1
;
while
(
coeff
)
{
ac
=
get_sbits
(
gb
,
8
);
...
...
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