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
abc4376b
Commit
abc4376b
authored
Jul 09, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alac: reduce the number of local variables needed in lpc prediction
parent
01880d28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
alac.c
libavcodec/alac.c
+12
-12
No files found.
libavcodec/alac.c
View file @
abc4376b
...
...
@@ -204,28 +204,27 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
/* general case */
for
(
i
=
predictor_coef_num
+
1
;
i
<
output_size
;
i
++
)
{
int
j
;
int
sum
=
0
;
int
outval
;
int
val
=
0
;
int
error_val
=
error_buffer
[
i
];
for
(
j
=
0
;
j
<
predictor_coef_num
;
j
++
)
{
sum
+=
(
buffer_out
[
predictor_coef_num
-
j
]
-
buffer_out
[
0
])
*
val
+=
(
buffer_out
[
predictor_coef_num
-
j
]
-
buffer_out
[
0
])
*
predictor_coef_table
[
j
];
}
outval
=
(
1
<<
(
predictor_quantitization
-
1
))
+
sum
;
outval
=
outval
>>
predictor_quantitization
;
outval
=
outval
+
buffer_out
[
0
]
+
error_val
;
outval
=
sign_extend
(
outval
,
readsamplesize
);
val
=
(
val
+
(
1
<<
(
predictor_quantitization
-
1
)))
>>
predictor_quantitization
;
val
+=
buffer_out
[
0
]
+
error_val
;
buffer_out
[
predictor_coef_num
+
1
]
=
outval
;
buffer_out
[
predictor_coef_num
+
1
]
=
sign_extend
(
val
,
readsamplesize
)
;
if
(
error_val
>
0
)
{
int
predictor_num
=
predictor_coef_num
-
1
;
while
(
predictor_num
>=
0
&&
error_val
>
0
)
{
int
val
=
buffer_out
[
0
]
-
buffer_out
[
predictor_coef_num
-
predictor_num
];
int
sign
=
sign_only
(
val
);
int
sign
;
val
=
buffer_out
[
0
]
-
buffer_out
[
predictor_coef_num
-
predictor_num
];
sign
=
sign_only
(
val
);
predictor_coef_table
[
predictor_num
]
-=
sign
;
...
...
@@ -240,8 +239,9 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
int
predictor_num
=
predictor_coef_num
-
1
;
while
(
predictor_num
>=
0
&&
error_val
<
0
)
{
int
val
=
buffer_out
[
0
]
-
buffer_out
[
predictor_coef_num
-
predictor_num
];
int
sign
=
-
sign_only
(
val
);
int
sign
;
val
=
buffer_out
[
0
]
-
buffer_out
[
predictor_coef_num
-
predictor_num
];
sign
=
-
sign_only
(
val
);
predictor_coef_table
[
predictor_num
]
-=
sign
;
...
...
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