40 va_pic->picture_id = VA_INVALID_ID;
41 va_pic->flags = VA_PICTURE_H264_INVALID;
42 va_pic->TopFieldOrderCnt = 0;
43 va_pic->BottomFieldOrderCnt = 0;
58 if (pic_structure == 0)
67 va_pic->flags |= (pic_structure &
PICT_TOP_FIELD) ? VA_PICTURE_H264_TOP_FIELD : VA_PICTURE_H264_BOTTOM_FIELD;
69 va_pic->flags |= pic->
long_ref ? VA_PICTURE_H264_LONG_TERM_REFERENCE : VA_PICTURE_H264_SHORT_TERM_REFERENCE;
71 va_pic->TopFieldOrderCnt = 0;
73 va_pic->TopFieldOrderCnt = pic->
field_poc[0];
75 va_pic->BottomFieldOrderCnt = 0;
77 va_pic->BottomFieldOrderCnt = pic->
field_poc[1];
100 for (i = 0; i < dpb->
size; i++) {
101 VAPictureH264 *
const va_pic = &dpb->
va_pics[i];
103 VAPictureH264 temp_va_pic;
106 if ((temp_va_pic.flags ^ va_pic->flags) & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD)) {
107 va_pic->flags |= temp_va_pic.flags & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD);
109 if (temp_va_pic.flags & VA_PICTURE_H264_TOP_FIELD) {
110 va_pic->TopFieldOrderCnt = temp_va_pic.TopFieldOrderCnt;
112 va_pic->BottomFieldOrderCnt = temp_va_pic.BottomFieldOrderCnt;
132 dpb.
va_pics = pic_param->ReferenceFrames;
142 for (i = 0; i < 16; i++) {
160 unsigned int ref_count)
162 unsigned int i,
n = 0;
163 for (i = 0; i < ref_count; i++)
164 if (ref_list[i].reference)
188 unsigned char *luma_weight_flag,
189 short luma_weight[32],
190 short luma_offset[32],
191 unsigned char *chroma_weight_flag,
192 short chroma_weight[32][2],
193 short chroma_offset[32][2])
200 for (i = 0; i < h->
ref_count[list]; i++) {
210 for (j = 0; j < 2; j++) {
216 chroma_offset[i][j] = 0;
229 VAPictureParameterBufferH264 *pic_param;
230 VAIQMatrixBufferH264 *iq_matrix;
232 av_dlog(avctx,
"vaapi_h264_start_frame()\n");
243 pic_param->picture_width_in_mbs_minus1 = h->
mb_width - 1;
244 pic_param->picture_height_in_mbs_minus1 = h->
mb_height - 1;
248 pic_param->seq_fields.value = 0;
253 pic_param->seq_fields.bits.mb_adaptive_frame_field_flag = h->
sps.
mb_aff;
255 pic_param->seq_fields.bits.MinLumaBiPredSize8x8 = h->
sps.
level_idc >= 31;
257 pic_param->seq_fields.bits.pic_order_cnt_type = h->
sps.
poc_type;
258 pic_param->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = h->
sps.
log2_max_poc_lsb - 4;
262 pic_param->slice_group_change_rate_minus1 = 0;
263 pic_param->pic_init_qp_minus26 = h->
pps.
init_qp - 26;
264 pic_param->pic_init_qs_minus26 = h->
pps.
init_qs - 26;
267 pic_param->pic_fields.value = 0;
268 pic_param->pic_fields.bits.entropy_coding_mode_flag = h->
pps.
cabac;
277 pic_param->pic_fields.bits.reference_pic_flag = h->
nal_ref_idc != 0;
284 memcpy(iq_matrix->ScalingList4x4, h->
pps.
scaling_matrix4,
sizeof(iq_matrix->ScalingList4x4));
285 memcpy(iq_matrix->ScalingList8x8[0], h->
pps.
scaling_matrix8[0],
sizeof(iq_matrix->ScalingList8x8[0]));
286 memcpy(iq_matrix->ScalingList8x8[1], h->
pps.
scaling_matrix8[3],
sizeof(iq_matrix->ScalingList8x8[0]));
297 av_dlog(avctx,
"vaapi_h264_end_frame()\n");
319 VASliceParameterBufferH264 *slice_param;
321 av_dlog(avctx,
"vaapi_h264_decode_slice(): buffer %p, size %d\n",
346 &slice_param->luma_weight_l0_flag, slice_param->luma_weight_l0, slice_param->luma_offset_l0,
347 &slice_param->chroma_weight_l0_flag, slice_param->chroma_weight_l0, slice_param->chroma_offset_l0);
349 &slice_param->luma_weight_l1_flag, slice_param->luma_weight_l1, slice_param->luma_offset_l1,
350 &slice_param->chroma_weight_l1_flag, slice_param->chroma_weight_l1, slice_param->chroma_offset_l1);
355 .
name =
"h264_vaapi",