diff options
Diffstat (limited to 'src/gen8_mfd.c')
-rw-r--r-- | src/gen8_mfd.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c index 1897d71..cecd05c 100644 --- a/src/gen8_mfd.c +++ b/src/gen8_mfd.c @@ -521,7 +521,7 @@ gen8_mfd_avc_directmode_state(VADriverContextP ctx, struct object_surface *obj_surface; GenAvcSurface *gen7_avc_surface; VAPictureH264 *va_pic; - int i, j; + int i; BEGIN_BCS_BATCH(batch, 71); OUT_BCS_BATCH(batch, MFX_AVC_DIRECTMODE_STATE | (71 - 2)); @@ -562,26 +562,14 @@ gen8_mfd_avc_directmode_state(VADriverContextP ctx, /* POC List */ for (i = 0; i < ARRAY_ELEMS(gen7_mfd_context->reference_surface); i++) { - if (gen7_mfd_context->reference_surface[i].surface_id != VA_INVALID_ID) { - int found = 0; + obj_surface = gen7_mfd_context->reference_surface[i].obj_surface; - assert(gen7_mfd_context->reference_surface[i].obj_surface != NULL); - - for (j = 0; j < ARRAY_ELEMS(pic_param->ReferenceFrames); j++) { - va_pic = &pic_param->ReferenceFrames[j]; - - if (va_pic->flags & VA_PICTURE_H264_INVALID) - continue; - - if (va_pic->picture_id == gen7_mfd_context->reference_surface[i].surface_id) { - found = 1; - break; - } - } + if (obj_surface) { + const VAPictureH264 * const va_pic = avc_find_picture( + obj_surface->base.id, pic_param->ReferenceFrames, + ARRAY_ELEMS(pic_param->ReferenceFrames)); - assert(found == 1); - assert(!(va_pic->flags & VA_PICTURE_H264_INVALID)); - + assert(va_pic != NULL); OUT_BCS_BATCH(batch, va_pic->TopFieldOrderCnt); OUT_BCS_BATCH(batch, va_pic->BottomFieldOrderCnt); } else { |