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
232e16dd
Commit
232e16dd
authored
Feb 17, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libmp3lame: use the LAME default bit rate
Also, only set bit rate for CBR.
parent
1f516c04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
libmp3lame.c
libavcodec/libmp3lame.c
+10
-2
No files found.
libavcodec/libmp3lame.c
View file @
232e16dd
...
...
@@ -28,6 +28,7 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "mpegaudio.h"
#include "mpegaudiodecheader.h"
#include <lame/lame.h>
...
...
@@ -71,11 +72,12 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
lame_set_quality
(
s
->
gfp
,
avctx
->
compression_level
);
}
lame_set_mode
(
s
->
gfp
,
avctx
->
channels
>
1
?
JOINT_STEREO
:
MONO
);
lame_set_brate
(
s
->
gfp
,
avctx
->
bit_rate
/
1000
);
if
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
{
lame_set_brate
(
s
->
gfp
,
0
);
lame_set_VBR
(
s
->
gfp
,
vbr_default
);
lame_set_VBR_quality
(
s
->
gfp
,
avctx
->
global_quality
/
(
float
)
FF_QP2LAMBDA
);
}
else
{
if
(
avctx
->
bit_rate
)
lame_set_brate
(
s
->
gfp
,
avctx
->
bit_rate
/
1000
);
}
lame_set_bWriteVbrTag
(
s
->
gfp
,
0
);
lame_set_disable_reservoir
(
s
->
gfp
,
!
s
->
reservoir
);
...
...
@@ -171,6 +173,11 @@ static const AVClass libmp3lame_class = {
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVCodecDefault
libmp3lame_defaults
[]
=
{
{
"b"
,
"0"
},
{
NULL
},
};
AVCodec
ff_libmp3lame_encoder
=
{
.
name
=
"libmp3lame"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
...
...
@@ -185,4 +192,5 @@ AVCodec ff_libmp3lame_encoder = {
.
supported_samplerates
=
sSampleRates
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libmp3lame MP3 (MPEG audio layer 3)"
),
.
priv_class
=
&
libmp3lame_class
,
.
defaults
=
libmp3lame_defaults
,
};
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