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
fc9ced41
Commit
fc9ced41
authored
Nov 29, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/twinvq: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2336c76d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
twinvq.c
libavcodec/twinvq.c
+10
-5
twinvq.h
libavcodec/twinvq.h
+1
-1
No files found.
libavcodec/twinvq.c
View file @
fc9ced41
...
...
@@ -358,7 +358,7 @@ static void imdct_and_window(TwinVQContext *tctx, enum TwinVQFrameType ftype,
mdct
->
imdct_half
(
mdct
,
buf1
+
bsize
*
j
,
in
+
bsize
*
j
);
tctx
->
fdsp
.
vector_fmul_window
(
out2
,
prev_buf
+
(
bsize
-
wsize
)
/
2
,
tctx
->
fdsp
->
vector_fmul_window
(
out2
,
prev_buf
+
(
bsize
-
wsize
)
/
2
,
buf1
+
bsize
*
j
,
ff_sine_windows
[
av_log2
(
wsize
)],
wsize
/
2
);
...
...
@@ -405,7 +405,7 @@ static void imdct_output(TwinVQContext *tctx, enum TwinVQFrameType ftype,
size1
*
sizeof
(
*
out2
));
memcpy
(
out2
+
size1
,
&
tctx
->
curr_frame
[
2
*
mtab
->
size
],
size2
*
sizeof
(
*
out2
));
tctx
->
fdsp
.
butterflies_float
(
out1
,
out2
,
mtab
->
size
);
tctx
->
fdsp
->
butterflies_float
(
out1
,
out2
,
mtab
->
size
);
}
}
...
...
@@ -446,7 +446,7 @@ static void read_and_decode_spectrum(TwinVQContext *tctx, float *out,
bits
->
bark_use_hist
[
i
][
j
],
i
,
tctx
->
tmp_buf
,
gain
[
sub
*
i
+
j
],
ftype
);
tctx
->
fdsp
.
vector_fmul
(
chunk
+
block_size
*
j
,
tctx
->
fdsp
->
vector_fmul
(
chunk
+
block_size
*
j
,
chunk
+
block_size
*
j
,
tctx
->
tmp_buf
,
block_size
);
}
...
...
@@ -461,7 +461,7 @@ static void read_and_decode_spectrum(TwinVQContext *tctx, float *out,
dec_lpc_spectrum_inv
(
tctx
,
lsp
,
ftype
,
tctx
->
tmp_buf
);
for
(
j
=
0
;
j
<
mtab
->
fmode
[
ftype
].
sub
;
j
++
)
{
tctx
->
fdsp
.
vector_fmul
(
chunk
,
chunk
,
tctx
->
tmp_buf
,
block_size
);
tctx
->
fdsp
->
vector_fmul
(
chunk
,
chunk
,
tctx
->
tmp_buf
,
block_size
);
chunk
+=
block_size
;
}
}
...
...
@@ -762,6 +762,7 @@ av_cold int ff_twinvq_decode_close(AVCodecContext *avctx)
av_freep
(
&
tctx
->
spectrum
);
av_freep
(
&
tctx
->
prev_frame
);
av_freep
(
&
tctx
->
tmp_buf
);
av_freep
(
&
tctx
->
fdsp
);
return
0
;
}
...
...
@@ -788,7 +789,11 @@ av_cold int ff_twinvq_decode_init(AVCodecContext *avctx)
return
AVERROR_INVALIDDATA
;
}
avpriv_float_dsp_init
(
&
tctx
->
fdsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
tctx
->
fdsp
=
avpriv_float_dsp_alloc
(
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
if
(
!
tctx
->
fdsp
)
{
ff_twinvq_decode_close
(
avctx
);
return
AVERROR
(
ENOMEM
);
}
if
((
ret
=
init_mdct_win
(
tctx
)))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error initializing MDCT
\n
"
);
ff_twinvq_decode_close
(
avctx
);
...
...
libavcodec/twinvq.h
View file @
fc9ced41
...
...
@@ -136,7 +136,7 @@ typedef struct TwinVQModeTab {
typedef
struct
TwinVQContext
{
AVCodecContext
*
avctx
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
FFTContext
mdct_ctx
[
3
];
const
TwinVQModeTab
*
mtab
;
...
...
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