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
4e99501f
Commit
4e99501f
authored
Feb 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(e)ac3enc: select a default bit rate based on the channel layout
parent
6aeea1df
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
0 deletions
+20
-0
ac3enc.c
libavcodec/ac3enc.c
+11
-0
ac3enc_fixed.c
libavcodec/ac3enc_fixed.c
+1
-0
ac3enc_float.c
libavcodec/ac3enc_float.c
+1
-0
ac3enc_opts_template.c
libavcodec/ac3enc_opts_template.c
+6
-0
eac3enc.c
libavcodec/eac3enc.c
+1
-0
No files found.
libavcodec/ac3enc.c
View file @
4e99501f
...
@@ -2141,6 +2141,17 @@ static av_cold int validate_options(AC3EncodeContext *s)
...
@@ -2141,6 +2141,17 @@ static av_cold int validate_options(AC3EncodeContext *s)
s
->
bit_alloc
.
sr_code
=
i
%
3
;
s
->
bit_alloc
.
sr_code
=
i
%
3
;
s
->
bitstream_id
=
s
->
eac3
?
16
:
8
+
s
->
bit_alloc
.
sr_shift
;
s
->
bitstream_id
=
s
->
eac3
?
16
:
8
+
s
->
bit_alloc
.
sr_shift
;
/* select a default bit rate if not set by the user */
if
(
!
avctx
->
bit_rate
)
{
switch
(
s
->
fbw_channels
)
{
case
1
:
avctx
->
bit_rate
=
96000
;
break
;
case
2
:
avctx
->
bit_rate
=
192000
;
break
;
case
3
:
avctx
->
bit_rate
=
320000
;
break
;
case
4
:
avctx
->
bit_rate
=
384000
;
break
;
case
5
:
avctx
->
bit_rate
=
448000
;
break
;
}
}
/* validate bit rate */
/* validate bit rate */
if
(
s
->
eac3
)
{
if
(
s
->
eac3
)
{
int
max_br
,
min_br
,
wpf
,
min_br_dist
,
min_br_code
;
int
max_br
,
min_br
,
wpf
,
min_br_dist
,
min_br_code
;
...
...
libavcodec/ac3enc_fixed.c
View file @
4e99501f
...
@@ -151,4 +151,5 @@ AVCodec ff_ac3_fixed_encoder = {
...
@@ -151,4 +151,5 @@ AVCodec ff_ac3_fixed_encoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52A (AC-3)"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52A (AC-3)"
),
.
priv_class
=
&
ac3enc_class
,
.
priv_class
=
&
ac3enc_class
,
.
channel_layouts
=
ff_ac3_channel_layouts
,
.
channel_layouts
=
ff_ac3_channel_layouts
,
.
defaults
=
ac3_defaults
,
};
};
libavcodec/ac3enc_float.c
View file @
4e99501f
...
@@ -149,5 +149,6 @@ AVCodec ff_ac3_encoder = {
...
@@ -149,5 +149,6 @@ AVCodec ff_ac3_encoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52A (AC-3)"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52A (AC-3)"
),
.
priv_class
=
&
ac3enc_class
,
.
priv_class
=
&
ac3enc_class
,
.
channel_layouts
=
ff_ac3_channel_layouts
,
.
channel_layouts
=
ff_ac3_channel_layouts
,
.
defaults
=
ac3_defaults
,
};
};
#endif
#endif
libavcodec/ac3enc_opts_template.c
View file @
4e99501f
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
*/
*/
#include "libavutil/opt.h"
#include "libavutil/opt.h"
#include "internal.h"
#include "ac3.h"
#include "ac3.h"
#if AC3ENC_TYPE == AC3ENC_TYPE_AC3_FIXED
#if AC3ENC_TYPE == AC3ENC_TYPE_AC3_FIXED
...
@@ -78,3 +79,8 @@ static const AVOption eac3_options[] = {
...
@@ -78,3 +79,8 @@ static const AVOption eac3_options[] = {
{
"auto"
,
"Selected by the Encoder"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
AC3ENC_OPT_AUTO
},
INT_MIN
,
INT_MAX
,
AC3ENC_PARAM
,
"cpl_start_band"
},
{
"auto"
,
"Selected by the Encoder"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
AC3ENC_OPT_AUTO
},
INT_MIN
,
INT_MAX
,
AC3ENC_PARAM
,
"cpl_start_band"
},
{
NULL
}
{
NULL
}
};
};
static
const
AVCodecDefault
ac3_defaults
[]
=
{
{
"b"
,
"0"
},
{
NULL
}
};
libavcodec/eac3enc.c
View file @
4e99501f
...
@@ -258,5 +258,6 @@ AVCodec ff_eac3_encoder = {
...
@@ -258,5 +258,6 @@ AVCodec ff_eac3_encoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52 E-AC-3"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52 E-AC-3"
),
.
priv_class
=
&
eac3enc_class
,
.
priv_class
=
&
eac3enc_class
,
.
channel_layouts
=
ff_ac3_channel_layouts
,
.
channel_layouts
=
ff_ac3_channel_layouts
,
.
defaults
=
ac3_defaults
,
};
};
#endif
#endif
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