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
5cd1337f
Commit
5cd1337f
authored
Feb 29, 2012
by
Vitor Sessak
Committed by
Ronald S. Bultje
Feb 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nellymoserdec: Saner and faster IMDCT windowing
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
882abda5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
nellymoserdec.c
libavcodec/nellymoserdec.c
+8
-8
No files found.
libavcodec/nellymoserdec.c
View file @
5cd1337f
...
...
@@ -49,14 +49,15 @@ typedef struct NellyMoserDecodeContext {
AVCodecContext
*
avctx
;
AVFrame
frame
;
float
*
float_buf
;
DECLARE_ALIGNED
(
16
,
float
,
state
)[
NELLY_BUF_LEN
];
AVLFG
random_state
;
GetBitContext
gb
;
float
scale_bias
;
DSPContext
dsp
;
FFTContext
imdct_ctx
;
FmtConvertContext
fmt_conv
;
DECLARE_ALIGNED
(
32
,
float
,
imdct_out
)[
NELLY_BUF_LEN
*
2
];
DECLARE_ALIGNED
(
32
,
float
,
imdct_buf
)[
2
][
NELLY_BUF_LEN
];
float
*
imdct_out
;
float
*
imdct_prev
;
}
NellyMoserDecodeContext
;
static
void
nelly_decode_block
(
NellyMoserDecodeContext
*
s
,
...
...
@@ -106,12 +107,9 @@ static void nelly_decode_block(NellyMoserDecodeContext *s,
memset
(
&
aptr
[
NELLY_FILL_LEN
],
0
,
(
NELLY_BUF_LEN
-
NELLY_FILL_LEN
)
*
sizeof
(
float
));
s
->
imdct_ctx
.
imdct_calc
(
&
s
->
imdct_ctx
,
s
->
imdct_out
,
aptr
);
/* XXX: overlapping and windowing should be part of a more
generic imdct function */
s
->
dsp
.
vector_fmul_reverse
(
s
->
state
,
s
->
state
,
ff_sine_128
,
NELLY_BUF_LEN
);
s
->
dsp
.
vector_fmul_add
(
aptr
,
s
->
imdct_out
,
ff_sine_128
,
s
->
state
,
NELLY_BUF_LEN
);
memcpy
(
s
->
state
,
s
->
imdct_out
+
NELLY_BUF_LEN
,
sizeof
(
float
)
*
NELLY_BUF_LEN
);
s
->
imdct_ctx
.
imdct_half
(
&
s
->
imdct_ctx
,
s
->
imdct_out
,
aptr
);
s
->
dsp
.
vector_fmul_window
(
aptr
,
s
->
imdct_prev
+
NELLY_BUF_LEN
/
2
,
s
->
imdct_out
,
ff_sine_128
,
NELLY_BUF_LEN
/
2
);
FFSWAP
(
float
*
,
s
->
imdct_out
,
s
->
imdct_prev
);
}
}
...
...
@@ -119,6 +117,8 @@ static av_cold int decode_init(AVCodecContext * avctx) {
NellyMoserDecodeContext
*
s
=
avctx
->
priv_data
;
s
->
avctx
=
avctx
;
s
->
imdct_out
=
s
->
imdct_buf
[
0
];
s
->
imdct_prev
=
s
->
imdct_buf
[
1
];
av_lfg_init
(
&
s
->
random_state
,
0
);
ff_mdct_init
(
&
s
->
imdct_ctx
,
8
,
1
,
1
.
0
);
...
...
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