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
567b5e33
Commit
567b5e33
authored
Sep 27, 2019
by
Roman Arzumanyan
Committed by
Timo Rothenpieler
Sep 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: add multiple reference frames support
Signed-off-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
e929b2f2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
nvenc.c
libavcodec/nvenc.c
+23
-0
nvenc.h
libavcodec/nvenc.h
+5
-0
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/nvenc.c
View file @
567b5e33
...
...
@@ -403,6 +403,19 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
}
#endif
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES
);
if
(
avctx
->
refs
!=
NV_ENC_NUM_REF_FRAMES_AUTOSELECT
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_VERBOSE
,
"Multiple reference frames are not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
#else
if
(
avctx
->
refs
!=
0
)
{
av_log
(
avctx
,
AV_LOG_VERBOSE
,
"Multiple reference frames need SDK 9.1 at build time
\n
"
);
return
AVERROR
(
ENOSYS
);
}
#endif
ctx
->
support_dyn_bitrate
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_DYN_BITRATE_CHANGE
);
return
0
;
...
...
@@ -1010,6 +1023,11 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
h264
->
useBFramesAsRef
=
ctx
->
b_ref_mode
;
#endif
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES
h264
->
numRefL0
=
avctx
->
refs
;
h264
->
numRefL1
=
avctx
->
refs
;
#endif
return
0
;
}
...
...
@@ -1094,6 +1112,11 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
hevc
->
useBFramesAsRef
=
ctx
->
b_ref_mode
;
#endif
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES
hevc
->
numRefL0
=
avctx
->
refs
;
hevc
->
numRefL1
=
avctx
->
refs
;
#endif
return
0
;
}
...
...
libavcodec/nvenc.h
View file @
567b5e33
...
...
@@ -54,6 +54,11 @@ typedef void ID3D11Device;
#define NVENC_HAVE_HEVC_BFRAME_REF_MODE
#endif
// SDK 9.1 compile time feature checks
#if NVENCAPI_CHECK_VERSION(9, 1)
#define NVENC_HAVE_MULTIPLE_REF_FRAMES
#endif
typedef
struct
NvencSurface
{
NV_ENC_INPUT_PTR
input_surface
;
...
...
libavcodec/version.h
View file @
567b5e33
...
...
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 59
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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