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
92fdea37
Commit
92fdea37
authored
Apr 12, 2016
by
Mark Thompson
Committed by
Anton Khirnov
Apr 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi_h265: Add -qp option, use it to replace use of -global_quality
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
f70e4627
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
vaapi_encode_h265.c
libavcodec/vaapi_encode_h265.c
+18
-3
No files found.
libavcodec/vaapi_encode_h265.c
View file @
92fdea37
...
@@ -194,6 +194,10 @@ typedef struct VAAPIEncodeH265Context {
...
@@ -194,6 +194,10 @@ typedef struct VAAPIEncodeH265Context {
}
hrd_params
;
}
hrd_params
;
}
VAAPIEncodeH265Context
;
}
VAAPIEncodeH265Context
;
typedef
struct
VAAPIEncodeH265Options
{
int
qp
;
}
VAAPIEncodeH265Options
;
#define vseq_var(name) vseq->name, name
#define vseq_var(name) vseq->name, name
#define vseq_field(name) vseq->seq_fields.bits.name, name
#define vseq_field(name) vseq->seq_fields.bits.name, name
...
@@ -1201,8 +1205,9 @@ static av_cold int vaapi_encode_h265_init_fixed_qp(AVCodecContext *avctx)
...
@@ -1201,8 +1205,9 @@ static av_cold int vaapi_encode_h265_init_fixed_qp(AVCodecContext *avctx)
{
{
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
VAAPIEncodeH265Context
*
priv
=
ctx
->
priv_data
;
VAAPIEncodeH265Context
*
priv
=
ctx
->
priv_data
;
VAAPIEncodeH265Options
*
opt
=
ctx
->
codec_options
;
priv
->
fixed_qp_p
=
avctx
->
global_quality
;
priv
->
fixed_qp_p
=
opt
->
qp
;
if
(
avctx
->
i_quant_factor
>
0
.
0
)
if
(
avctx
->
i_quant_factor
>
0
.
0
)
priv
->
fixed_qp_idr
=
(
int
)((
priv
->
fixed_qp_p
*
avctx
->
i_quant_factor
+
priv
->
fixed_qp_idr
=
(
int
)((
priv
->
fixed_qp_p
*
avctx
->
i_quant_factor
+
avctx
->
i_quant_offset
)
+
0
.
5
);
avctx
->
i_quant_offset
)
+
0
.
5
);
...
@@ -1312,13 +1317,21 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
...
@@ -1312,13 +1317,21 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
return
ff_vaapi_encode_init
(
avctx
,
&
vaapi_encode_type_h265
);
return
ff_vaapi_encode_init
(
avctx
,
&
vaapi_encode_type_h265
);
}
}
#define OFFSET(x) (offsetof(VAAPIEncodeContext, codec_options_data) + \
offsetof(VAAPIEncodeH265Options, x))
#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
static
const
AVOption
vaapi_encode_h265_options
[]
=
{
{
"qp"
,
"Constant QP (for P frames; scaled by qfactor/qoffset for I/B)"
,
OFFSET
(
qp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
25
},
0
,
52
,
FLAGS
},
{
NULL
},
};
static
const
AVCodecDefault
vaapi_encode_h265_defaults
[]
=
{
static
const
AVCodecDefault
vaapi_encode_h265_defaults
[]
=
{
{
"profile"
,
"1"
},
{
"profile"
,
"1"
},
{
"level"
,
"51"
},
{
"level"
,
"51"
},
{
"b"
,
"0"
},
{
"b"
,
"0"
},
{
"bf"
,
"2"
},
{
"bf"
,
"2"
},
{
"g"
,
"120"
},
{
"g"
,
"120"
},
{
"global_quality"
,
"25"
},
{
"i_qfactor"
,
"1.0"
},
{
"i_qfactor"
,
"1.0"
},
{
"i_qoffset"
,
"0.0"
},
{
"i_qoffset"
,
"0.0"
},
{
"b_qfactor"
,
"1.2"
},
{
"b_qfactor"
,
"1.2"
},
...
@@ -1329,6 +1342,7 @@ static const AVCodecDefault vaapi_encode_h265_defaults[] = {
...
@@ -1329,6 +1342,7 @@ static const AVCodecDefault vaapi_encode_h265_defaults[] = {
static
const
AVClass
vaapi_encode_h265_class
=
{
static
const
AVClass
vaapi_encode_h265_class
=
{
.
class_name
=
"h265_vaapi"
,
.
class_name
=
"h265_vaapi"
,
.
item_name
=
av_default_item_name
,
.
item_name
=
av_default_item_name
,
.
option
=
vaapi_encode_h265_options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
};
...
@@ -1337,7 +1351,8 @@ AVCodec ff_hevc_vaapi_encoder = {
...
@@ -1337,7 +1351,8 @@ AVCodec ff_hevc_vaapi_encoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"H.265/HEVC (VAAPI)"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"H.265/HEVC (VAAPI)"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_HEVC
,
.
id
=
AV_CODEC_ID_HEVC
,
.
priv_data_size
=
sizeof
(
VAAPIEncodeContext
),
.
priv_data_size
=
(
sizeof
(
VAAPIEncodeContext
)
+
sizeof
(
VAAPIEncodeH265Options
)),
.
init
=
&
vaapi_encode_h265_init
,
.
init
=
&
vaapi_encode_h265_init
,
.
encode2
=
&
ff_vaapi_encode2
,
.
encode2
=
&
ff_vaapi_encode2
,
.
close
=
&
ff_vaapi_encode_close
,
.
close
=
&
ff_vaapi_encode_close
,
...
...
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