diff options
-rw-r--r-- | src/gen8_mfd.c | 5 | ||||
-rw-r--r-- | src/i965_decoder_utils.c | 52 |
2 files changed, 57 insertions, 0 deletions
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c index b828675..ff38c41 100644 --- a/src/gen8_mfd.c +++ b/src/gen8_mfd.c @@ -2770,6 +2770,11 @@ gen8_mfd_vp8_decode_init(VADriverContextP ctx, assert(width_in_mbs > 0 && width_in_mbs <= 256); /* 4K */ assert(height_in_mbs > 0 && height_in_mbs <= 256); + intel_update_vp8_frame_store_index(ctx, + decode_state, + pic_param, + gen7_mfd_context->reference_surface); + /* Current decoded picture */ obj_surface = decode_state->render_object; i965_check_alloc_surface_bo(ctx, obj_surface, 1, VA_FOURCC('N','V','1','2'), SUBSAMPLE_YUV420); diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c index 8f12c4d..cf7f60b 100644 --- a/src/i965_decoder_utils.c +++ b/src/i965_decoder_utils.c @@ -493,6 +493,58 @@ intel_update_vc1_frame_store_index(VADriverContextP ctx, } +void +intel_update_vp8_frame_store_index(VADriverContextP ctx, + struct decode_state *decode_state, + VAPictureParameterBufferVP8 *pic_param, + GenFrameStore frame_store[MAX_GEN_REFERENCE_FRAMES]) +{ + struct object_surface *obj_surface; + int i; + + obj_surface = decode_state->reference_objects[0]; + + if (pic_param->last_ref_frame == VA_INVALID_ID || + !obj_surface || + !obj_surface->bo) { + frame_store[0].surface_id = VA_INVALID_ID; + frame_store[0].obj_surface = NULL; + } else { + frame_store[0].surface_id = pic_param->last_ref_frame; + frame_store[0].obj_surface = obj_surface; + } + + obj_surface = decode_state->reference_objects[1]; + + if (pic_param->golden_ref_frame == VA_INVALID_ID || + !obj_surface || + !obj_surface->bo) { + frame_store[1].surface_id = frame_store[0].surface_id; + frame_store[1].obj_surface = frame_store[0].obj_surface; + } else { + frame_store[1].surface_id = pic_param->golden_ref_frame; + frame_store[1].obj_surface = obj_surface; + } + + obj_surface = decode_state->reference_objects[2]; + + if (pic_param->alt_ref_frame == VA_INVALID_ID || + !obj_surface || + !obj_surface->bo) { + frame_store[2].surface_id = frame_store[0].surface_id; + frame_store[2].obj_surface = frame_store[0].obj_surface; + } else { + frame_store[2].surface_id = pic_param->alt_ref_frame; + frame_store[2].obj_surface = obj_surface; + } + + for (i = 3; i < MAX_GEN_REFERENCE_FRAMES; i++) { + frame_store[i].surface_id = frame_store[i % 2].surface_id; + frame_store[i].obj_surface = frame_store[i % 2].obj_surface; + } + +} + static VAStatus intel_decoder_check_avc_parameter(VADriverContextP ctx, struct decode_state *decode_state) |