[Libva] [Libva-intel-driver][PATCH 03/18] Add some new internal variables for a new sequence

Xiang, Haihao haihao.xiang at intel.com
Wed Sep 7 03:03:20 UTC 2016


> On 09/06/2016 11:41 PM, Xiang, Haihao wrote:
> > Currently these variables are used only for H.264 encoding
> > 
> > Signed-off-by: Xiang, Haihao<haihao.xiang at intel.com>
> > ---
> >   src/i965_encoder.c | 7 +++++++
> >   src/i965_encoder.h | 4 ++++
> >   2 files changed, 11 insertions(+)
> > 
> > diff --git a/src/i965_encoder.c b/src/i965_encoder.c
> > index e7e1554..d045881 100644
> > --- a/src/i965_encoder.c
> > +++ b/src/i965_encoder.c
> > @@ -376,6 +376,12 @@
> > intel_encoder_check_avc_parameter(VADriverContextP ctx,
> >        */
> >       encoder_context->is_new_sequence = (pic_param-
> > >pic_fields.bits.idr_pic_flag&&  seq_param);
> > 
> > +    if (encoder_context->is_new_sequence) {
> > +        encoder_context->num_frames_in_sequence = 0;
> > +        encoder_context->frame_width_in_mbs = seq_param-
> > >picture_width_in_mbs;
> > +        encoder_context->frame_height_in_mbs = seq_param-
> > >picture_height_in_mbs;
> > +    }
> > +
> >       return VA_STATUS_SUCCESS;
> > 
> >   error:
> > @@ -775,6 +781,7 @@ intel_encoder_end_picture(VADriverContextP ctx,
> >       }
> > 
> >       encoder_context->mfc_pipeline(ctx, profile, encode_state,
> > encoder_context);
> > +    encoder_context->num_frames_in_sequence++;
> > 
> >       return VA_STATUS_SUCCESS;
> >   }
> > diff --git a/src/i965_encoder.h b/src/i965_encoder.h
> > index bec83e3..de20ef9 100644
> > --- a/src/i965_encoder.h
> > +++ b/src/i965_encoder.h
> > @@ -59,6 +59,10 @@ struct intel_encoder_context
> >       unsigned int rate_control_mode;
> >       unsigned int quality_level;
> >       unsigned int quality_range;
> > +    unsigned int num_frames_in_sequence;
> > +    unsigned int frame_width_in_mbs;
> > +    unsigned int frame_height_in_mbs;
> 
> Can we rename the frame_width_in_mbs/frame_height_in_mbs to 
> frame_width_in_pixel/frame_height_in_pixel?
> The frame_width_in_mbs/frame_height_in_mbs is specific to some codec.

frame_width_in_mbs/frame_height_in_mbs
and frame_width_in_pixel/frame_height_in_pixel are different. 
We can add the two new fields if they are needed in the future.

Thanks
Haihao

> 
> Thanks
>     Yakui
> > +
> >       void *vme_context;
> >       void *mfc_context;
> >       void *enc_priv_state;
> 


More information about the Libva mailing list