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
a249f0cc
Commit
a249f0cc
authored
Feb 27, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo_enc: add strict_gop flag to mpv_flags.
Deprecate CODEC_FLAG2_STRICT_GOP.
parent
ed019b8e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
avcodec.h
libavcodec/avcodec.h
+1
-1
mpegvideo.h
libavcodec/mpegvideo.h
+2
-0
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+3
-1
options.c
libavcodec/options.c
+3
-1
No files found.
libavcodec/avcodec.h
View file @
a249f0cc
...
...
@@ -567,10 +567,10 @@ typedef struct RcOverride{
#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
#define CODEC_FLAG_CLOSED_GOP 0x80000000
#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size.
#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
#if FF_API_MPV_GLOBAL_OPTS
#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size.
#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
#endif
#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
...
...
libavcodec/mpegvideo.h
View file @
a249f0cc
...
...
@@ -700,12 +700,14 @@ typedef struct MpegEncContext {
/* mpegvideo_enc common options */
#define FF_MPV_FLAG_SKIP_RD 0x0001
#define FF_MPV_FLAG_STRICT_GOP 0x0002
#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
#define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
#define FF_MPV_COMMON_OPTS \
{ "mpv_flags", "Flags common for all mpegvideo-based encoders.", FF_MPV_OFFSET(mpv_flags), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, "mpv_flags" },\
{ "skip_rd", "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, { FF_MPV_FLAG_SKIP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
{ "strict_gop", "Strictly enforce gop size", 0, AV_OPT_TYPE_CONST, { FF_MPV_FLAG_STRICT_GOP }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },
extern
const
AVOption
ff_mpv_generic_options
[];
...
...
libavcodec/mpegvideo_enc.c
View file @
a249f0cc
...
...
@@ -614,6 +614,8 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
#if FF_API_MPV_GLOBAL_OPTS
if
(
avctx
->
flags2
&
CODEC_FLAG2_SKIP_RD
)
s
->
mpv_flags
|=
FF_MPV_FLAG_SKIP_RD
;
if
(
avctx
->
flags2
&
CODEC_FLAG2_STRICT_GOP
)
s
->
mpv_flags
|=
FF_MPV_FLAG_STRICT_GOP
;
#endif
switch
(
avctx
->
codec
->
id
)
{
...
...
@@ -1300,7 +1302,7 @@ static int select_input_picture(MpegEncContext *s)
}
if
(
s
->
picture_in_gop_number
+
b_frames
>=
s
->
gop_size
)
{
if
((
s
->
flags2
&
CODEC_FLAG2
_STRICT_GOP
)
&&
if
((
s
->
mpv_flags
&
FF_MPV_FLAG
_STRICT_GOP
)
&&
s
->
gop_size
>
s
->
picture_in_gop_number
)
{
b_frames
=
s
->
gop_size
-
s
->
picture_in_gop_number
-
1
;
}
else
{
...
...
libavcodec/options.c
View file @
a249f0cc
...
...
@@ -102,7 +102,9 @@ static const AVOption options[]={
{
"ilme"
,
"interlaced motion estimation"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_INTERLACED_ME
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags"
},
{
"cgop"
,
"closed gop"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_CLOSED_GOP
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags"
},
{
"fast"
,
"allow non spec compliant speedup tricks"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_FAST
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
{
"sgop"
,
"strictly enforce gop size"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_STRICT_GOP
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
#if FF_API_MPV_GLOBAL_OPTS
{
"sgop"
,
"Deprecated, use mpegvideo private options instead"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_STRICT_GOP
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
#endif
{
"noout"
,
"skip bitstream encoding"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_NO_OUTPUT
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
{
"local_header"
,
"place global headers at every keyframe instead of in extradata"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_LOCAL_HEADER
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
{
"sub_id"
,
NULL
,
OFFSET
(
sub_id
),
AV_OPT_TYPE_INT
,
{.
dbl
=
DEFAULT
},
INT_MIN
,
INT_MAX
},
...
...
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