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
1616106f
Commit
1616106f
authored
Aug 22, 2018
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi_encode_vp9: Move options and common structures into context
parent
58d3ac31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
vaapi_encode_vp9.c
libavcodec/vaapi_encode_vp9.c
+15
-16
No files found.
libavcodec/vaapi_encode_vp9.c
View file @
1616106f
...
...
@@ -33,21 +33,25 @@
typedef
struct
VAAPIEncodeVP9Context
{
VAAPIEncodeContext
common
;
// User options.
int
loop_filter_level
;
int
loop_filter_sharpness
;
// Derived settings.
int
q_idx_idr
;
int
q_idx_p
;
int
q_idx_b
;
// Stream state.
// Reference direction for B-like frames:
// 0 - most recent P/IDR frame is last.
// 1 - most recent P frame is golden.
int
last_ref_dir
;
}
VAAPIEncodeVP9Context
;
typedef
struct
VAAPIEncodeVP9Options
{
int
loop_filter_level
;
int
loop_filter_sharpness
;
}
VAAPIEncodeVP9Options
;
#define vseq_var(name) vseq->name, name
#define vseq_field(name) vseq->seq_fields.bits.name, name
...
...
@@ -82,10 +86,8 @@ static int vaapi_encode_vp9_init_sequence_params(AVCodecContext *avctx)
static
int
vaapi_encode_vp9_init_picture_params
(
AVCodecContext
*
avctx
,
VAAPIEncodePicture
*
pic
)
{
VAAPIEncode
Context
*
ctx
=
avctx
->
priv_data
;
VAAPIEncode
VP9Context
*
priv
=
avctx
->
priv_data
;
VAEncPictureParameterBufferVP9
*
vpic
=
pic
->
codec_picture_params
;
VAAPIEncodeVP9Context
*
priv
=
ctx
->
priv_data
;
VAAPIEncodeVP9Options
*
opt
=
ctx
->
codec_options
;
int
i
;
vpic
->
reconstructed_frame
=
pic
->
recon_surface
;
...
...
@@ -169,8 +171,8 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx,
vpic
->
chroma_ac_qindex_delta
=
0
;
vpic
->
chroma_dc_qindex_delta
=
0
;
vpic
->
filter_level
=
opt
->
loop_filter_level
;
vpic
->
sharpness_level
=
opt
->
loop_filter_sharpness
;
vpic
->
filter_level
=
priv
->
loop_filter_level
;
vpic
->
sharpness_level
=
priv
->
loop_filter_sharpness
;
if
(
avctx
->
max_b_frames
>
0
&&
pic
->
type
==
PICTURE_TYPE_P
)
priv
->
last_ref_dir
=
!
priv
->
last_ref_dir
;
...
...
@@ -180,8 +182,7 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx,
static
av_cold
int
vaapi_encode_vp9_configure
(
AVCodecContext
*
avctx
)
{
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
VAAPIEncodeVP9Context
*
priv
=
ctx
->
priv_data
;
VAAPIEncodeVP9Context
*
priv
=
avctx
->
priv_data
;
priv
->
q_idx_p
=
av_clip
(
avctx
->
global_quality
,
0
,
VP9_MAX_QUANT
);
if
(
avctx
->
i_quant_factor
>
0
.
0
)
...
...
@@ -266,8 +267,7 @@ static av_cold int vaapi_encode_vp9_init(AVCodecContext *avctx)
return
ff_vaapi_encode_init
(
avctx
);
}
#define OFFSET(x) (offsetof(VAAPIEncodeContext, codec_options_data) + \
offsetof(VAAPIEncodeVP9Options, x))
#define OFFSET(x) offsetof(VAAPIEncodeVP9Context, x)
#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
static
const
AVOption
vaapi_encode_vp9_options
[]
=
{
{
"loop_filter_level"
,
"Loop filter level"
,
...
...
@@ -298,8 +298,7 @@ AVCodec ff_vp9_vaapi_encoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"VP9 (VAAPI)"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_VP9
,
.
priv_data_size
=
(
sizeof
(
VAAPIEncodeContext
)
+
sizeof
(
VAAPIEncodeVP9Options
)),
.
priv_data_size
=
sizeof
(
VAAPIEncodeVP9Context
),
.
init
=
&
vaapi_encode_vp9_init
,
.
encode2
=
&
ff_vaapi_encode2
,
.
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