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
09fda6bb
Commit
09fda6bb
authored
Nov 02, 2013
by
Timothy Gu
Committed by
Vittorio Giovara
Mar 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libmp3lame: add ABR support
parent
292dbe5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
libmp3lame.c
libavcodec/libmp3lame.c
+9
-2
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/libmp3lame.c
View file @
09fda6bb
...
...
@@ -49,6 +49,7 @@ typedef struct LAMEContext {
int
buffer_size
;
int
reservoir
;
int
joint_stereo
;
int
abr
;
float
*
samples_flt
[
2
];
AudioFrameQueue
afq
;
AVFloatDSPContext
fdsp
;
...
...
@@ -114,8 +115,13 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
lame_set_VBR
(
s
->
gfp
,
vbr_default
);
lame_set_VBR_quality
(
s
->
gfp
,
avctx
->
global_quality
/
(
float
)
FF_QP2LAMBDA
);
}
else
{
if
(
avctx
->
bit_rate
)
// CBR
lame_set_brate
(
s
->
gfp
,
avctx
->
bit_rate
/
1000
);
if
(
avctx
->
bit_rate
)
{
if
(
s
->
abr
)
{
// ABR
lame_set_VBR
(
s
->
gfp
,
vbr_abr
);
lame_set_VBR_mean_bitrate_kbps
(
s
->
gfp
,
avctx
->
bit_rate
/
1000
);
}
else
// CBR
lame_set_brate
(
s
->
gfp
,
avctx
->
bit_rate
/
1000
);
}
}
/* do not get a Xing VBR header frame from LAME */
...
...
@@ -262,6 +268,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
static
const
AVOption
options
[]
=
{
{
"reservoir"
,
"Use bit reservoir."
,
OFFSET
(
reservoir
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
0
,
1
,
AE
},
{
"joint_stereo"
,
"Use joint stereo."
,
OFFSET
(
joint_stereo
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
0
,
1
,
AE
},
{
"abr"
,
"Use ABR"
,
OFFSET
(
abr
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
AE
},
{
NULL
},
};
...
...
libavcodec/version.h
View file @
09fda6bb
...
...
@@ -30,7 +30,7 @@
#define LIBAVCODEC_VERSION_MAJOR 55
#define LIBAVCODEC_VERSION_MINOR 41
#define LIBAVCODEC_VERSION_MICRO
1
#define LIBAVCODEC_VERSION_MICRO
2
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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