hardware/intel/libva
修訂 | 398abf60c4b43deadcdaaf55bac4285cc3fa5896 (tree) |
---|---|
時間 | 2013-06-24 17:46:16 |
作者 | Zhao Yakui <yakui.zhao@inte...> |
Commiter | Xiang, Haihao |
AVCENC: Pass the H264 RefPicList0/1 by using slice_param instead of hacked DPB reference
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit 968a9bf006679ad8d752fa1ddcd4bb80fc8c5e51)
@@ -151,6 +151,8 @@ static struct { | ||
151 | 151 | int i_dpb_output_delay_length; |
152 | 152 | } avcenc_context; |
153 | 153 | |
154 | +static VAPictureH264 ReferenceFrames[16], RefPicList0[32], RefPicList1[32]; | |
155 | + | |
154 | 156 | static void create_encode_pipe() |
155 | 157 | { |
156 | 158 | VAEntrypoint entrypoints[5]; |
@@ -442,6 +444,23 @@ static void avcenc_update_slice_parameter(int slice_type) | ||
442 | 444 | slice_param->idr_pic_id = 0; |
443 | 445 | |
444 | 446 | /* FIXME: fill other fields */ |
447 | + if ((slice_type == SLICE_TYPE_P) || (slice_type == SLICE_TYPE_B)) { | |
448 | + int j; | |
449 | + slice_param->RefPicList0[0].picture_id = surface_ids[SID_REFERENCE_PICTURE_L0]; | |
450 | + for (j = 1; j < 32; j++) { | |
451 | + slice_param->RefPicList0[j].picture_id = VA_INVALID_SURFACE; | |
452 | + slice_param->RefPicList0[j].flags = VA_PICTURE_H264_INVALID; | |
453 | + } | |
454 | + } | |
455 | + | |
456 | + if ((slice_type == SLICE_TYPE_B)) { | |
457 | + int j; | |
458 | + slice_param->RefPicList1[0].picture_id = surface_ids[SID_REFERENCE_PICTURE_L1]; | |
459 | + for (j = 1; j < 32; j++) { | |
460 | + slice_param->RefPicList1[j].picture_id = VA_INVALID_SURFACE; | |
461 | + slice_param->RefPicList1[j].flags = VA_PICTURE_H264_INVALID; | |
462 | + } | |
463 | + } | |
445 | 464 | |
446 | 465 | va_status = vaCreateBuffer(va_dpy, |
447 | 466 | avcenc_context.context_id, |