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
ea98507d
Commit
ea98507d
authored
Jul 02, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flacdec: simplify loop in decode_residuals()
parent
957521e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
flacdec.c
libavcodec/flacdec.c
+6
-2
No files found.
libavcodec/flacdec.c
View file @
ea98507d
...
...
@@ -207,6 +207,7 @@ static int get_metadata_size(const uint8_t *buf, int buf_size)
static
int
decode_residuals
(
FLACContext
*
s
,
int
channel
,
int
pred_order
)
{
int
i
,
tmp
,
partition
,
method_type
,
rice_order
;
int
rice_bits
,
rice_esc
;
int
sample
=
0
,
samples
;
method_type
=
get_bits
(
&
s
->
gb
,
2
);
...
...
@@ -225,11 +226,14 @@ static int decode_residuals(FLACContext *s, int channel, int pred_order)
return
-
1
;
}
rice_bits
=
4
+
method_type
;
rice_esc
=
(
1
<<
rice_bits
)
-
1
;
sample
=
i
=
pred_order
;
for
(
partition
=
0
;
partition
<
(
1
<<
rice_order
);
partition
++
)
{
tmp
=
get_bits
(
&
s
->
gb
,
method_type
==
0
?
4
:
5
);
if
(
tmp
==
(
method_type
==
0
?
15
:
31
)
)
{
tmp
=
get_bits
(
&
s
->
gb
,
rice_bits
);
if
(
tmp
==
rice_esc
)
{
tmp
=
get_bits
(
&
s
->
gb
,
5
);
for
(;
i
<
samples
;
i
++
,
sample
++
)
s
->
decoded
[
channel
][
sample
]
=
get_sbits_long
(
&
s
->
gb
,
tmp
);
...
...
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