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
7c69b830
Commit
7c69b830
authored
Jul 02, 2006
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify
Originally committed as revision 5573 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
a403fc03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
50 deletions
+11
-50
flacenc.c
libavcodec/flacenc.c
+11
-50
No files found.
libavcodec/flacenc.c
View file @
7c69b830
...
...
@@ -168,7 +168,7 @@ static int flac_encode_init(AVCodecContext *avctx)
int
freq
=
avctx
->
sample_rate
;
int
channels
=
avctx
->
channels
;
FlacEncodeContext
*
s
=
avctx
->
priv_data
;
int
i
;
int
i
,
level
;
uint8_t
*
streaminfo
;
s
->
avctx
=
avctx
;
...
...
@@ -219,60 +219,21 @@ static int flac_encode_init(AVCodecContext *avctx)
}
av_log
(
avctx
,
AV_LOG_DEBUG
,
" compression: %d
\n
"
,
s
->
options
.
compression_level
);
if
(
s
->
options
.
compression_level
==
0
)
{
s
->
options
.
block_time_ms
=
27
;
s
->
options
.
use_lpc
=
0
;
s
->
options
.
min_prediction_order
=
2
;
s
->
options
.
max_prediction_order
=
3
;
s
->
options
.
prediction_order_method
=
ORDER_METHOD_EST
;
s
->
options
.
min_partition_order
=
2
;
s
->
options
.
max_partition_order
=
2
;
}
else
if
(
s
->
options
.
compression_level
==
1
)
{
s
->
options
.
block_time_ms
=
27
;
s
->
options
.
use_lpc
=
0
;
s
->
options
.
min_prediction_order
=
0
;
s
->
options
.
max_prediction_order
=
4
;
s
->
options
.
prediction_order_method
=
ORDER_METHOD_EST
;
s
->
options
.
min_partition_order
=
2
;
s
->
options
.
max_partition_order
=
2
;
}
else
if
(
s
->
options
.
compression_level
==
2
)
{
s
->
options
.
block_time_ms
=
27
;
s
->
options
.
use_lpc
=
0
;
s
->
options
.
min_prediction_order
=
0
;
s
->
options
.
max_prediction_order
=
4
;
s
->
options
.
prediction_order_method
=
ORDER_METHOD_EST
;
s
->
options
.
min_partition_order
=
0
;
s
->
options
.
max_partition_order
=
3
;
}
else
if
(
s
->
options
.
compression_level
==
3
)
{
s
->
options
.
block_time_ms
=
105
;
s
->
options
.
use_lpc
=
1
;
s
->
options
.
min_prediction_order
=
1
;
s
->
options
.
max_prediction_order
=
6
;
s
->
options
.
prediction_order_method
=
ORDER_METHOD_EST
;
s
->
options
.
min_partition_order
=
0
;
s
->
options
.
max_partition_order
=
3
;
}
else
if
(
s
->
options
.
compression_level
==
4
)
{
s
->
options
.
block_time_ms
=
105
;
s
->
options
.
use_lpc
=
1
;
s
->
options
.
min_prediction_order
=
1
;
s
->
options
.
max_prediction_order
=
8
;
s
->
options
.
prediction_order_method
=
ORDER_METHOD_EST
;
s
->
options
.
min_partition_order
=
0
;
s
->
options
.
max_partition_order
=
3
;
}
else
if
(
s
->
options
.
compression_level
==
5
)
{
s
->
options
.
block_time_ms
=
105
;
s
->
options
.
use_lpc
=
1
;
s
->
options
.
min_prediction_order
=
1
;
s
->
options
.
max_prediction_order
=
8
;
s
->
options
.
prediction_order_method
=
ORDER_METHOD_EST
;
s
->
options
.
min_partition_order
=
0
;
s
->
options
.
max_partition_order
=
8
;
}
else
{
level
=
s
->
options
.
compression_level
;
if
(
level
>
5
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid compression level: %d
\n
"
,
s
->
options
.
compression_level
);
return
-
1
;
}
s
->
options
.
block_time_ms
=
((
int
[]){
27
,
27
,
27
,
105
,
105
,
105
})[
level
];
s
->
options
.
use_lpc
=
((
int
[]){
0
,
0
,
0
,
1
,
1
,
1
})[
level
];
s
->
options
.
min_prediction_order
=
((
int
[]){
2
,
0
,
0
,
1
,
1
,
1
})[
level
];
s
->
options
.
max_prediction_order
=
((
int
[]){
3
,
4
,
4
,
6
,
8
,
8
})[
level
];
s
->
options
.
prediction_order_method
=
ORDER_METHOD_EST
;
s
->
options
.
min_partition_order
=
((
int
[]){
2
,
2
,
0
,
0
,
0
,
0
})[
level
];
s
->
options
.
max_partition_order
=
((
int
[]){
2
,
2
,
3
,
3
,
3
,
8
})[
level
];
/* set compression option overrides from AVCodecContext */
if
(
avctx
->
use_lpc
>=
0
)
{
s
->
options
.
use_lpc
=
!!
avctx
->
use_lpc
;
...
...
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