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
7fb2a7af
Commit
7fb2a7af
authored
Mar 23, 2017
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: Deprecate usage of global_quality, introducing qp
parent
038e6aef
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
6 deletions
+17
-6
nvenc.c
libavcodec/nvenc.c
+11
-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
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/nvenc.c
View file @
7fb2a7af
...
@@ -522,10 +522,10 @@ static av_cold void set_constqp(AVCodecContext *avctx)
...
@@ -522,10 +522,10 @@ static av_cold void set_constqp(AVCodecContext *avctx)
rc
->
constQP
.
qpIntra
=
rc
->
constQP
.
qpInterP
;
rc
->
constQP
.
qpIntra
=
rc
->
constQP
.
qpInterP
;
rc
->
constQP
.
qpInterB
=
rc
->
constQP
.
qpInterP
;
rc
->
constQP
.
qpInterB
=
rc
->
constQP
.
qpInterP
;
}
}
}
else
if
(
avctx
->
global_quality
>
0
)
{
}
else
if
(
ctx
->
cqp
>=
0
)
{
rc
->
constQP
.
qpInterP
=
avctx
->
global_quality
;
rc
->
constQP
.
qpInterP
=
ctx
->
cqp
;
rc
->
constQP
.
qpInterB
=
avctx
->
global_quality
;
rc
->
constQP
.
qpInterB
=
ctx
->
cqp
;
rc
->
constQP
.
qpIntra
=
avctx
->
global_quality
;
rc
->
constQP
.
qpIntra
=
ctx
->
cqp
;
}
}
avctx
->
qmin
=
-
1
;
avctx
->
qmin
=
-
1
;
...
@@ -664,6 +664,12 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
...
@@ -664,6 +664,12 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
{
{
NvencContext
*
ctx
=
avctx
->
priv_data
;
NvencContext
*
ctx
=
avctx
->
priv_data
;
if
(
avctx
->
global_quality
>
0
)
av_log
(
avctx
,
AV_LOG_WARNING
,
"Using global_quality with nvenc is deprecated. Use qp instead.
\n
"
);
if
(
ctx
->
cqp
<
0
&&
avctx
->
global_quality
>
0
)
ctx
->
cqp
=
avctx
->
global_quality
;
if
(
avctx
->
bit_rate
>
0
)
{
if
(
avctx
->
bit_rate
>
0
)
{
ctx
->
encode_config
.
rcParams
.
averageBitRate
=
avctx
->
bit_rate
;
ctx
->
encode_config
.
rcParams
.
averageBitRate
=
avctx
->
bit_rate
;
}
else
if
(
ctx
->
encode_config
.
rcParams
.
averageBitRate
>
0
)
{
}
else
if
(
ctx
->
encode_config
.
rcParams
.
averageBitRate
>
0
)
{
...
@@ -688,7 +694,7 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
...
@@ -688,7 +694,7 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
}
else
{
}
else
{
ctx
->
rc
=
NV_ENC_PARAMS_RC_CBR
;
ctx
->
rc
=
NV_ENC_PARAMS_RC_CBR
;
}
}
}
else
if
(
avctx
->
global_quality
>
0
)
{
}
else
if
(
ctx
->
cqp
>=
0
)
{
ctx
->
rc
=
NV_ENC_PARAMS_RC_CONSTQP
;
ctx
->
rc
=
NV_ENC_PARAMS_RC_CONSTQP
;
}
else
if
(
ctx
->
twopass
)
{
}
else
if
(
ctx
->
twopass
)
{
ctx
->
rc
=
NV_ENC_PARAMS_RC_2_PASS_VBR
;
ctx
->
rc
=
NV_ENC_PARAMS_RC_2_PASS_VBR
;
...
...
libavcodec/nvenc.h
View file @
7fb2a7af
...
@@ -158,6 +158,7 @@ typedef struct NvencContext
...
@@ -158,6 +158,7 @@ typedef struct NvencContext
int
init_qp_p
;
int
init_qp_p
;
int
init_qp_b
;
int
init_qp_b
;
int
init_qp_i
;
int
init_qp_i
;
int
cqp
;
}
NvencContext
;
}
NvencContext
;
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
...
...
libavcodec/nvenc_h264.c
View file @
7fb2a7af
...
@@ -112,6 +112,8 @@ static const AVOption options[] = {
...
@@ -112,6 +112,8 @@ static const AVOption options[] = {
{
"init_qpP"
,
"Initial QP value for P frame"
,
OFFSET
(
init_qp_p
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpP"
,
"Initial QP value for P frame"
,
OFFSET
(
init_qp_p
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpB"
,
"Initial QP value for B frame"
,
OFFSET
(
init_qp_b
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpB"
,
"Initial QP value for B frame"
,
OFFSET
(
init_qp_b
),
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
},
{
"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"
,
OFFSET
(
cqp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
libavcodec/nvenc_hevc.c
View file @
7fb2a7af
...
@@ -109,6 +109,8 @@ static const AVOption options[] = {
...
@@ -109,6 +109,8 @@ static const AVOption options[] = {
{
"init_qpP"
,
"Initial QP value for P frame"
,
OFFSET
(
init_qp_p
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpP"
,
"Initial QP value for P frame"
,
OFFSET
(
init_qp_p
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpB"
,
"Initial QP value for B frame"
,
OFFSET
(
init_qp_b
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
"init_qpB"
,
"Initial QP value for B frame"
,
OFFSET
(
init_qp_b
),
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
},
{
"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"
,
OFFSET
(
cqp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
libavcodec/version.h
View file @
7fb2a7af
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 85
#define LIBAVCODEC_VERSION_MINOR 85
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_MICRO 10
2
#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