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
147ff24a
Commit
147ff24a
authored
Feb 29, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvorbis: use VBR by default, with default quality of 3
parent
182d4f1f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
libvorbis.c
libavcodec/libvorbis.c
+12
-2
No files found.
libavcodec/libvorbis.c
View file @
147ff24a
...
...
@@ -61,6 +61,12 @@ static const AVOption options[] = {
{
"iblock"
,
"Sets the impulse block bias"
,
offsetof
(
OggVorbisContext
,
iblock
),
AV_OPT_TYPE_DOUBLE
,
{
.
dbl
=
0
},
-
15
,
0
,
AV_OPT_FLAG_AUDIO_PARAM
|
AV_OPT_FLAG_ENCODING_PARAM
},
{
NULL
}
};
static
const
AVCodecDefault
defaults
[]
=
{
{
"b"
,
"0"
},
{
NULL
},
};
static
const
AVClass
class
=
{
"libvorbis"
,
av_default_item_name
,
options
,
LIBAVUTIL_VERSION_INT
};
...
...
@@ -81,12 +87,15 @@ static av_cold int oggvorbis_init_encoder(vorbis_info *vi,
double
cfreq
;
int
ret
;
if
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
{
if
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
||
!
avctx
->
bit_rate
)
{
/* variable bitrate
* NOTE: we use the oggenc range of -1 to 10 for global_quality for
* user convenience, but libvorbis uses -0.1 to 1.0
* user convenience, but libvorbis uses -0.1 to 1.0
.
*/
float
q
=
avctx
->
global_quality
/
(
float
)
FF_QP2LAMBDA
;
/* default to 3 if the user did not set quality or bitrate */
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
))
q
=
3
.
0
;
if
((
ret
=
vorbis_encode_setup_vbr
(
vi
,
avctx
->
channels
,
avctx
->
sample_rate
,
q
/
10
.
0
)))
...
...
@@ -307,4 +316,5 @@ AVCodec ff_libvorbis_encoder = {
AV_SAMPLE_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libvorbis Vorbis"
),
.
priv_class
=
&
class
,
.
defaults
=
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