34 return VA_INVALID_SURFACE;
43 VADecPictureParameterBufferVP9 pic_param;
49 pic_param = (VADecPictureParameterBufferVP9) {
50 .frame_width = avctx->
width,
51 .frame_height = avctx->
height,
56 .frame_type = !
h->h.keyframe,
57 .show_frame = !
h->h.invisible,
58 .error_resilient_mode =
h->h.errorres,
59 .intra_only =
h->h.intraonly,
60 .allow_high_precision_mv =
h->h.keyframe ? 0 :
h->h.highprecisionmvs,
61 .mcomp_filter_type =
h->h.filtermode ^ (
h->h.filtermode <= 1),
62 .frame_parallel_decoding_mode =
h->h.parallelmode,
63 .reset_frame_context =
h->h.resetctx,
64 .refresh_frame_context =
h->h.refreshctx,
65 .frame_context_idx =
h->h.framectxid,
67 .segmentation_enabled =
h->h.segmentation.enabled,
68 .segmentation_temporal_update =
h->h.segmentation.temporal,
69 .segmentation_update_map =
h->h.segmentation.update_map,
71 .last_ref_frame =
h->h.refidx[0],
72 .last_ref_frame_sign_bias =
h->h.signbias[0],
73 .golden_ref_frame =
h->h.refidx[1],
74 .golden_ref_frame_sign_bias =
h->h.signbias[1],
75 .alt_ref_frame =
h->h.refidx[2],
76 .alt_ref_frame_sign_bias =
h->h.signbias[2],
77 .lossless_flag =
h->h.lossless,
80 .filter_level =
h->h.filter.level,
81 .sharpness_level =
h->h.filter.sharpness,
82 .log2_tile_rows =
h->h.tiling.log2_tile_rows,
83 .log2_tile_columns =
h->h.tiling.log2_tile_cols,
85 .frame_header_length_in_bytes =
h->h.uncompressed_header_size,
86 .first_partition_size =
h->h.compressed_header_size,
88 .profile =
h->h.profile,
89 .bit_depth =
h->h.bpp,
92 for (
i = 0;
i < 7;
i++)
93 pic_param.mb_segment_tree_probs[
i] =
h->h.segmentation.prob[
i];
95 if (
h->h.segmentation.temporal) {
96 for (
i = 0;
i < 3;
i++)
97 pic_param.segment_pred_probs[
i] =
h->h.segmentation.pred_prob[
i];
99 memset(pic_param.segment_pred_probs, 255,
sizeof(pic_param.segment_pred_probs));
102 for (
i = 0;
i < 8;
i++) {
103 if (
h->refs[
i].f->buf[0])
106 pic_param.reference_frames[
i] = VA_INVALID_ID;
110 VAPictureParameterBufferType,
111 &pic_param,
sizeof(pic_param));
134 VASliceParameterBufferVP9 slice_param;
137 slice_param = (VASliceParameterBufferVP9) {
138 .slice_data_size =
size,
139 .slice_data_offset = 0,
140 .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
143 for (
i = 0;
i < 8;
i++) {
144 slice_param.seg_param[
i] = (VASegmentParameterVP9) {
145 .segment_flags.fields = {
146 .segment_reference_enabled =
h->h.segmentation.feat[
i].ref_enabled,
147 .segment_reference =
h->h.segmentation.feat[
i].ref_val,
148 .segment_reference_skipped =
h->h.segmentation.feat[
i].skip_enabled,
151 .luma_dc_quant_scale =
h->h.segmentation.feat[
i].qmul[0][0],
152 .luma_ac_quant_scale =
h->h.segmentation.feat[
i].qmul[0][1],
153 .chroma_dc_quant_scale =
h->h.segmentation.feat[
i].qmul[1][0],
154 .chroma_ac_quant_scale =
h->h.segmentation.feat[
i].qmul[1][1],
157 memcpy(slice_param.seg_param[
i].filter_level,
h->h.segmentation.feat[
i].lflvl,
sizeof(slice_param.seg_param[
i].filter_level));
161 &slice_param, 1,
sizeof(slice_param),
172 .
p.
name =
"vp9_vaapi",