summaryrefslogtreecommitdiff
path: root/src/gen6_vme.c
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2013-03-12 15:34:21 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-03-15 15:45:28 +0800
commit54384c9585394db538b73eaf4227a59c7a452157 (patch)
treeeee2866f5fd4746ac3e12d54daa19afb54e37dd3 /src/gen6_vme.c
parent5fd61ebcd8621c095995e39cee1abda6b7d1b235 (diff)
downloadlibva-intel-driver-54384c9585394db538b73eaf4227a59c7a452157.tar.gz
libva-intel-driver-54384c9585394db538b73eaf4227a59c7a452157.tar.bz2
libva-intel-driver-54384c9585394db538b73eaf4227a59c7a452157.zip
Encoder: directly use the objects for the reference pictures
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src/gen6_vme.c')
-rw-r--r--src/gen6_vme.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/gen6_vme.c b/src/gen6_vme.c
index 3d5baa5..200a273 100644
--- a/src/gen6_vme.c
+++ b/src/gen6_vme.c
@@ -271,9 +271,7 @@ gen6_vme_surface_setup(VADriverContextP ctx,
int is_intra,
struct intel_encoder_context *encoder_context)
{
- struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_surface *obj_surface;
- VAEncPictureParameterBufferH264 *pPicParameter = (VAEncPictureParameterBufferH264 *)encode_state->pic_param_ext->buffer;
/*Setup surfaces state*/
/* current picture for encoding */
@@ -283,15 +281,15 @@ gen6_vme_surface_setup(VADriverContextP ctx,
if (!is_intra) {
/* reference 0 */
- obj_surface = SURFACE(pPicParameter->ReferenceFrames[0].picture_id);
- assert(obj_surface);
- if ( obj_surface->bo != NULL)
+ obj_surface = encode_state->reference_objects[0];
+
+ if (obj_surface && obj_surface->bo)
gen6_vme_source_surface_state(ctx, 1, obj_surface, encoder_context);
/* reference 1 */
- obj_surface = SURFACE(pPicParameter->ReferenceFrames[1].picture_id);
- assert(obj_surface);
- if ( obj_surface->bo != NULL )
+ obj_surface = encode_state->reference_objects[1];
+
+ if (obj_surface && obj_surface->bo)
gen6_vme_source_surface_state(ctx, 2, obj_surface, encoder_context);
}
@@ -734,9 +732,7 @@ gen6_vme_mpeg2_surface_setup(VADriverContextP ctx,
int is_intra,
struct intel_encoder_context *encoder_context)
{
- struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_surface *obj_surface;
- VAEncPictureParameterBufferMPEG2 *pic_param = (VAEncPictureParameterBufferMPEG2 *)encode_state->pic_param_ext->buffer;
/*Setup surfaces state*/
/* current picture for encoding */
@@ -746,13 +742,12 @@ gen6_vme_mpeg2_surface_setup(VADriverContextP ctx,
if (!is_intra) {
/* reference 0 */
- obj_surface = SURFACE(pic_param->forward_reference_picture);
- assert(obj_surface);
- if ( obj_surface->bo != NULL)
+ obj_surface = encode_state->reference_objects[0];
+ if (obj_surface->bo != NULL)
gen6_vme_source_surface_state(ctx, 1, obj_surface, encoder_context);
/* reference 1 */
- obj_surface = SURFACE(pic_param->backward_reference_picture);
+ obj_surface = encode_state->reference_objects[1];
if (obj_surface && obj_surface->bo != NULL)
gen6_vme_source_surface_state(ctx, 2, obj_surface, encoder_context);
}