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
6345184f
Commit
6345184f
authored
Jan 22, 2012
by
Mashiat Sarker Shakkhar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support 24-bit decoding
parent
dc08e7ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
wmalosslessdec.c
libavcodec/wmalosslessdec.c
+9
-9
No files found.
libavcodec/wmalosslessdec.c
View file @
6345184f
...
...
@@ -240,7 +240,7 @@ typedef struct WmallDecodeCtx {
int8_t
mclms_scaling
;
int16_t
mclms_coeffs
[
128
];
int16_t
mclms_coeffs_cur
[
4
];
int
16_t
mclms_prevvalues
[
64
];
// FIXME: should be 32-bit / 16-bit depending on bit-depth
int
mclms_prevvalues
[
64
];
// FIXME: should be 32-bit / 16-bit depending on bit-depth
int16_t
mclms_updates
[
64
];
int
mclms_recent
;
...
...
@@ -253,7 +253,7 @@ typedef struct WmallDecodeCtx {
int
coefsend
;
int
bitsend
;
int16_t
coefs
[
256
];
int
16_t
lms_prevvalues
[
512
];
// FIXME: see above
int
lms_prevvalues
[
512
];
// FIXME: see above
int16_t
lms_updates
[
512
];
// and here too
int
recent
;
}
cdlms
[
2
][
9
];
/* XXX: Here, 2 is the max. no. of channels allowed,
...
...
@@ -770,7 +770,7 @@ static void clear_codec_buffers(WmallDecodeCtx *s)
for
(
ich
=
0
;
ich
<
s
->
num_channels
;
ich
++
)
{
for
(
ilms
=
0
;
ilms
<
s
->
cdlms_ttl
[
ich
];
ilms
++
)
{
memset
(
s
->
cdlms
[
ich
][
ilms
].
coefs
,
0
,
256
*
sizeof
(
int16_t
));
memset
(
s
->
cdlms
[
ich
][
ilms
].
lms_prevvalues
,
0
,
512
*
sizeof
(
int
16_t
));
memset
(
s
->
cdlms
[
ich
][
ilms
].
lms_prevvalues
,
0
,
512
*
sizeof
(
int
));
memset
(
s
->
cdlms
[
ich
][
ilms
].
lms_updates
,
0
,
512
*
sizeof
(
int16_t
));
}
s
->
ave_sum
[
ich
]
=
0
;
...
...
@@ -804,7 +804,7 @@ static void mclms_update(WmallDecodeCtx *s, int icoef, int *pred)
int
order
=
s
->
mclms_order
;
int
num_channels
=
s
->
num_channels
;
int
range
=
1
<<
(
s
->
bits_per_sample
-
1
);
int
bps
=
s
->
bits_per_sample
>
16
?
4
:
2
;
// bytes per sample
//
int bps = s->bits_per_sample > 16 ? 4 : 2; // bytes per sample
for
(
ich
=
0
;
ich
<
num_channels
;
ich
++
)
{
pred_error
=
s
->
channel_residues
[
ich
][
icoef
]
-
pred
[
ich
];
...
...
@@ -849,10 +849,10 @@ static void mclms_update(WmallDecodeCtx *s, int icoef, int *pred)
if
(
s
->
mclms_recent
==
0
)
{
memcpy
(
&
s
->
mclms_prevvalues
[
order
*
num_channels
],
s
->
mclms_prevvalues
,
bps
*
order
*
num_channels
);
4
*
order
*
num_channels
);
memcpy
(
&
s
->
mclms_updates
[
order
*
num_channels
],
s
->
mclms_updates
,
bps
*
order
*
num_channels
);
2
*
order
*
num_channels
);
s
->
mclms_recent
=
num_channels
*
order
;
}
}
...
...
@@ -911,7 +911,7 @@ static void lms_update(WmallDecodeCtx *s, int ich, int ilms, int input, int resi
int
icoef
;
int
recent
=
s
->
cdlms
[
ich
][
ilms
].
recent
;
int
range
=
1
<<
s
->
bits_per_sample
-
1
;
int
bps
=
s
->
bits_per_sample
>
16
?
4
:
2
;
// bytes per sample
//
int bps = s->bits_per_sample > 16 ? 4 : 2; // bytes per sample
if
(
residue
<
0
)
{
for
(
icoef
=
0
;
icoef
<
s
->
cdlms
[
ich
][
ilms
].
order
;
icoef
++
)
...
...
@@ -931,10 +931,10 @@ static void lms_update(WmallDecodeCtx *s, int ich, int ilms, int input, int resi
follow kshishkov's suggestion of using a union. */
memcpy
(
&
s
->
cdlms
[
ich
][
ilms
].
lms_prevvalues
[
s
->
cdlms
[
ich
][
ilms
].
order
],
s
->
cdlms
[
ich
][
ilms
].
lms_prevvalues
,
bps
*
s
->
cdlms
[
ich
][
ilms
].
order
);
4
*
s
->
cdlms
[
ich
][
ilms
].
order
);
memcpy
(
&
s
->
cdlms
[
ich
][
ilms
].
lms_updates
[
s
->
cdlms
[
ich
][
ilms
].
order
],
s
->
cdlms
[
ich
][
ilms
].
lms_updates
,
bps
*
s
->
cdlms
[
ich
][
ilms
].
order
);
2
*
s
->
cdlms
[
ich
][
ilms
].
order
);
recent
=
s
->
cdlms
[
ich
][
ilms
].
order
-
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