Skip to content

Commit

Permalink
avcodec/nvenc: add udu_sei option to import user data unregistered SEIs
Browse files Browse the repository at this point in the history
Signed-off-by: Limin Wang <[email protected]>
Signed-off-by: Timo Rothenpieler <[email protected]>
  • Loading branch information
lance-lmwang authored and BtbN committed Dec 25, 2021
1 parent f3a949d commit 0c8741f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libavcodec/nvenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,9 @@ static int prepare_sei_data_array(AVCodecContext *avctx, const AVFrame *frame)
}
}

if (!ctx->udu_sei)
return sei_count;

for (i = 0; i < frame->nb_side_data; i++) {
AVFrameSideData *side_data = frame->side_data[i];
void *tmp;
Expand Down
1 change: 1 addition & 0 deletions libavcodec/nvenc.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ typedef struct NvencContext
int intra_refresh;
int single_slice_intra_refresh;
int constrained_encoding;
int udu_sei;
} NvencContext;

int ff_nvenc_encode_init(AVCodecContext *avctx);
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/nvenc_h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ static const AVOption options[] = {
#endif
{ "extra_sei", "Pass on extra SEI data (e.g. a53 cc) to be included in the bitstream",
OFFSET(extra_sei), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
{ "udu_sei", "Pass on user data unregistered SEI if available",
OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "intra-refresh","Use Periodic Intra Refresh instead of IDR frames",
OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "single-slice-intra-refresh", "Use single slice intra refresh",
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/nvenc_hevc.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ static const AVOption options[] = {
#endif
{ "extra_sei", "Pass on extra SEI data (e.g. a53 cc) to be included in the bitstream",
OFFSET(extra_sei), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
{ "udu_sei", "Pass on user data unregistered SEI if available",
OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "intra-refresh","Use Periodic Intra Refresh instead of IDR frames",
OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "single-slice-intra-refresh", "Use single slice intra refresh",
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define LIBAVCODEC_VERSION_MAJOR 59
#define LIBAVCODEC_VERSION_MINOR 15
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_MICRO 101

#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
Expand Down

0 comments on commit 0c8741f

Please sign in to comment.