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
460bec68
Commit
460bec68
authored
Dec 02, 2011
by
Mashiat Sarker Shakkhar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lms_update()
parent
075ebdf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
wmalosslessdec.c
libavcodec/wmalosslessdec.c
+6
-4
No files found.
libavcodec/wmalosslessdec.c
View file @
460bec68
...
...
@@ -891,21 +891,23 @@ static int lms_predict(WmallDecodeCtx *s, int ich, int ilms)
return
pred
;
}
static
void
lms_update
(
WmallDecodeCtx
*
s
,
int
ich
,
int
ilms
,
int16_t
input
,
int16_t
pred
)
static
void
lms_update
(
WmallDecodeCtx
*
s
,
int
ich
,
int
ilms
,
int16_t
residue
,
int16_t
pred
)
{
int16_t
icoef
;
int
recent
=
s
->
cdlms
[
ich
][
ilms
].
recent
;
int16_t
range
=
(
1
<<
s
->
bits_per_sample
-
1
)
-
1
;
int
bps
=
s
->
bits_per_sample
>
16
?
4
:
2
;
// bytes per sample
int16_t
input
=
residue
+
pred
;
if
(
input
>
pred
)
{
if
(
residue
>
0
)
{
for
(
icoef
=
0
;
icoef
<
s
->
cdlms
[
ich
][
ilms
].
order
;
icoef
++
)
s
->
cdlms
[
ich
][
ilms
].
coefs
[
icoef
]
+=
s
->
cdlms
[
ich
][
ilms
].
lms_updates
[
icoef
+
recent
];
}
else
{
for
(
icoef
=
0
;
icoef
<
s
->
cdlms
[
ich
][
ilms
].
order
;
icoef
++
)
s
->
cdlms
[
ich
][
ilms
].
coefs
[
icoef
]
-=
s
->
cdlms
[
ich
][
ilms
].
lms_updates
[
icoef
];
// XXX: [icoef + recent] ?
s
->
cdlms
[
ich
][
ilms
].
lms_updates
[
icoef
+
recent
];
/* spec mistakenly
dropped the recent */
}
s
->
cdlms
[
ich
][
ilms
].
recent
--
;
s
->
cdlms
[
ich
][
ilms
].
lms_prevvalues
[
recent
]
=
av_clip
(
input
,
-
range
,
range
-
1
);
...
...
@@ -990,8 +992,8 @@ static void revert_cdlms(WmallDecodeCtx *s, int tile_size)
}
for
(
ilms
=
num_lms
-
1
;
ilms
>=
0
;
ilms
--
)
{
pred
=
lms_predict
(
s
,
ich
,
ilms
);
channel_coeff
+=
pred
;
lms_update
(
s
,
ich
,
ilms
,
channel_coeff
,
pred
);
channel_coeff
+=
pred
;
}
if
(
s
->
transient
[
ich
])
{
--
s
->
channel
[
ich
].
transient_counter
;
...
...
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