[Libva] [Libva-intel-driver][PATH 2/3] Save other bitrate control parameters in the common encoder context
Xiang, Haihao
haihao.xiang at intel.com
Mon Nov 28 07:22:02 UTC 2016
> On 11/25/2016 04:22 PM, Xiang, Haihao wrote:
> > From: "peng.chen"<peng.c.chen at intel.com>
> >
> > These parameters can be used for all codecs
> >
> > Signed-off-by: peng.chen<peng.c.chen at intel.com>
> > Signed-off-by: Xiang, Haihao<haihao.xiang at intel.com>
> > ---
> > src/i965_encoder.c | 14 +++++++++++++-
> > src/i965_encoder.h | 2 ++
> > 2 files changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/i965_encoder.c b/src/i965_encoder.c
> > index 4a90dd4..78b982a 100644
> > --- a/src/i965_encoder.c
> > +++ b/src/i965_encoder.c
> > @@ -393,11 +393,23 @@
> > intel_encoder_check_rate_control_parameter(VADriverContextP ctx,
> > if (temporal_id>= encoder_context->layer.num_layers)
> > return;
> >
> > - // TODO: for VBR
> > + if (misc->rc_flags.bits.reset)
> > + encoder_context->brc.need_reset = 1;
> > +
> > if (encoder_context->brc.bits_per_second[temporal_id] !=
> > misc->bits_per_second) {
> > encoder_context->brc.bits_per_second[temporal_id] = misc-
> > >bits_per_second;
> > encoder_context->brc.need_reset = 1;
> > }
> > +
> > + if (encoder_context->brc.mb_rate_control != misc-
> > >rc_flags.bits.mb_rate_control) {
> > + encoder_context->brc.mb_rate_control = misc-
> > >rc_flags.bits.mb_rate_control;
> > + encoder_context->brc.need_reset = 1;
> > + }
> > +
> > + if (encoder_context->brc.target_percentage != misc-
> > >target_percentage) {
> > + encoder_context->brc.target_percentage = misc-
> > >target_percentage;
> > + encoder_context->brc.need_reset = 1;
> > + }
>
> Is the mb_rate_control/target_percentage defined per temporal_layer
> instead?
It makes sense that all layers use the same values for
mb_rate_control/target_percentage for all layers.
>
> Thanks
> Yakui
>
> > }
> >
> > static void
> > diff --git a/src/i965_encoder.h b/src/i965_encoder.h
> > index fe5a595..500a9ff 100644
> > --- a/src/i965_encoder.h
> > +++ b/src/i965_encoder.h
> > @@ -81,6 +81,8 @@ struct intel_encoder_context
> > unsigned short num_bframes_in_gop;
> > unsigned int bits_per_second[MAX_TEMPORAL_LAYERS];
> > unsigned int framerate_per_100s[MAX_TEMPORAL_LAYERS];
> > + unsigned int mb_rate_control;
> > + unsigned int target_percentage;
> > unsigned int hrd_buffer_size;
> > unsigned int hrd_initial_buffer_fullness;
> > unsigned int need_reset;
>
More information about the Libva
mailing list