summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSun, Mingruo <mingruo.sun@intel.com>2015-07-30 19:05:51 +0800
committerAustin Yuan <shengquan.yuan@intel.com>2015-07-31 09:59:38 +0800
commitbae9819c57989f8dd3e6f55e9d812f7e3fd744dd (patch)
tree01c02cf407e13757e0f1af97cbed49b1ed46b2ae
parentb8cb865f6c4b93533453191718eed41bbdfd63f6 (diff)
vaenc: refine update_RefPicList to fix the potential issue
Signed-off-by: Sun, Mingruo <mingruo.sun@intel.com>
-rw-r--r--vaenc/h264encode.c16
-rw-r--r--vaenc/va_encode.c1
2 files changed, 14 insertions, 3 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;
}
diff --git a/vaenc/va_encode.c b/vaenc/va_encode.c
index 33f0aa9..5eb8929 100644
--- a/vaenc/va_encode.c
+++ b/vaenc/va_encode.c
@@ -742,7 +742,6 @@ static int process_cmdline(int argc, char *argv[])
case 59:
if (!strncmp(optarg, "LP", 2)) {
va_entrypoint = VAEntrypointEncSliceLP;
- carc = 2; //disable MBBRC for VDENC
}
break;
case 60: