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
5f44a4a0
Commit
5f44a4a0
authored
Feb 28, 2017
by
Konda Raju
Committed by
Timo Rothenpieler
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: add initial QP value options
Signed-off-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
a549243b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
9 deletions
+35
-9
nvenc.c
libavcodec/nvenc.c
+25
-8
nvenc.h
libavcodec/nvenc.h
+3
-0
nvenc_h264.c
libavcodec/nvenc_h264.c
+3
-0
nvenc_hevc.c
libavcodec/nvenc_hevc.c
+3
-0
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/nvenc.c
View file @
5f44a4a0
...
@@ -547,16 +547,33 @@ static av_cold void set_vbr(AVCodecContext *avctx)
...
@@ -547,16 +547,33 @@ static av_cold void set_vbr(AVCodecContext *avctx)
}
}
rc
->
enableInitialRCQP
=
1
;
rc
->
enableInitialRCQP
=
1
;
rc
->
initialRCQP
.
qpInterP
=
qp_inter_p
;
if
(
avctx
->
i_quant_factor
!=
0
.
0
&&
avctx
->
b_quant_factor
!=
0
.
0
)
{
if
(
ctx
->
init_qp_p
<
0
)
{
rc
->
initialRCQP
.
qpIntra
=
av_clip
(
rc
->
initialRCQP
.
qpInterP
=
qp_inter_p
;
qp_inter_p
*
fabs
(
avctx
->
i_quant_factor
)
+
avctx
->
i_quant_offset
+
0
.
5
,
0
,
51
);
rc
->
initialRCQP
.
qpInterB
=
av_clip
(
qp_inter_p
*
fabs
(
avctx
->
b_quant_factor
)
+
avctx
->
b_quant_offset
+
0
.
5
,
0
,
51
);
}
else
{
}
else
{
rc
->
initialRCQP
.
qpIntra
=
qp_inter_p
;
rc
->
initialRCQP
.
qpInterP
=
ctx
->
init_qp_p
;
rc
->
initialRCQP
.
qpInterB
=
qp_inter_p
;
}
if
(
ctx
->
init_qp_i
<
0
)
{
if
(
avctx
->
i_quant_factor
!=
0
.
0
&&
avctx
->
b_quant_factor
!=
0
.
0
)
{
rc
->
initialRCQP
.
qpIntra
=
av_clip
(
rc
->
initialRCQP
.
qpInterP
*
fabs
(
avctx
->
i_quant_factor
)
+
avctx
->
i_quant_offset
+
0
.
5
,
0
,
51
);
}
else
{
rc
->
initialRCQP
.
qpIntra
=
rc
->
initialRCQP
.
qpInterP
;
}
}
else
{
rc
->
initialRCQP
.
qpIntra
=
ctx
->
init_qp_i
;
}
if
(
ctx
->
init_qp_b
<
0
)
{
if
(
avctx
->
i_quant_factor
!=
0
.
0
&&
avctx
->
b_quant_factor
!=
0
.
0
)
{
rc
->
initialRCQP
.
qpInterB
=
av_clip
(
rc
->
initialRCQP
.
qpInterP
*
fabs
(
avctx
->
b_quant_factor
)
+
avctx
->
b_quant_offset
+
0
.
5
,
0
,
51
);
}
else
{
rc
->
initialRCQP
.
qpInterB
=
rc
->
initialRCQP
.
qpInterP
;
}
}
else
{
rc
->
initialRCQP
.
qpInterB
=
ctx
->
init_qp_b
;
}
}
}
}
...
...
libavcodec/nvenc.h
View file @
5f44a4a0
...
@@ -155,6 +155,9 @@ typedef struct NvencContext
...
@@ -155,6 +155,9 @@ typedef struct NvencContext
int
quality
;
int
quality
;
int
aud
;
int
aud
;
int
bluray_compat
;
int
bluray_compat
;
int
init_qp_p
;
int
init_qp_b
;
int
init_qp_i
;
}
NvencContext
;
}
NvencContext
;
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
int
ff_nvenc_encode_init
(
AVCodecContext
*
avctx
);
...
...
libavcodec/nvenc_h264.c
View file @
5f44a4a0
...
@@ -109,6 +109,9 @@ static const AVOption options[] = {
...
@@ -109,6 +109,9 @@ static const AVOption options[] = {
OFFSET
(
quality
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
51
,
VE
},
OFFSET
(
quality
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
51
,
VE
},
{
"aud"
,
"Use access unit delimiters"
,
OFFSET
(
aud
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"aud"
,
"Use access unit delimiters"
,
OFFSET
(
aud
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"bluray-compat"
,
"Bluray compatibility workarounds"
,
OFFSET
(
bluray_compat
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"bluray-compat"
,
"Bluray compatibility workarounds"
,
OFFSET
(
bluray_compat
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
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_qpI"
,
"Initial QP value for I frame"
,
OFFSET
(
init_qp_i
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
libavcodec/nvenc_hevc.c
View file @
5f44a4a0
...
@@ -106,6 +106,9 @@ static const AVOption options[] = {
...
@@ -106,6 +106,9 @@ static const AVOption options[] = {
OFFSET
(
quality
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
51
,
VE
},
OFFSET
(
quality
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
51
,
VE
},
{
"aud"
,
"Use access unit delimiters"
,
OFFSET
(
aud
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"aud"
,
"Use access unit delimiters"
,
OFFSET
(
aud
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"bluray-compat"
,
"Bluray compatibility workarounds"
,
OFFSET
(
bluray_compat
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"bluray-compat"
,
"Bluray compatibility workarounds"
,
OFFSET
(
bluray_compat
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
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_qpI"
,
"Initial QP value for I frame"
,
OFFSET
(
init_qp_i
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
51
,
VE
},
{
NULL
}
{
NULL
}
};
};
...
...
libavcodec/version.h
View file @
5f44a4a0
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 81
#define LIBAVCODEC_VERSION_MINOR 81
#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