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
51f2422c
Commit
51f2422c
authored
Dec 01, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/vorbisdec: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
00d47591
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
vorbisdec.c
libavcodec/vorbisdec.c
+9
-6
No files found.
libavcodec/vorbisdec.c
View file @
51f2422c
...
...
@@ -127,7 +127,7 @@ typedef struct vorbis_context_s {
AVCodecContext
*
avctx
;
GetBitContext
gb
;
VorbisDSPContext
dsp
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
FmtConvertContext
fmt_conv
;
FFTContext
mdct
[
2
];
...
...
@@ -193,6 +193,7 @@ static void vorbis_free(vorbis_context *vc)
av_freep
(
&
vc
->
channel_residues
);
av_freep
(
&
vc
->
saved
);
av_freep
(
&
vc
->
fdsp
);
if
(
vc
->
residues
)
for
(
i
=
0
;
i
<
vc
->
residue_count
;
i
++
)
...
...
@@ -992,6 +993,9 @@ static int vorbis_parse_id_hdr(vorbis_context *vc)
ff_mdct_init
(
&
vc
->
mdct
[
0
],
bl0
,
1
,
-
1
.
0
);
ff_mdct_init
(
&
vc
->
mdct
[
1
],
bl1
,
1
,
-
1
.
0
);
vc
->
fdsp
=
avpriv_float_dsp_alloc
(
vc
->
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
if
(
!
vc
->
fdsp
)
return
AVERROR
(
ENOMEM
);
av_dlog
(
NULL
,
" vorbis version %d
\n
audio_channels %d
\n
audio_samplerate %d
\n
bitrate_max %d
\n
bitrate_nom %d
\n
bitrate_min %d
\n
blk_0 %d blk_1 %d
\n
"
,
vc
->
version
,
vc
->
audio_channels
,
vc
->
audio_samplerate
,
vc
->
bitrate_maximum
,
vc
->
bitrate_nominal
,
vc
->
bitrate_minimum
,
vc
->
blocksize
[
0
],
vc
->
blocksize
[
1
]);
...
...
@@ -1020,7 +1024,6 @@ static av_cold int vorbis_decode_init(AVCodecContext *avctx)
vc
->
avctx
=
avctx
;
ff_vorbisdsp_init
(
&
vc
->
dsp
);
avpriv_float_dsp_init
(
&
vc
->
fdsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
ff_fmt_convert_init
(
&
vc
->
fmt_conv
,
avctx
);
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLTP
;
...
...
@@ -1688,7 +1691,7 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
for
(
j
=
vc
->
audio_channels
-
1
;
j
>=
0
;
j
--
)
{
ch_res_ptr
=
vc
->
channel_residues
+
res_chan
[
j
]
*
blocksize
/
2
;
vc
->
fdsp
.
vector_fmul
(
floor_ptr
[
j
],
floor_ptr
[
j
],
ch_res_ptr
,
blocksize
/
2
);
vc
->
fdsp
->
vector_fmul
(
floor_ptr
[
j
],
floor_ptr
[
j
],
ch_res_ptr
,
blocksize
/
2
);
mdct
->
imdct_half
(
mdct
,
ch_res_ptr
,
floor_ptr
[
j
]);
}
...
...
@@ -1705,13 +1708,13 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
const
float
*
win
=
vc
->
win
[
blockflag
&
previous_window
];
if
(
blockflag
==
previous_window
)
{
vc
->
fdsp
.
vector_fmul_window
(
ret
,
saved
,
buf
,
win
,
blocksize
/
4
);
vc
->
fdsp
->
vector_fmul_window
(
ret
,
saved
,
buf
,
win
,
blocksize
/
4
);
}
else
if
(
blockflag
>
previous_window
)
{
vc
->
fdsp
.
vector_fmul_window
(
ret
,
saved
,
buf
,
win
,
bs0
/
4
);
vc
->
fdsp
->
vector_fmul_window
(
ret
,
saved
,
buf
,
win
,
bs0
/
4
);
memcpy
(
ret
+
bs0
/
2
,
buf
+
bs0
/
4
,
((
bs1
-
bs0
)
/
4
)
*
sizeof
(
float
));
}
else
{
memcpy
(
ret
,
saved
,
((
bs1
-
bs0
)
/
4
)
*
sizeof
(
float
));
vc
->
fdsp
.
vector_fmul_window
(
ret
+
(
bs1
-
bs0
)
/
4
,
saved
+
(
bs1
-
bs0
)
/
4
,
buf
,
win
,
bs0
/
4
);
vc
->
fdsp
->
vector_fmul_window
(
ret
+
(
bs1
-
bs0
)
/
4
,
saved
+
(
bs1
-
bs0
)
/
4
,
buf
,
win
,
bs0
/
4
);
}
memcpy
(
saved
,
buf
+
blocksize
/
4
,
blocksize
/
4
*
sizeof
(
float
));
}
...
...
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