39 va_pic->picture_id = VA_INVALID_ID;
40 va_pic->flags = VA_PICTURE_H264_INVALID;
41 va_pic->TopFieldOrderCnt = 0;
42 va_pic->BottomFieldOrderCnt = 0;
57 if (pic_structure == 0)
66 va_pic->flags |= (pic_structure &
PICT_TOP_FIELD) ? VA_PICTURE_H264_TOP_FIELD : VA_PICTURE_H264_BOTTOM_FIELD;
68 va_pic->flags |= pic->
long_ref ? VA_PICTURE_H264_LONG_TERM_REFERENCE : VA_PICTURE_H264_SHORT_TERM_REFERENCE;
70 va_pic->TopFieldOrderCnt = 0;
72 va_pic->TopFieldOrderCnt = pic->
field_poc[0];
74 va_pic->BottomFieldOrderCnt = 0;
76 va_pic->BottomFieldOrderCnt = pic->
field_poc[1];
99 for (i = 0; i < dpb->
size; i++) {
100 VAPictureH264 *
const va_pic = &dpb->
va_pics[i];
102 VAPictureH264 temp_va_pic;
105 if ((temp_va_pic.flags ^ va_pic->flags) & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD)) {
106 va_pic->flags |= temp_va_pic.flags & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD);
108 if (temp_va_pic.flags & VA_PICTURE_H264_TOP_FIELD) {
109 va_pic->TopFieldOrderCnt = temp_va_pic.TopFieldOrderCnt;
111 va_pic->BottomFieldOrderCnt = temp_va_pic.BottomFieldOrderCnt;
131 dpb.
va_pics = pic_param->ReferenceFrames;
141 for (i = 0; i < 16; i++) {
159 unsigned int ref_count)
161 unsigned int i,
n = 0;
162 for (i = 0; i < ref_count; i++)
163 if (ref_list[i].reference)
187 unsigned char *luma_weight_flag,
188 short luma_weight[32],
189 short luma_offset[32],
190 unsigned char *chroma_weight_flag,
191 short chroma_weight[32][2],
192 short chroma_offset[32][2])
199 for (i = 0; i < h->
ref_count[list]; i++) {
209 for (j = 0; j < 2; j++) {
215 chroma_offset[i][j] = 0;
228 VAPictureParameterBufferH264 *pic_param;
229 VAIQMatrixBufferH264 *iq_matrix;
231 av_dlog(avctx,
"vaapi_h264_start_frame()\n");
242 pic_param->picture_width_in_mbs_minus1 = h->
mb_width - 1;
243 pic_param->picture_height_in_mbs_minus1 = h->
mb_height - 1;
247 pic_param->seq_fields.value = 0;
252 pic_param->seq_fields.bits.mb_adaptive_frame_field_flag = h->
sps.
mb_aff;
254 pic_param->seq_fields.bits.MinLumaBiPredSize8x8 = h->
sps.
level_idc >= 31;
256 pic_param->seq_fields.bits.pic_order_cnt_type = h->
sps.
poc_type;
257 pic_param->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = h->
sps.
log2_max_poc_lsb - 4;
261 pic_param->slice_group_change_rate_minus1 = 0;
262 pic_param->pic_init_qp_minus26 = h->
pps.
init_qp - 26;
263 pic_param->pic_init_qs_minus26 = h->
pps.
init_qs - 26;
266 pic_param->pic_fields.value = 0;
267 pic_param->pic_fields.bits.entropy_coding_mode_flag = h->
pps.
cabac;
276 pic_param->pic_fields.bits.reference_pic_flag = h->
nal_ref_idc != 0;
283 memcpy(iq_matrix->ScalingList4x4, h->
pps.
scaling_matrix4,
sizeof(iq_matrix->ScalingList4x4));
284 memcpy(iq_matrix->ScalingList8x8[0], h->
pps.
scaling_matrix8[0],
sizeof(iq_matrix->ScalingList8x8[0]));
285 memcpy(iq_matrix->ScalingList8x8[1], h->
pps.
scaling_matrix8[3],
sizeof(iq_matrix->ScalingList8x8[0]));
296 av_dlog(avctx,
"vaapi_h264_end_frame()\n");
318 VASliceParameterBufferH264 *slice_param;
320 av_dlog(avctx,
"vaapi_h264_decode_slice(): buffer %p, size %d\n",
345 &slice_param->luma_weight_l0_flag, slice_param->luma_weight_l0, slice_param->luma_offset_l0,
346 &slice_param->chroma_weight_l0_flag, slice_param->chroma_weight_l0, slice_param->chroma_offset_l0);
348 &slice_param->luma_weight_l1_flag, slice_param->luma_weight_l1, slice_param->luma_offset_l1,
349 &slice_param->chroma_weight_l1_flag, slice_param->chroma_weight_l1, slice_param->chroma_offset_l1);
354 .
name =
"h264_vaapi",