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
01775730
Commit
01775730
authored
May 09, 2017
by
Sumit Agarwal
Committed by
Timo Rothenpieler
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: add weighted prediction support
Signed-off-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
18a659d1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
1 deletion
+15
-1
nvenc.c
libavcodec/nvenc.c
+9
-0
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
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/nvenc.c
View file @
01775730
...
@@ -298,6 +298,12 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
...
@@ -298,6 +298,12 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
return
AVERROR
(
ENOSYS
);
return
AVERROR
(
ENOSYS
);
}
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_WEIGHTED_PREDICTION
);
if
(
ctx
->
weighted_pred
>
0
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_VERBOSE
,
"Weighted Prediction not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
return
0
;
return
0
;
}
}
...
@@ -1032,6 +1038,9 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
...
@@ -1032,6 +1038,9 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
ctx
->
init_encode_params
.
enableEncodeAsync
=
0
;
ctx
->
init_encode_params
.
enableEncodeAsync
=
0
;
ctx
->
init_encode_params
.
enablePTD
=
1
;
ctx
->
init_encode_params
.
enablePTD
=
1
;
if
(
ctx
->
weighted_pred
==
1
)
ctx
->
init_encode_params
.
enableWeightedPrediction
=
1
;
if
(
ctx
->
bluray_compat
)
{
if
(
ctx
->
bluray_compat
)
{
ctx
->
aud
=
1
;
ctx
->
aud
=
1
;
avctx
->
refs
=
FFMIN
(
FFMAX
(
avctx
->
refs
,
0
),
6
);
avctx
->
refs
=
FFMIN
(
FFMAX
(
avctx
->
refs
,
0
),
6
);
...
...
libavcodec/nvenc.h
View file @
01775730
...
@@ -161,6 +161,7 @@ typedef struct NvencContext
...
@@ -161,6 +161,7 @@ typedef struct NvencContext
int
init_qp_b
;
int
init_qp_b
;
int
init_qp_i
;
int
init_qp_i
;
int
cqp
;
int
cqp
;
int
weighted_pred
;
}
NvencContext
;
}
NvencContext
;
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
...
...
libavcodec/nvenc_h264.c
View file @
01775730
...
@@ -117,6 +117,8 @@ static const AVOption options[] = {
...
@@ -117,6 +117,8 @@ static const AVOption options[] = {
{
"init_qpI"
,
"Initial QP value for I frame"
,
OFFSET
(
init_qp_i
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpI"
,
"Initial QP value for I frame"
,
OFFSET
(
init_qp_i
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"qp"
,
"Constant quantization parameter rate control method"
,
{
"qp"
,
"Constant quantization parameter rate control method"
,
OFFSET
(
cqp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
OFFSET
(
cqp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"weighted_pred"
,
"Set 1 to enable weighted prediction"
,
OFFSET
(
weighted_pred
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
libavcodec/nvenc_hevc.c
View file @
01775730
...
@@ -114,6 +114,8 @@ static const AVOption options[] = {
...
@@ -114,6 +114,8 @@ static const AVOption options[] = {
{
"init_qpI"
,
"Initial QP value for I frame"
,
OFFSET
(
init_qp_i
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpI"
,
"Initial QP value for I frame"
,
OFFSET
(
init_qp_i
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"qp"
,
"Constant quantization parameter rate control method"
,
{
"qp"
,
"Constant quantization parameter rate control method"
,
OFFSET
(
cqp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
OFFSET
(
cqp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"weighted_pred"
,
"Set 1 to enable weighted prediction"
,
OFFSET
(
weighted_pred
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
libavcodec/version.h
View file @
01775730
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 95
#define LIBAVCODEC_VERSION_MINOR 95
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
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