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
610864dc
Commit
610864dc
authored
May 30, 2017
by
Tyler Jones
Committed by
Rostislav Pehlivanov
Jun 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/vorbisenc: Include fdsp
Signed-off-by:
Tyler Jones
<
tdjones879@gmail.com
>
parent
189ff421
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
vorbisenc.c
libavcodec/vorbisenc.c
+25
-6
No files found.
libavcodec/vorbisenc.c
View file @
610864dc
...
...
@@ -25,6 +25,7 @@
*/
#include <float.h>
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "internal.h"
...
...
@@ -126,6 +127,8 @@ typedef struct vorbis_enc_context {
vorbis_enc_mode
*
modes
;
int64_t
next_pts
;
AVFloatDSPContext
*
fdsp
;
}
vorbis_enc_context
;
#define MAX_CHANNELS 2
...
...
@@ -236,6 +239,26 @@ static int ready_residue(vorbis_enc_residue *rc, vorbis_enc_context *venc)
return
0
;
}
static
av_cold
int
dsp_init
(
AVCodecContext
*
avctx
,
vorbis_enc_context
*
venc
)
{
int
ret
=
0
;
venc
->
fdsp
=
avpriv_float_dsp_alloc
(
avctx
->
flags
&
AV_CODEC_FLAG_BITEXACT
);
if
(
!
venc
->
fdsp
)
return
AVERROR
(
ENOMEM
);
// init windows
venc
->
win
[
0
]
=
ff_vorbis_vwin
[
venc
->
log2_blocksize
[
0
]
-
6
];
venc
->
win
[
1
]
=
ff_vorbis_vwin
[
venc
->
log2_blocksize
[
1
]
-
6
];
if
((
ret
=
ff_mdct_init
(
&
venc
->
mdct
[
0
],
venc
->
log2_blocksize
[
0
],
0
,
1
.
0
))
<
0
)
return
ret
;
if
((
ret
=
ff_mdct_init
(
&
venc
->
mdct
[
1
],
venc
->
log2_blocksize
[
1
],
0
,
1
.
0
))
<
0
)
return
ret
;
return
0
;
}
static
int
create_vorbis_context
(
vorbis_enc_context
*
venc
,
AVCodecContext
*
avctx
)
{
...
...
@@ -426,12 +449,7 @@ static int create_vorbis_context(vorbis_enc_context *venc,
if
(
!
venc
->
saved
||
!
venc
->
samples
||
!
venc
->
floor
||
!
venc
->
coeffs
)
return
AVERROR
(
ENOMEM
);
venc
->
win
[
0
]
=
ff_vorbis_vwin
[
venc
->
log2_blocksize
[
0
]
-
6
];
venc
->
win
[
1
]
=
ff_vorbis_vwin
[
venc
->
log2_blocksize
[
1
]
-
6
];
if
((
ret
=
ff_mdct_init
(
&
venc
->
mdct
[
0
],
venc
->
log2_blocksize
[
0
],
0
,
1
.
0
))
<
0
)
return
ret
;
if
((
ret
=
ff_mdct_init
(
&
venc
->
mdct
[
1
],
venc
->
log2_blocksize
[
1
],
0
,
1
.
0
))
<
0
)
if
((
ret
=
dsp_init
(
avctx
,
venc
))
<
0
)
return
ret
;
return
0
;
...
...
@@ -1155,6 +1173,7 @@ static av_cold int vorbis_encode_close(AVCodecContext *avctx)
av_freep
(
&
venc
->
samples
);
av_freep
(
&
venc
->
floor
);
av_freep
(
&
venc
->
coeffs
);
av_freep
(
&
venc
->
fdsp
);
ff_mdct_end
(
&
venc
->
mdct
[
0
]);
ff_mdct_end
(
&
venc
->
mdct
[
1
]);
...
...
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