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
a67816bc
Commit
a67816bc
authored
Apr 30, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/wmalosslessdec: fix decoding of raw pcm tiles
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
675cfb2f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
wmalosslessdec.c
libavcodec/wmalosslessdec.c
+21
-18
No files found.
libavcodec/wmalosslessdec.c
View file @
a67816bc
...
@@ -172,8 +172,6 @@ typedef struct WmallDecodeCtx {
...
@@ -172,8 +172,6 @@ typedef struct WmallDecodeCtx {
int
lpc_order
;
int
lpc_order
;
int
lpc_scaling
;
int
lpc_scaling
;
int
lpc_intbits
;
int
lpc_intbits
;
int
channel_coeffs
[
WMALL_MAX_CHANNELS
][
WMALL_BLOCK_MAX_SIZE
];
}
WmallDecodeCtx
;
}
WmallDecodeCtx
;
/** Get sign of integer (1 for positive, -1 for negative and 0 for zero) */
/** Get sign of integer (1 for positive, -1 for negative and 0 for zero) */
...
@@ -897,14 +895,17 @@ static int decode_subframe(WmallDecodeCtx *s)
...
@@ -897,14 +895,17 @@ static int decode_subframe(WmallDecodeCtx *s)
s
->
quant_stepsize
=
get_bits
(
&
s
->
gb
,
8
)
+
1
;
s
->
quant_stepsize
=
get_bits
(
&
s
->
gb
,
8
)
+
1
;
reset_codec
(
s
);
reset_codec
(
s
);
}
else
if
(
!
s
->
cdlms
[
0
][
0
].
order
)
{
}
rawpcm_tile
=
get_bits1
(
&
s
->
gb
);
if
(
!
rawpcm_tile
&&
!
s
->
cdlms
[
0
][
0
].
order
)
{
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"Waiting for seekable tile
\n
"
);
"Waiting for seekable tile
\n
"
);
av_frame_unref
(
s
->
frame
);
av_frame_unref
(
s
->
frame
);
return
-
1
;
return
-
1
;
}
}
rawpcm_tile
=
get_bits1
(
&
s
->
gb
);
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
s
->
is_channel_coded
[
i
]
=
1
;
s
->
is_channel_coded
[
i
]
=
1
;
...
@@ -943,9 +944,9 @@ static int decode_subframe(WmallDecodeCtx *s)
...
@@ -943,9 +944,9 @@ static int decode_subframe(WmallDecodeCtx *s)
bits
*
s
->
num_channels
*
subframe_len
,
get_bits_count
(
&
s
->
gb
));
bits
*
s
->
num_channels
*
subframe_len
,
get_bits_count
(
&
s
->
gb
));
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
for
(
j
=
0
;
j
<
subframe_len
;
j
++
)
for
(
j
=
0
;
j
<
subframe_len
;
j
++
)
s
->
channel_
coeff
s
[
i
][
j
]
=
get_sbits_long
(
&
s
->
gb
,
bits
);
s
->
channel_
residue
s
[
i
][
j
]
=
get_sbits_long
(
&
s
->
gb
,
bits
);
}
else
{
}
else
{
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
{
if
(
s
->
is_channel_coded
[
i
])
{
if
(
s
->
is_channel_coded
[
i
])
{
decode_channel_residues
(
s
,
i
,
subframe_len
);
decode_channel_residues
(
s
,
i
,
subframe_len
);
if
(
s
->
seekable_tile
)
if
(
s
->
seekable_tile
)
...
@@ -957,6 +958,7 @@ static int decode_subframe(WmallDecodeCtx *s)
...
@@ -957,6 +958,7 @@ static int decode_subframe(WmallDecodeCtx *s)
memset
(
s
->
channel_residues
[
i
],
0
,
sizeof
(
**
s
->
channel_residues
)
*
subframe_len
);
memset
(
s
->
channel_residues
[
i
],
0
,
sizeof
(
**
s
->
channel_residues
)
*
subframe_len
);
}
}
}
}
if
(
s
->
do_mclms
)
if
(
s
->
do_mclms
)
revert_mclms
(
s
,
subframe_len
);
revert_mclms
(
s
,
subframe_len
);
if
(
s
->
do_inter_ch_decorr
)
if
(
s
->
do_inter_ch_decorr
)
...
@@ -969,6 +971,7 @@ static int decode_subframe(WmallDecodeCtx *s)
...
@@ -969,6 +971,7 @@ static int decode_subframe(WmallDecodeCtx *s)
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
for
(
i
=
0
;
i
<
s
->
num_channels
;
i
++
)
for
(
j
=
0
;
j
<
subframe_len
;
j
++
)
for
(
j
=
0
;
j
<
subframe_len
;
j
++
)
s
->
channel_residues
[
i
][
j
]
*=
s
->
quant_stepsize
;
s
->
channel_residues
[
i
][
j
]
*=
s
->
quant_stepsize
;
}
/* Write to proper output buffer depending on bit-depth */
/* Write to proper output buffer depending on bit-depth */
for
(
i
=
0
;
i
<
s
->
channels_for_cur_subframe
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
channels_for_cur_subframe
;
i
++
)
{
...
...
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