diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2013-05-09 14:21:32 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-06-24 16:46:16 +0800 |
commit | 398abf60c4b43deadcdaaf55bac4285cc3fa5896 (patch) | |
tree | dad2ed599266175779388ddb09d32cf1bf6a7f65 /test/encode | |
parent | 3c15867260dd6ccee81bc358b07a77eaeb38585e (diff) |
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)
Diffstat (limited to 'test/encode')
-rw-r--r-- | test/encode/avcenc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/encode/avcenc.c b/test/encode/avcenc.c index 5549060..fafb366 100644 --- a/test/encode/avcenc.c +++ b/test/encode/avcenc.c @@ -151,6 +151,8 @@ static struct { int i_dpb_output_delay_length; } avcenc_context; +static VAPictureH264 ReferenceFrames[16], RefPicList0[32], RefPicList1[32]; + static void create_encode_pipe() { VAEntrypoint entrypoints[5]; @@ -442,6 +444,23 @@ static void avcenc_update_slice_parameter(int slice_type) slice_param->idr_pic_id = 0; /* FIXME: fill other fields */ + if ((slice_type == SLICE_TYPE_P) || (slice_type == SLICE_TYPE_B)) { + int j; + slice_param->RefPicList0[0].picture_id = surface_ids[SID_REFERENCE_PICTURE_L0]; + for (j = 1; j < 32; j++) { + slice_param->RefPicList0[j].picture_id = VA_INVALID_SURFACE; + slice_param->RefPicList0[j].flags = VA_PICTURE_H264_INVALID; + } + } + + if ((slice_type == SLICE_TYPE_B)) { + int j; + slice_param->RefPicList1[0].picture_id = surface_ids[SID_REFERENCE_PICTURE_L1]; + for (j = 1; j < 32; j++) { + slice_param->RefPicList1[j].picture_id = VA_INVALID_SURFACE; + slice_param->RefPicList1[j].flags = VA_PICTURE_H264_INVALID; + } + } va_status = vaCreateBuffer(va_dpy, avcenc_context.context_id, |