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
2fbb9e64
Commit
2fbb9e64
authored
Nov 30, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/wma: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6a2bfd52
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
wma.c
libavcodec/wma.c
+5
-1
wma.h
libavcodec/wma.h
+1
-1
wmadec.c
libavcodec/wmadec.c
+5
-5
wmaenc.c
libavcodec/wmaenc.c
+3
-3
No files found.
libavcodec/wma.c
View file @
2fbb9e64
...
...
@@ -86,7 +86,6 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
return
-
1
;
ff_fmt_convert_init
(
&
s
->
fmt_conv
,
avctx
);
avpriv_float_dsp_init
(
&
s
->
fdsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
if
(
avctx
->
codec
->
id
==
AV_CODEC_ID_WMAV1
)
s
->
version
=
1
;
...
...
@@ -333,6 +332,10 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
#endif
/* TRACE */
}
s
->
fdsp
=
avpriv_float_dsp_alloc
(
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
if
(
!
s
->
fdsp
)
return
AVERROR
(
ENOMEM
);
/* choose the VLC tables for the coefficients */
coef_vlc_table
=
2
;
if
(
avctx
->
sample_rate
>=
32000
)
{
...
...
@@ -383,6 +386,7 @@ int ff_wma_end(AVCodecContext *avctx)
av_freep
(
&
s
->
level_table
[
i
]);
av_freep
(
&
s
->
int_table
[
i
]);
}
av_freep
(
&
s
->
fdsp
);
return
0
;
}
...
...
libavcodec/wma.h
View file @
2fbb9e64
...
...
@@ -132,7 +132,7 @@ typedef struct WMACodecContext {
float
lsp_pow_m_table1
[(
1
<<
LSP_POW_BITS
)];
float
lsp_pow_m_table2
[(
1
<<
LSP_POW_BITS
)];
FmtConvertContext
fmt_conv
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
#ifdef TRACE
int
frame_count
;
...
...
libavcodec/wmadec.c
View file @
2fbb9e64
...
...
@@ -390,14 +390,14 @@ static void wma_window(WMACodecContext *s, float *out)
block_len
=
s
->
block_len
;
bsize
=
s
->
frame_len_bits
-
s
->
block_len_bits
;
s
->
fdsp
.
vector_fmul_add
(
out
,
in
,
s
->
windows
[
bsize
],
s
->
fdsp
->
vector_fmul_add
(
out
,
in
,
s
->
windows
[
bsize
],
out
,
block_len
);
}
else
{
block_len
=
1
<<
s
->
prev_block_len_bits
;
n
=
(
s
->
block_len
-
block_len
)
/
2
;
bsize
=
s
->
frame_len_bits
-
s
->
prev_block_len_bits
;
s
->
fdsp
.
vector_fmul_add
(
out
+
n
,
in
+
n
,
s
->
windows
[
bsize
],
s
->
fdsp
->
vector_fmul_add
(
out
+
n
,
in
+
n
,
s
->
windows
[
bsize
],
out
+
n
,
block_len
);
memcpy
(
out
+
n
+
block_len
,
in
+
n
+
block_len
,
n
*
sizeof
(
float
));
...
...
@@ -411,7 +411,7 @@ static void wma_window(WMACodecContext *s, float *out)
block_len
=
s
->
block_len
;
bsize
=
s
->
frame_len_bits
-
s
->
block_len_bits
;
s
->
fdsp
.
vector_fmul_reverse
(
out
,
in
,
s
->
windows
[
bsize
],
block_len
);
s
->
fdsp
->
vector_fmul_reverse
(
out
,
in
,
s
->
windows
[
bsize
],
block_len
);
}
else
{
block_len
=
1
<<
s
->
next_block_len_bits
;
n
=
(
s
->
block_len
-
block_len
)
/
2
;
...
...
@@ -419,7 +419,7 @@ static void wma_window(WMACodecContext *s, float *out)
memcpy
(
out
,
in
,
n
*
sizeof
(
float
));
s
->
fdsp
.
vector_fmul_reverse
(
out
+
n
,
in
+
n
,
s
->
windows
[
bsize
],
s
->
fdsp
->
vector_fmul_reverse
(
out
+
n
,
in
+
n
,
s
->
windows
[
bsize
],
block_len
);
memset
(
out
+
n
+
block_len
,
0
,
n
*
sizeof
(
float
));
...
...
@@ -738,7 +738,7 @@ static int wma_decode_block(WMACodecContext *s)
s
->
channel_coded
[
0
]
=
1
;
}
s
->
fdsp
.
butterflies_float
(
s
->
coefs
[
0
],
s
->
coefs
[
1
],
s
->
block_len
);
s
->
fdsp
->
butterflies_float
(
s
->
coefs
[
0
],
s
->
coefs
[
1
],
s
->
block_len
);
}
next:
...
...
libavcodec/wmaenc.c
View file @
2fbb9e64
...
...
@@ -107,10 +107,10 @@ static void apply_window_and_mdct(AVCodecContext *avctx, const AVFrame *frame)
for
(
ch
=
0
;
ch
<
avctx
->
channels
;
ch
++
)
{
memcpy
(
s
->
output
,
s
->
frame_out
[
ch
],
window_len
*
sizeof
(
*
s
->
output
));
s
->
fdsp
.
vector_fmul_scalar
(
s
->
frame_out
[
ch
],
audio
[
ch
],
n
,
len
);
s
->
fdsp
.
vector_fmul_reverse
(
&
s
->
output
[
window_len
],
s
->
frame_out
[
ch
],
s
->
fdsp
->
vector_fmul_scalar
(
s
->
frame_out
[
ch
],
audio
[
ch
],
n
,
len
);
s
->
fdsp
->
vector_fmul_reverse
(
&
s
->
output
[
window_len
],
s
->
frame_out
[
ch
],
win
,
len
);
s
->
fdsp
.
vector_fmul
(
s
->
frame_out
[
ch
],
s
->
frame_out
[
ch
],
win
,
len
);
s
->
fdsp
->
vector_fmul
(
s
->
frame_out
[
ch
],
s
->
frame_out
[
ch
],
win
,
len
);
mdct
->
mdct_calc
(
mdct
,
s
->
coefs
[
ch
],
s
->
output
);
}
}
...
...
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