diff options
Diffstat (limited to 'vaenc/h264encode.c')
-rw-r--r-- | vaenc/h264encode.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/vaenc/h264encode.c b/vaenc/h264encode.c index 195e966..aa4a897 100644 --- a/vaenc/h264encode.c +++ b/vaenc/h264encode.c @@ -541,6 +541,17 @@ static int update_ReferenceFrames(void) static int update_RefPicList(void) { unsigned int current_poc = CurrentCurrPic.TopFieldOrderCnt; + int i = 0; + + /* Init reference frame list */ + for (i = 0; i < 32; i++) { + RefPicList0_P[i].picture_id = VA_INVALID_SURFACE; + RefPicList0_P[i].flags = VA_PICTURE_H264_INVALID; + RefPicList0_B[i].picture_id = VA_INVALID_SURFACE; + RefPicList0_B[i].flags = VA_PICTURE_H264_INVALID; + RefPicList1_B[i].picture_id = VA_INVALID_SURFACE; + RefPicList1_B[i].flags = VA_PICTURE_H264_INVALID; + } if (current_frame_type == FRAME_P) { memcpy(RefPicList0_P, ReferenceFrames, numShortTerm * sizeof(VAPictureH264)); @@ -556,7 +567,7 @@ static int update_RefPicList(void) sort_two(RefPicList1_B, 0, numShortTerm-1, current_poc, 0, 0, 1, 0); } - + return 0; } @@ -1111,7 +1122,7 @@ static int render_slice(void) mb_rendered += current_slice->num_macroblocks; } current_slice->slice_type = (current_frame_type == FRAME_IDR)? 2 : current_frame_type; - if (current_frame_type == FRAME_IDR) { + if ((current_frame_type == FRAME_IDR) || (current_frame_type == FRAME_I)) { if (current_frame_encoding != 0) ++current_slice->idr_pic_id; /* Reset reference for IDR also */ @@ -1383,6 +1394,7 @@ static VAStatus h264_get_config(void) h264_attrib[i].type = i; if (va_entrypoint == VAEntrypointEncSliceLP) { + /* disable MBBRC for VDENC */ carc = 2; } |