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
1aab5d8a
Commit
1aab5d8a
authored
Jul 13, 2015
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/dxva2_hevc: unbreak compilation after recent sps/pps changes
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
b11c3fce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
70 deletions
+72
-70
dxva2_hevc.c
libavcodec/dxva2_hevc.c
+72
-70
No files found.
libavcodec/dxva2_hevc.c
View file @
1aab5d8a
...
@@ -57,102 +57,104 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
...
@@ -57,102 +57,104 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
DXVA_PicParams_HEVC
*
pp
)
DXVA_PicParams_HEVC
*
pp
)
{
{
const
HEVCFrame
*
current_picture
=
h
->
ref
;
const
HEVCFrame
*
current_picture
=
h
->
ref
;
const
HEVCSPS
*
sps
=
h
->
ps
.
sps
;
const
HEVCPPS
*
pps
=
h
->
ps
.
pps
;
int
i
,
j
;
int
i
,
j
;
memset
(
pp
,
0
,
sizeof
(
*
pp
));
memset
(
pp
,
0
,
sizeof
(
*
pp
));
pp
->
PicWidthInMinCbsY
=
h
->
sps
->
min_cb_width
;
pp
->
PicWidthInMinCbsY
=
sps
->
min_cb_width
;
pp
->
PicHeightInMinCbsY
=
h
->
sps
->
min_cb_height
;
pp
->
PicHeightInMinCbsY
=
sps
->
min_cb_height
;
pp
->
wFormatAndSequenceInfoFlags
=
(
h
->
sps
->
chroma_format_idc
<<
0
)
|
pp
->
wFormatAndSequenceInfoFlags
=
(
sps
->
chroma_format_idc
<<
0
)
|
(
h
->
sps
->
separate_colour_plane_flag
<<
2
)
|
(
sps
->
separate_colour_plane_flag
<<
2
)
|
((
h
->
sps
->
bit_depth
-
8
)
<<
3
)
|
((
sps
->
bit_depth
-
8
)
<<
3
)
|
((
h
->
sps
->
bit_depth
-
8
)
<<
6
)
|
((
sps
->
bit_depth
-
8
)
<<
6
)
|
((
h
->
sps
->
log2_max_poc_lsb
-
4
)
<<
9
)
|
((
sps
->
log2_max_poc_lsb
-
4
)
<<
9
)
|
(
0
<<
13
)
|
(
0
<<
13
)
|
(
0
<<
14
)
|
(
0
<<
14
)
|
(
0
<<
15
);
(
0
<<
15
);
fill_picture_entry
(
&
pp
->
CurrPic
,
ff_dxva2_get_surface_index
(
avctx
,
ctx
,
current_picture
->
frame
),
0
);
fill_picture_entry
(
&
pp
->
CurrPic
,
ff_dxva2_get_surface_index
(
avctx
,
ctx
,
current_picture
->
frame
),
0
);
pp
->
sps_max_dec_pic_buffering_minus1
=
h
->
sps
->
temporal_layer
[
h
->
sps
->
max_sub_layers
-
1
].
max_dec_pic_buffering
-
1
;
pp
->
sps_max_dec_pic_buffering_minus1
=
sps
->
temporal_layer
[
sps
->
max_sub_layers
-
1
].
max_dec_pic_buffering
-
1
;
pp
->
log2_min_luma_coding_block_size_minus3
=
h
->
sps
->
log2_min_cb_size
-
3
;
pp
->
log2_min_luma_coding_block_size_minus3
=
sps
->
log2_min_cb_size
-
3
;
pp
->
log2_diff_max_min_luma_coding_block_size
=
h
->
sps
->
log2_diff_max_min_coding_block_size
;
pp
->
log2_diff_max_min_luma_coding_block_size
=
sps
->
log2_diff_max_min_coding_block_size
;
pp
->
log2_min_transform_block_size_minus2
=
h
->
sps
->
log2_min_tb_size
-
2
;
pp
->
log2_min_transform_block_size_minus2
=
sps
->
log2_min_tb_size
-
2
;
pp
->
log2_diff_max_min_transform_block_size
=
h
->
sps
->
log2_max_trafo_size
-
h
->
sps
->
log2_min_tb_size
;
pp
->
log2_diff_max_min_transform_block_size
=
sps
->
log2_max_trafo_size
-
sps
->
log2_min_tb_size
;
pp
->
max_transform_hierarchy_depth_inter
=
h
->
sps
->
max_transform_hierarchy_depth_inter
;
pp
->
max_transform_hierarchy_depth_inter
=
sps
->
max_transform_hierarchy_depth_inter
;
pp
->
max_transform_hierarchy_depth_intra
=
h
->
sps
->
max_transform_hierarchy_depth_intra
;
pp
->
max_transform_hierarchy_depth_intra
=
sps
->
max_transform_hierarchy_depth_intra
;
pp
->
num_short_term_ref_pic_sets
=
h
->
sps
->
nb_st_rps
;
pp
->
num_short_term_ref_pic_sets
=
sps
->
nb_st_rps
;
pp
->
num_long_term_ref_pics_sps
=
h
->
sps
->
num_long_term_ref_pics_sps
;
pp
->
num_long_term_ref_pics_sps
=
sps
->
num_long_term_ref_pics_sps
;
pp
->
num_ref_idx_l0_default_active_minus1
=
h
->
pps
->
num_ref_idx_l0_default_active
-
1
;
pp
->
num_ref_idx_l0_default_active_minus1
=
pps
->
num_ref_idx_l0_default_active
-
1
;
pp
->
num_ref_idx_l1_default_active_minus1
=
h
->
pps
->
num_ref_idx_l1_default_active
-
1
;
pp
->
num_ref_idx_l1_default_active_minus1
=
pps
->
num_ref_idx_l1_default_active
-
1
;
pp
->
init_qp_minus26
=
h
->
pps
->
pic_init_qp_minus26
;
pp
->
init_qp_minus26
=
pps
->
pic_init_qp_minus26
;
if
(
h
->
sh
.
short_term_ref_pic_set_sps_flag
==
0
&&
h
->
sh
.
short_term_rps
)
{
if
(
h
->
sh
.
short_term_ref_pic_set_sps_flag
==
0
&&
h
->
sh
.
short_term_rps
)
{
pp
->
ucNumDeltaPocsOfRefRpsIdx
=
h
->
sh
.
short_term_rps
->
num_delta_pocs
;
pp
->
ucNumDeltaPocsOfRefRpsIdx
=
h
->
sh
.
short_term_rps
->
num_delta_pocs
;
pp
->
wNumBitsForShortTermRPSInSlice
=
h
->
sh
.
short_term_ref_pic_set_size
;
pp
->
wNumBitsForShortTermRPSInSlice
=
h
->
sh
.
short_term_ref_pic_set_size
;
}
}
pp
->
dwCodingParamToolFlags
=
(
h
->
sps
->
scaling_list_enable_flag
<<
0
)
|
pp
->
dwCodingParamToolFlags
=
(
sps
->
scaling_list_enable_flag
<<
0
)
|
(
h
->
sps
->
amp_enabled_flag
<<
1
)
|
(
sps
->
amp_enabled_flag
<<
1
)
|
(
h
->
sps
->
sao_enabled
<<
2
)
|
(
sps
->
sao_enabled
<<
2
)
|
(
h
->
sps
->
pcm_enabled_flag
<<
3
)
|
(
sps
->
pcm_enabled_flag
<<
3
)
|
((
h
->
sps
->
pcm_enabled_flag
?
(
h
->
sps
->
pcm
.
bit_depth
-
1
)
:
0
)
<<
4
)
|
((
sps
->
pcm_enabled_flag
?
(
sps
->
pcm
.
bit_depth
-
1
)
:
0
)
<<
4
)
|
((
h
->
sps
->
pcm_enabled_flag
?
(
h
->
sps
->
pcm
.
bit_depth_chroma
-
1
)
:
0
)
<<
8
)
|
((
sps
->
pcm_enabled_flag
?
(
sps
->
pcm
.
bit_depth_chroma
-
1
)
:
0
)
<<
8
)
|
((
h
->
sps
->
pcm_enabled_flag
?
(
h
->
sps
->
pcm
.
log2_min_pcm_cb_size
-
3
)
:
0
)
<<
12
)
|
((
sps
->
pcm_enabled_flag
?
(
sps
->
pcm
.
log2_min_pcm_cb_size
-
3
)
:
0
)
<<
12
)
|
((
h
->
sps
->
pcm_enabled_flag
?
(
h
->
sps
->
pcm
.
log2_max_pcm_cb_size
-
h
->
sps
->
pcm
.
log2_min_pcm_cb_size
)
:
0
)
<<
14
)
|
((
sps
->
pcm_enabled_flag
?
(
sps
->
pcm
.
log2_max_pcm_cb_size
-
sps
->
pcm
.
log2_min_pcm_cb_size
)
:
0
)
<<
14
)
|
(
h
->
sps
->
pcm
.
loop_filter_disable_flag
<<
16
)
|
(
sps
->
pcm
.
loop_filter_disable_flag
<<
16
)
|
(
h
->
sps
->
long_term_ref_pics_present_flag
<<
17
)
|
(
sps
->
long_term_ref_pics_present_flag
<<
17
)
|
(
h
->
sps
->
sps_temporal_mvp_enabled_flag
<<
18
)
|
(
sps
->
sps_temporal_mvp_enabled_flag
<<
18
)
|
(
h
->
sps
->
sps_strong_intra_smoothing_enable_flag
<<
19
)
|
(
sps
->
sps_strong_intra_smoothing_enable_flag
<<
19
)
|
(
h
->
pps
->
dependent_slice_segments_enabled_flag
<<
20
)
|
(
pps
->
dependent_slice_segments_enabled_flag
<<
20
)
|
(
h
->
pps
->
output_flag_present_flag
<<
21
)
|
(
pps
->
output_flag_present_flag
<<
21
)
|
(
h
->
pps
->
num_extra_slice_header_bits
<<
22
)
|
(
pps
->
num_extra_slice_header_bits
<<
22
)
|
(
h
->
pps
->
sign_data_hiding_flag
<<
25
)
|
(
pps
->
sign_data_hiding_flag
<<
25
)
|
(
h
->
pps
->
cabac_init_present_flag
<<
26
)
|
(
pps
->
cabac_init_present_flag
<<
26
)
|
(
0
<<
27
);
(
0
<<
27
);
pp
->
dwCodingSettingPicturePropertyFlags
=
(
h
->
pps
->
constrained_intra_pred_flag
<<
0
)
|
pp
->
dwCodingSettingPicturePropertyFlags
=
(
pps
->
constrained_intra_pred_flag
<<
0
)
|
(
h
->
pps
->
transform_skip_enabled_flag
<<
1
)
|
(
pps
->
transform_skip_enabled_flag
<<
1
)
|
(
h
->
pps
->
cu_qp_delta_enabled_flag
<<
2
)
|
(
pps
->
cu_qp_delta_enabled_flag
<<
2
)
|
(
h
->
pps
->
pic_slice_level_chroma_qp_offsets_present_flag
<<
3
)
|
(
pps
->
pic_slice_level_chroma_qp_offsets_present_flag
<<
3
)
|
(
h
->
pps
->
weighted_pred_flag
<<
4
)
|
(
pps
->
weighted_pred_flag
<<
4
)
|
(
h
->
pps
->
weighted_bipred_flag
<<
5
)
|
(
pps
->
weighted_bipred_flag
<<
5
)
|
(
h
->
pps
->
transquant_bypass_enable_flag
<<
6
)
|
(
pps
->
transquant_bypass_enable_flag
<<
6
)
|
(
h
->
pps
->
tiles_enabled_flag
<<
7
)
|
(
pps
->
tiles_enabled_flag
<<
7
)
|
(
h
->
pps
->
entropy_coding_sync_enabled_flag
<<
8
)
|
(
pps
->
entropy_coding_sync_enabled_flag
<<
8
)
|
(
h
->
pps
->
uniform_spacing_flag
<<
9
)
|
(
pps
->
uniform_spacing_flag
<<
9
)
|
((
h
->
pps
->
tiles_enabled_flag
?
h
->
pps
->
loop_filter_across_tiles_enabled_flag
:
0
)
<<
10
)
|
((
pps
->
tiles_enabled_flag
?
pps
->
loop_filter_across_tiles_enabled_flag
:
0
)
<<
10
)
|
(
h
->
pps
->
seq_loop_filter_across_slices_enabled_flag
<<
11
)
|
(
pps
->
seq_loop_filter_across_slices_enabled_flag
<<
11
)
|
(
h
->
pps
->
deblocking_filter_override_enabled_flag
<<
12
)
|
(
pps
->
deblocking_filter_override_enabled_flag
<<
12
)
|
(
h
->
pps
->
disable_dbf
<<
13
)
|
(
pps
->
disable_dbf
<<
13
)
|
(
h
->
pps
->
lists_modification_present_flag
<<
14
)
|
(
pps
->
lists_modification_present_flag
<<
14
)
|
(
h
->
pps
->
slice_header_extension_present_flag
<<
15
)
|
(
pps
->
slice_header_extension_present_flag
<<
15
)
|
(
IS_IRAP
(
h
)
<<
16
)
|
(
IS_IRAP
(
h
)
<<
16
)
|
(
IS_IDR
(
h
)
<<
17
)
|
(
IS_IDR
(
h
)
<<
17
)
|
/* IntraPicFlag */
/* IntraPicFlag */
(
IS_IRAP
(
h
)
<<
18
)
|
(
IS_IRAP
(
h
)
<<
18
)
|
(
0
<<
19
);
(
0
<<
19
);
pp
->
pps_cb_qp_offset
=
h
->
pps
->
cb_qp_offset
;
pp
->
pps_cb_qp_offset
=
pps
->
cb_qp_offset
;
pp
->
pps_cr_qp_offset
=
h
->
pps
->
cr_qp_offset
;
pp
->
pps_cr_qp_offset
=
pps
->
cr_qp_offset
;
if
(
h
->
pps
->
tiles_enabled_flag
)
{
if
(
pps
->
tiles_enabled_flag
)
{
pp
->
num_tile_columns_minus1
=
h
->
pps
->
num_tile_columns
-
1
;
pp
->
num_tile_columns_minus1
=
pps
->
num_tile_columns
-
1
;
pp
->
num_tile_rows_minus1
=
h
->
pps
->
num_tile_rows
-
1
;
pp
->
num_tile_rows_minus1
=
pps
->
num_tile_rows
-
1
;
if
(
!
h
->
pps
->
uniform_spacing_flag
)
{
if
(
!
pps
->
uniform_spacing_flag
)
{
for
(
i
=
0
;
i
<
h
->
pps
->
num_tile_columns
;
i
++
)
for
(
i
=
0
;
i
<
pps
->
num_tile_columns
;
i
++
)
pp
->
column_width_minus1
[
i
]
=
h
->
pps
->
column_width
[
i
]
-
1
;
pp
->
column_width_minus1
[
i
]
=
pps
->
column_width
[
i
]
-
1
;
for
(
i
=
0
;
i
<
h
->
pps
->
num_tile_rows
;
i
++
)
for
(
i
=
0
;
i
<
pps
->
num_tile_rows
;
i
++
)
pp
->
row_height_minus1
[
i
]
=
h
->
pps
->
row_height
[
i
]
-
1
;
pp
->
row_height_minus1
[
i
]
=
pps
->
row_height
[
i
]
-
1
;
}
}
}
}
pp
->
diff_cu_qp_delta_depth
=
h
->
pps
->
diff_cu_qp_delta_depth
;
pp
->
diff_cu_qp_delta_depth
=
pps
->
diff_cu_qp_delta_depth
;
pp
->
pps_beta_offset_div2
=
h
->
pps
->
beta_offset
/
2
;
pp
->
pps_beta_offset_div2
=
pps
->
beta_offset
/
2
;
pp
->
pps_tc_offset_div2
=
h
->
pps
->
tc_offset
/
2
;
pp
->
pps_tc_offset_div2
=
pps
->
tc_offset
/
2
;
pp
->
log2_parallel_merge_level_minus2
=
h
->
pps
->
log2_parallel_merge_level
-
2
;
pp
->
log2_parallel_merge_level_minus2
=
pps
->
log2_parallel_merge_level
-
2
;
pp
->
CurrPicOrderCntVal
=
h
->
poc
;
pp
->
CurrPicOrderCntVal
=
h
->
poc
;
// fill RefPicList from the DPB
// fill RefPicList from the DPB
...
@@ -197,8 +199,8 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
...
@@ -197,8 +199,8 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
static
void
fill_scaling_lists
(
AVDXVAContext
*
ctx
,
const
HEVCContext
*
h
,
DXVA_Qmatrix_HEVC
*
qm
)
static
void
fill_scaling_lists
(
AVDXVAContext
*
ctx
,
const
HEVCContext
*
h
,
DXVA_Qmatrix_HEVC
*
qm
)
{
{
unsigned
i
,
j
,
pos
;
unsigned
i
,
j
,
pos
;
const
ScalingList
*
sl
=
h
->
pps
->
scaling_list_data_present_flag
?
const
ScalingList
*
sl
=
h
->
p
s
.
p
ps
->
scaling_list_data_present_flag
?
&
h
->
p
ps
->
scaling_list
:
&
h
->
sps
->
scaling_list
;
&
h
->
p
s
.
pps
->
scaling_list
:
&
h
->
ps
.
sps
->
scaling_list
;
memset
(
qm
,
0
,
sizeof
(
*
qm
));
memset
(
qm
,
0
,
sizeof
(
*
qm
));
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
...
...
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