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
e929b2f2
Commit
e929b2f2
authored
Sep 27, 2019
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: switch to dedicated dpb_size option
Signed-off-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
460f7449
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
nvenc.c
libavcodec/nvenc.c
+5
-5
nvenc.h
libavcodec/nvenc.h
+1
-0
nvenc_h264.c
libavcodec/nvenc_h264.c
+2
-0
nvenc_hevc.c
libavcodec/nvenc_hevc.c
+2
-0
No files found.
libavcodec/nvenc.c
View file @
e929b2f2
...
@@ -949,9 +949,9 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
...
@@ -949,9 +949,9 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
h264
->
repeatSPSPPS
=
(
avctx
->
flags
&
AV_CODEC_FLAG_GLOBAL_HEADER
)
?
0
:
1
;
h264
->
repeatSPSPPS
=
(
avctx
->
flags
&
AV_CODEC_FLAG_GLOBAL_HEADER
)
?
0
:
1
;
h264
->
outputAUD
=
ctx
->
aud
;
h264
->
outputAUD
=
ctx
->
aud
;
if
(
avctx
->
refs
>=
0
)
{
if
(
ctx
->
dpb_size
>=
0
)
{
/* 0 means "let the hardware decide" */
/* 0 means "let the hardware decide" */
h264
->
maxNumRefFrames
=
avctx
->
refs
;
h264
->
maxNumRefFrames
=
ctx
->
dpb_size
;
}
}
if
(
avctx
->
gop_size
>=
0
)
{
if
(
avctx
->
gop_size
>=
0
)
{
h264
->
idrPeriod
=
cc
->
gopLength
;
h264
->
idrPeriod
=
cc
->
gopLength
;
...
@@ -1041,9 +1041,9 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
...
@@ -1041,9 +1041,9 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
hevc
->
repeatSPSPPS
=
(
avctx
->
flags
&
AV_CODEC_FLAG_GLOBAL_HEADER
)
?
0
:
1
;
hevc
->
repeatSPSPPS
=
(
avctx
->
flags
&
AV_CODEC_FLAG_GLOBAL_HEADER
)
?
0
:
1
;
hevc
->
outputAUD
=
ctx
->
aud
;
hevc
->
outputAUD
=
ctx
->
aud
;
if
(
avctx
->
refs
>=
0
)
{
if
(
ctx
->
dpb_size
>=
0
)
{
/* 0 means "let the hardware decide" */
/* 0 means "let the hardware decide" */
hevc
->
maxNumRefFramesInDPB
=
avctx
->
refs
;
hevc
->
maxNumRefFramesInDPB
=
ctx
->
dpb_size
;
}
}
if
(
avctx
->
gop_size
>=
0
)
{
if
(
avctx
->
gop_size
>=
0
)
{
hevc
->
idrPeriod
=
cc
->
gopLength
;
hevc
->
idrPeriod
=
cc
->
gopLength
;
...
@@ -1175,7 +1175,7 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
...
@@ -1175,7 +1175,7 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
if
(
ctx
->
bluray_compat
)
{
if
(
ctx
->
bluray_compat
)
{
ctx
->
aud
=
1
;
ctx
->
aud
=
1
;
avctx
->
refs
=
FFMIN
(
FFMAX
(
avctx
->
refs
,
0
),
6
);
ctx
->
dpb_size
=
FFMIN
(
FFMAX
(
avctx
->
refs
,
0
),
6
);
avctx
->
max_b_frames
=
FFMIN
(
avctx
->
max_b_frames
,
3
);
avctx
->
max_b_frames
=
FFMIN
(
avctx
->
max_b_frames
,
3
);
switch
(
avctx
->
codec
->
id
)
{
switch
(
avctx
->
codec
->
id
)
{
case
AV_CODEC_ID_H264
:
case
AV_CODEC_ID_H264
:
...
...
libavcodec/nvenc.h
View file @
e929b2f2
...
@@ -192,6 +192,7 @@ typedef struct NvencContext
...
@@ -192,6 +192,7 @@ typedef struct NvencContext
int
coder
;
int
coder
;
int
b_ref_mode
;
int
b_ref_mode
;
int
a53_cc
;
int
a53_cc
;
int
dpb_size
;
}
NvencContext
;
}
NvencContext
;
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
...
...
libavcodec/nvenc_h264.c
View file @
e929b2f2
...
@@ -138,6 +138,8 @@ static const AVOption options[] = {
...
@@ -138,6 +138,8 @@ static const AVOption options[] = {
{
"middle"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
2
},
0
,
0
,
VE
,
"b_ref_mode"
},
{
"middle"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
2
},
0
,
0
,
VE
,
"b_ref_mode"
},
#endif
#endif
{
"a53cc"
,
"Use A53 Closed Captions (if available)"
,
OFFSET
(
a53_cc
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
1
},
0
,
1
,
VE
},
{
"a53cc"
,
"Use A53 Closed Captions (if available)"
,
OFFSET
(
a53_cc
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
1
},
0
,
1
,
VE
},
{
"dpb_size"
,
"Specifies the DPB size used for encoding (0 means automatic)"
,
OFFSET
(
dpb_size
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
INT_MAX
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
libavcodec/nvenc_hevc.c
View file @
e929b2f2
...
@@ -127,6 +127,8 @@ static const AVOption options[] = {
...
@@ -127,6 +127,8 @@ static const AVOption options[] = {
{
"each"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
1
},
0
,
0
,
VE
,
"b_ref_mode"
},
{
"each"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
1
},
0
,
0
,
VE
,
"b_ref_mode"
},
{
"middle"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
2
},
0
,
0
,
VE
,
"b_ref_mode"
},
{
"middle"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
2
},
0
,
0
,
VE
,
"b_ref_mode"
},
#endif
#endif
{
"dpb_size"
,
"Specifies the DPB size used for encoding (0 means automatic)"
,
OFFSET
(
dpb_size
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
INT_MAX
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
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