Skip to content

Commit

Permalink
avcodec/mpeg12enc: support mpeg2 encoder const profile
Browse files Browse the repository at this point in the history
Reviewed-by: Marton Balint <[email protected]>
Signed-off-by: Limin Wang <[email protected]>
  • Loading branch information
lance-lmwang committed May 31, 2020
1 parent b8d6d93 commit dd76226
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/encoders.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,20 @@ MPEG-2 video encoder.
@subsection Options

@table @option
@item profile @var{integer}
Select the mpeg2 profile to encode:

@table @samp
@item 422
@item main
@item ss
Spatially Scalable
@item snr
SNR Scalable
@item high
@item simple
@end table

@item seq_disp_ext @var{integer}
Specifies if the encoder should write a sequence_display_extension to the
output.
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/mpeg12enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "mpeg12data.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "profiles.h"

static const uint8_t svcd_scan_offset_placeholder[] = {
0x10, 0x0E, 0x00, 0x80, 0x81, 0x00, 0x80,
Expand Down Expand Up @@ -1167,6 +1168,7 @@ static const AVOption mpeg2_options[] = {
{ "mac", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_MAC }, 0, 0, VE, "video_format" },
{ "unspecified", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_UNSPECIFIED}, 0, 0, VE, "video_format" },
FF_MPV_COMMON_OPTS
FF_MPEG2_PROFILE_OPTS
{ NULL },
};

Expand Down
8 changes: 8 additions & 0 deletions libavcodec/profiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\
FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\

#define FF_MPEG2_PROFILE_OPTS \
FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, FF_PROFILE_MPEG2_422)\
FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\
FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, FF_PROFILE_MPEG2_SS)\
FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\
FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\
FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\

extern const AVProfile ff_aac_profiles[];
extern const AVProfile ff_dca_profiles[];
extern const AVProfile ff_dnxhd_profiles[];
Expand Down

0 comments on commit dd76226

Please sign in to comment.