Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
1726eefe
Commit
1726eefe
authored
Apr 03, 2020
by
Limin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpeg12enc: Use FF_PROFILE_MPEG2_xxx macros
Signed-off-by:
Limin Wang
<
lance.lmwang@gmail.com
>
parent
39fb1e96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
mpeg12enc.c
libavcodec/mpeg12enc.c
+4
-4
No files found.
libavcodec/mpeg12enc.c
View file @
1726eefe
...
@@ -162,17 +162,17 @@ static av_cold int encode_init(AVCodecContext *avctx)
...
@@ -162,17 +162,17 @@ static av_cold int encode_init(AVCodecContext *avctx)
return
-
1
;
return
-
1
;
}
}
/* Main or 4:2:2 */
/* Main or 4:2:2 */
avctx
->
profile
=
s
->
chroma_format
==
CHROMA_420
?
4
:
0
;
avctx
->
profile
=
s
->
chroma_format
==
CHROMA_420
?
FF_PROFILE_MPEG2_MAIN
:
FF_PROFILE_MPEG2_422
;
}
}
if
(
avctx
->
level
==
FF_LEVEL_UNKNOWN
)
{
if
(
avctx
->
level
==
FF_LEVEL_UNKNOWN
)
{
if
(
avctx
->
profile
==
0
)
{
/* 4:2:2 */
if
(
avctx
->
profile
==
FF_PROFILE_MPEG2_422
)
{
/* 4:2:2 */
if
(
avctx
->
width
<=
720
&&
avctx
->
height
<=
608
)
if
(
avctx
->
width
<=
720
&&
avctx
->
height
<=
608
)
avctx
->
level
=
5
;
/* Main */
avctx
->
level
=
5
;
/* Main */
else
else
avctx
->
level
=
2
;
/* High */
avctx
->
level
=
2
;
/* High */
}
else
{
}
else
{
if
(
avctx
->
profile
!=
1
&&
s
->
chroma_format
!=
CHROMA_420
)
{
if
(
avctx
->
profile
!=
FF_PROFILE_MPEG2_HIGH
&&
s
->
chroma_format
!=
CHROMA_420
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling
\n
"
);
"Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling
\n
"
);
return
-
1
;
return
-
1
;
...
@@ -321,7 +321,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
...
@@ -321,7 +321,7 @@ 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
,
s
->
avctx
->
profile
==
0
);
// escx 1 for 4:2:2 profile
put_bits
(
&
s
->
pb
,
1
,
s
->
avctx
->
profile
==
FF_PROFILE_MPEG2_422
);
// escx 1 for 4:2:2 profile
put_bits
(
&
s
->
pb
,
3
,
s
->
avctx
->
profile
);
// profile
put_bits
(
&
s
->
pb
,
3
,
s
->
avctx
->
profile
);
// profile
put_bits
(
&
s
->
pb
,
4
,
s
->
avctx
->
level
);
// level
put_bits
(
&
s
->
pb
,
4
,
s
->
avctx
->
level
);
// level
...
...
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