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
baced9f5
Commit
baced9f5
authored
Aug 13, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user overrideable level & profile
Originally committed as revision 3385 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
c2b9685e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
10 deletions
+57
-10
ffmpeg.c
ffmpeg.c
+6
-0
avcodec.h
libavcodec/avcodec.h
+17
-1
h263.c
libavcodec/h263.c
+16
-3
mpeg12.c
libavcodec/mpeg12.c
+16
-6
utils.c
libavcodec/utils.c
+2
-0
No files found.
ffmpeg.c
View file @
baced9f5
...
@@ -182,6 +182,8 @@ static int intra_dc_precision = 8;
...
@@ -182,6 +182,8 @@ static int intra_dc_precision = 8;
static
int
coder
=
0
;
static
int
coder
=
0
;
static
int
context
=
0
;
static
int
context
=
0
;
static
int
predictor
=
0
;
static
int
predictor
=
0
;
static
int
video_profile
=
FF_PROFILE_UNKNOWN
;
static
int
video_level
=
FF_LEVEL_UNKNOWN
;
extern
int
loop_input
;
/* currently a hack */
extern
int
loop_input
;
/* currently a hack */
static
int
gop_size
=
12
;
static
int
gop_size
=
12
;
...
@@ -3150,6 +3152,8 @@ static void opt_output_file(const char *filename)
...
@@ -3150,6 +3152,8 @@ static void opt_output_file(const char *filename)
video_enc
->
coder_type
=
coder
;
video_enc
->
coder_type
=
coder
;
video_enc
->
context_model
=
context
;
video_enc
->
context_model
=
context
;
video_enc
->
prediction_method
=
predictor
;
video_enc
->
prediction_method
=
predictor
;
video_enc
->
profile
=
video_profile
;
video_enc
->
level
=
video_level
;
if
(
packet_size
){
if
(
packet_size
){
video_enc
->
rtp_mode
=
1
;
video_enc
->
rtp_mode
=
1
;
...
@@ -3839,6 +3843,8 @@ const OptionDef options[] = {
...
@@ -3839,6 +3843,8 @@ const OptionDef options[] = {
{
"coder"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
coder
},
"coder type"
,
""
},
{
"coder"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
coder
},
"coder type"
,
""
},
{
"context"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
context
},
"context model"
,
""
},
{
"context"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
context
},
"context model"
,
""
},
{
"pred"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
predictor
},
"prediction method"
,
""
},
{
"pred"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
predictor
},
"prediction method"
,
""
},
{
"vprofile"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
video_profile
},
"profile"
,
""
},
{
"vlevel"
,
OPT_INT
|
HAS_ARG
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
video_level
},
"level"
,
""
},
/* audio options */
/* audio options */
{
"ab"
,
HAS_ARG
|
OPT_AUDIO
,
{(
void
*
)
opt_audio_bitrate
},
"set audio bitrate (in kbit/s)"
,
"bitrate"
,
},
{
"ab"
,
HAS_ARG
|
OPT_AUDIO
,
{(
void
*
)
opt_audio_bitrate
},
"set audio bitrate (in kbit/s)"
,
"bitrate"
,
},
...
...
libavcodec/avcodec.h
View file @
baced9f5
...
@@ -17,7 +17,7 @@ extern "C" {
...
@@ -17,7 +17,7 @@ extern "C" {
#define FFMPEG_VERSION_INT 0x000409
#define FFMPEG_VERSION_INT 0x000409
#define FFMPEG_VERSION "0.4.9-pre1"
#define FFMPEG_VERSION "0.4.9-pre1"
#define LIBAVCODEC_BUILD 47
19
#define LIBAVCODEC_BUILD 47
20
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION
#define LIBAVCODEC_VERSION FFMPEG_VERSION
...
@@ -1624,6 +1624,22 @@ typedef struct AVCodecContext {
...
@@ -1624,6 +1624,22 @@ typedef struct AVCodecContext {
* - decoding: set by user
* - decoding: set by user
*/
*/
int
skip_bottom
;
int
skip_bottom
;
/**
* profile
* - encoding: set by user
* - decoding: set by lavc
*/
int
profile
;
#define FF_PROFILE_UNKNOWN -99
/**
* level
* - encoding: set by user
* - decoding: set by lavc
*/
int
level
;
#define FF_LEVEL_UNKNOWN -99
}
AVCodecContext
;
}
AVCodecContext
;
...
...
libavcodec/h263.c
View file @
baced9f5
...
@@ -2154,13 +2154,26 @@ static void mpeg4_encode_visual_object_header(MpegEncContext * s){
...
@@ -2154,13 +2154,26 @@ static void mpeg4_encode_visual_object_header(MpegEncContext * s){
int
profile_and_level_indication
;
int
profile_and_level_indication
;
int
vo_ver_id
;
int
vo_ver_id
;
if
(
s
->
max_b_frames
||
s
->
quarter_sample
){
if
(
s
->
avctx
->
profile
!=
FF_PROFILE_UNKNOWN
){
profile_and_level_indication
=
0xF1
;
// adv simple level 1
profile_and_level_indication
=
s
->
avctx
->
profile
<<
4
;
}
else
if
(
s
->
max_b_frames
||
s
->
quarter_sample
){
profile_and_level_indication
=
0xF0
;
// adv simple
}
else
{
profile_and_level_indication
=
0x00
;
// simple
}
if
(
s
->
avctx
->
level
!=
FF_LEVEL_UNKNOWN
){
profile_and_level_indication
|=
s
->
avctx
->
level
;
}
else
{
profile_and_level_indication
|=
1
;
//level 1
}
if
(
profile_and_level_indication
>>
4
==
0xF
){
vo_ver_id
=
5
;
vo_ver_id
=
5
;
}
else
{
}
else
{
profile_and_level_indication
=
0x01
;
// simple level 1
vo_ver_id
=
1
;
vo_ver_id
=
1
;
}
}
//FIXME levels
//FIXME levels
put_bits
(
&
s
->
pb
,
16
,
0
);
put_bits
(
&
s
->
pb
,
16
,
0
);
...
...
libavcodec/mpeg12.c
View file @
baced9f5
...
@@ -314,8 +314,19 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
...
@@ -314,8 +314,19 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
put_header
(
s
,
EXT_START_CODE
);
put_header
(
s
,
EXT_START_CODE
);
put_bits
(
&
s
->
pb
,
4
,
1
);
//seq ext
put_bits
(
&
s
->
pb
,
4
,
1
);
//seq ext
put_bits
(
&
s
->
pb
,
1
,
0
);
//esc
put_bits
(
&
s
->
pb
,
1
,
0
);
//esc
put_bits
(
&
s
->
pb
,
3
,
4
);
//profile
put_bits
(
&
s
->
pb
,
4
,
8
);
//level
if
(
s
->
avctx
->
profile
==
FF_PROFILE_UNKNOWN
){
put_bits
(
&
s
->
pb
,
3
,
4
);
//profile
}
else
{
put_bits
(
&
s
->
pb
,
3
,
s
->
avctx
->
profile
);
//profile
}
if
(
s
->
avctx
->
level
==
FF_LEVEL_UNKNOWN
){
put_bits
(
&
s
->
pb
,
4
,
8
);
//level
}
else
{
put_bits
(
&
s
->
pb
,
4
,
s
->
avctx
->
level
);
//level
}
put_bits
(
&
s
->
pb
,
1
,
s
->
progressive_sequence
);
put_bits
(
&
s
->
pb
,
1
,
s
->
progressive_sequence
);
put_bits
(
&
s
->
pb
,
2
,
1
);
//chroma format 4:2:0
put_bits
(
&
s
->
pb
,
2
,
1
);
//chroma format 4:2:0
put_bits
(
&
s
->
pb
,
2
,
0
);
//horizontal size ext
put_bits
(
&
s
->
pb
,
2
,
0
);
//horizontal size ext
...
@@ -1971,11 +1982,10 @@ static void mpeg_decode_sequence_extension(MpegEncContext *s)
...
@@ -1971,11 +1982,10 @@ static void mpeg_decode_sequence_extension(MpegEncContext *s)
{
{
int
horiz_size_ext
,
vert_size_ext
;
int
horiz_size_ext
,
vert_size_ext
;
int
bit_rate_ext
;
int
bit_rate_ext
;
int
level
,
profile
;
skip_bits
(
&
s
->
gb
,
1
);
/* profil and level esc*/
skip_bits
(
&
s
->
gb
,
1
);
/* profil and level esc*/
profile
=
get_bits
(
&
s
->
gb
,
3
);
s
->
avctx
->
profile
=
get_bits
(
&
s
->
gb
,
3
);
level
=
get_bits
(
&
s
->
gb
,
4
);
s
->
avctx
->
level
=
get_bits
(
&
s
->
gb
,
4
);
s
->
progressive_sequence
=
get_bits1
(
&
s
->
gb
);
/* progressive_sequence */
s
->
progressive_sequence
=
get_bits1
(
&
s
->
gb
);
/* progressive_sequence */
s
->
chroma_format
=
get_bits
(
&
s
->
gb
,
2
);
/* chroma_format 1=420, 2=422, 3=444 */
s
->
chroma_format
=
get_bits
(
&
s
->
gb
,
2
);
/* chroma_format 1=420, 2=422, 3=444 */
horiz_size_ext
=
get_bits
(
&
s
->
gb
,
2
);
horiz_size_ext
=
get_bits
(
&
s
->
gb
,
2
);
...
@@ -1999,7 +2009,7 @@ static void mpeg_decode_sequence_extension(MpegEncContext *s)
...
@@ -1999,7 +2009,7 @@ static void mpeg_decode_sequence_extension(MpegEncContext *s)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"profile: %d, level: %d vbv buffer: %d, bitrate:%d
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"profile: %d, level: %d vbv buffer: %d, bitrate:%d
\n
"
,
profile
,
level
,
s
->
avctx
->
rc_buffer_size
,
s
->
bit_rate
);
s
->
avctx
->
profile
,
s
->
avctx
->
level
,
s
->
avctx
->
rc_buffer_size
,
s
->
bit_rate
);
}
}
...
...
libavcodec/utils.c
View file @
baced9f5
...
@@ -396,6 +396,8 @@ void avcodec_get_context_defaults(AVCodecContext *s){
...
@@ -396,6 +396,8 @@ void avcodec_get_context_defaults(AVCodecContext *s){
s
->
lmax
=
FF_QP2LAMBDA
*
s
->
qmax
;
s
->
lmax
=
FF_QP2LAMBDA
*
s
->
qmax
;
s
->
sample_aspect_ratio
=
(
AVRational
){
0
,
1
};
s
->
sample_aspect_ratio
=
(
AVRational
){
0
,
1
};
s
->
ildct_cmp
=
FF_CMP_VSAD
;
s
->
ildct_cmp
=
FF_CMP_VSAD
;
s
->
profile
=
FF_PROFILE_UNKNOWN
;
s
->
level
=
FF_LEVEL_UNKNOWN
;
s
->
intra_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
s
->
intra_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
s
->
inter_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
s
->
inter_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
...
...
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