<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
p.emailquote, li.emailquote, div.emailquote
        {mso-style-name:emailquote;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:1.0pt;
        margin-bottom:.0001pt;
        border:none;
        padding:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">>We can keep it like this for now, but I would prefer that we clean this up and change the radeon_vce so that it matches the begin/encode/end calls from VA-API.<br>
<br>
>We should probably work on this together with the performance improvements.<br>
<br>
>Regards,<br>
>Christian.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Christian,</span><br>
<br>
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Sure, I agree, we can do that together with the performance improvements.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I just submitted another patch set, which addressed all your commends, as well as fixed a cqp issue reported by Andy. Please review.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Boyuan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Christian König [mailto:deathsimple@vodafone.de]
<br>
<b>Sent:</b> July-20-16 4:49 AM<br>
<b>To:</b> Zhang, Boyuan; mesa-dev@lists.freedesktop.org<br>
<b>Cc:</b> adf.lists@gmail.com<br>
<b>Subject:</b> Re: [PATCH 09/12] st/va: add functions for VAAPI encode<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Am 20.07.2016 um 06:21 schrieb Zhang, Boyuan:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div id="x_divtagdefaultwrapper">
<p style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#212121">>> -   context->decoder->begin_frame(context->decoder, context->target, &context->desc.base);<br>
>> +   if (context->decoder->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)<br>
>> +      context->decoder->begin_frame(context->decoder, context->target, &context->desc.base);</span><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#212121"><br>
>Why do we do so here? Could we avoid that?<br>
<br>
>I would rather like to keep the begin_frame()/end_frame() handling as it is.<br>
<br>
>Christian.</span><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#212121">This is on purpose. Based on my testing, application will call begin_frame first, then call PictureParameter/SequenceParameter/... to pass us all picture
 related parameters. However, some of those values are actually required by begin_picture call in radeon_vce. So we have to delay the call until we receive all the parameters that needed. Same applies to encode_bitstream call. That's why I delay both calls
 to end_frame where we get all necessary values.</span><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</div>
</blockquote>
<p class="MsoNormal"><br>
We can keep it like this for now, but I would prefer that we clean this up and change the radeon_vce so that it matches the begin/encode/end calls from VA-API.<br>
<br>
We should probably work on this together with the performance improvements.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<br>
<o:p></o:p></p>
<div>
<div id="x_divtagdefaultwrapper">
<p style="background:white"><span style="font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#212121">Regards,</span><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#212121">Boyuan</span><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Christian König
<a href="mailto:deathsimple@vodafone.de"><deathsimple@vodafone.de></a><br>
<b>Sent:</b> July 19, 2016 4:55:43 AM<br>
<b>To:</b> Zhang, Boyuan; <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<b>Cc:</b> <a href="mailto:adf.lists@gmail.com">adf.lists@gmail.com</a><br>
<b>Subject:</b> Re: [PATCH 09/12] st/va: add functions for VAAPI encode</span> <o:p>
</o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt">Am 19.07.2016 um 00:43 schrieb Boyuan Zhang:<br>
> Add necessary functions/changes for VAAPI encoding to buffer and picture. These changes will allow driver to handle all Vaapi encode related operations. This patch doesn't change the Vaapi decode behaviour.<br>
><br>
> Signed-off-by: Boyuan Zhang <a href="mailto:boyuan.zhang@amd.com"><boyuan.zhang@amd.com></a><br>
> ---<br>
>   src/gallium/state_trackers/va/buffer.c     |   6 +<br>
>   src/gallium/state_trackers/va/picture.c    | 169 ++++++++++++++++++++++++++++-<br>
>   src/gallium/state_trackers/va/va_private.h |   3 +<br>
>   3 files changed, 176 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/gallium/state_trackers/va/buffer.c b/src/gallium/state_trackers/va/buffer.c<br>
> index 7d3167b..dfcebbe 100644<br>
> --- a/src/gallium/state_trackers/va/buffer.c<br>
> +++ b/src/gallium/state_trackers/va/buffer.c<br>
> @@ -133,6 +133,12 @@ vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff)<br>
>         if (!buf->derived_surface.transfer || !*pbuff)<br>
>            return VA_STATUS_ERROR_INVALID_BUFFER;<br>
>   <br>
> +      if (buf->type == VAEncCodedBufferType) {<br>
> +         ((VACodedBufferSegment*)buf->data)->buf = *pbuff;<br>
> +         ((VACodedBufferSegment*)buf->data)->size = buf->coded_size;<br>
> +         ((VACodedBufferSegment*)buf->data)->next = NULL;<br>
> +         *pbuff = buf->data;<br>
> +      }<br>
>      } else {<br>
>         pipe_mutex_unlock(drv->mutex);<br>
>         *pbuff = buf->data;<br>
> diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c<br>
> index 89ac024..4793194 100644<br>
> --- a/src/gallium/state_trackers/va/picture.c<br>
> +++ b/src/gallium/state_trackers/va/picture.c<br>
> @@ -78,7 +78,8 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende<br>
>         return VA_STATUS_SUCCESS;<br>
>      }<br>
>   <br>
> -   context->decoder->begin_frame(context->decoder, context->target, &context->desc.base);<br>
> +   if (context->decoder->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)<br>
> +      context->decoder->begin_frame(context->decoder, context->target, &context->desc.base);<br>
<br>
Why do we do so here? Could we avoid that?<br>
<br>
I would rather like to keep the begin_frame()/end_frame() handling as it is.<br>
<br>
Christian.<br>
<br>
>   <br>
>      return VA_STATUS_SUCCESS;<br>
>   }<br>
> @@ -278,6 +279,139 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)<br>
>         num_buffers, (const void * const*)buffers, sizes);<br>
>   }<br>
>   <br>
> +static VAStatus<br>
> +handleVAEncMiscParameterTypeRateControl(vlVaContext *context, VAEncMiscParameterBuffer *misc)<br>
> +{<br>
> +   VAEncMiscParameterRateControl *rc = (VAEncMiscParameterRateControl *)misc->data;<br>
> +   if (context->desc.h264enc.rate_ctrl.rate_ctrl_method ==<br>
> +       PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT)<br>
> +      context->desc.h264enc.rate_ctrl.target_bitrate = rc->bits_per_second;<br>
> +   else<br>
> +      context->desc.h264enc.rate_ctrl.target_bitrate = rc->bits_per_second * rc->target_percentage;<br>
> +   context->desc.h264enc.rate_ctrl.peak_bitrate = rc->bits_per_second;<br>
> +   if (context->desc.h264enc.rate_ctrl.target_bitrate < 2000000)<br>
> +      context->desc.h264enc.rate_ctrl.vbv_buffer_size = MIN2((context->desc.h264enc.rate_ctrl.target_bitrate * 2.75), 2000000);<br>
> +   else<br>
> +      context->desc.h264enc.rate_ctrl.vbv_buffer_size = context->desc.h264enc.rate_ctrl.target_bitrate;<br>
> +   context->desc.h264enc.rate_ctrl.target_bits_picture =<br>
> +        context->desc.h264enc.rate_ctrl.target_bitrate / context->desc.h264enc.rate_ctrl.frame_rate_num;<br>
> +   context->desc.h264enc.rate_ctrl.peak_bits_picture_integer =<br>
> +        context->desc.h264enc.rate_ctrl.peak_bitrate / context->desc.h264enc.rate_ctrl.frame_rate_num;<br>
> +   context->desc.h264enc.rate_ctrl.peak_bits_picture_fraction = 0;<br>
> +<br>
> +   return VA_STATUS_SUCCESS;<br>
> +}<br>
> +<br>
> +static VAStatus<br>
> +handleVAEncSequenceParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)<br>
> +{<br>
> +   VAEncSequenceParameterBufferH264 *h264 = (VAEncSequenceParameterBufferH264 *)buf->data;<br>
> +   if (!context->decoder) {<br>
> +      context->templat.max_references = h264->max_num_ref_frames;<br>
> +      context->templat.level = h264->level_idc;<br>
> +      context->decoder = drv->pipe->create_video_codec(drv->pipe, &context->templat);<br>
> +      if (!context->decoder)<br>
> +         return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> +   }<br>
> +   context->desc.h264enc.gop_size = h264->intra_idr_period;<br>
> +   context->desc.h264enc.rate_ctrl.frame_rate_num = h264->time_scale / 2;<br>
> +   context->desc.h264enc.rate_ctrl.frame_rate_den = 1;<br>
> +   return VA_STATUS_SUCCESS;<br>
> +}<br>
> +<br>
> +static VAStatus<br>
> +handleVAEncMiscParameterBufferType(vlVaContext *context, vlVaBuffer *buf)<br>
> +{<br>
> +   VAStatus vaStatus = VA_STATUS_SUCCESS;<br>
> +   VAEncMiscParameterBuffer *misc;<br>
> +   misc = buf->data;<br>
> +<br>
> +   switch (misc->type) {<br>
> +   case VAEncMiscParameterTypeRateControl:<br>
> +      vaStatus = handleVAEncMiscParameterTypeRateControl(context, misc);<br>
> +      break;<br>
> +<br>
> +   default:<br>
> +      break;<br>
> +   }<br>
> +<br>
> +   return vaStatus;<br>
> +}<br>
> +<br>
> +static VAStatus<br>
> +handleVAEncPictureParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)<br>
> +{<br>
> +   VAEncPictureParameterBufferH264 *h264;<br>
> +   vlVaBuffer *coded_buf;<br>
> +<br>
> +   h264 = buf->data;<br>
> +   context->desc.h264enc.frame_num = h264->frame_num;<br>
> +   context->desc.h264enc.not_referenced = false;<br>
> +   context->desc.h264enc.is_idr = (h264->pic_fields.bits.idr_pic_flag == 1);<br>
> +   context->desc.h264enc.pic_order_cnt = h264->CurrPic.TopFieldOrderCnt / 2;<br>
> +   if (context->desc.h264enc.is_idr)<br>
> +      context->desc.h264enc.i_remain = 1;<br>
> +   else<br>
> +      context->desc.h264enc.i_remain = 0;<br>
> +<br>
> +   context->desc.h264enc.p_remain = context->desc.h264enc.gop_size - context->desc.h264enc.gop_cnt - context->desc.h264enc.i_remain;<br>
> +<br>
> +   coded_buf = handle_table_get(drv->htab, h264->coded_buf);<br>
> +   if (!coded_buf->derived_surface.resource)<br>
> +      coded_buf->derived_surface.resource = pipe_buffer_create(drv->pipe->screen, PIPE_BIND_VERTEX_BUFFER,<br>
> +                                            PIPE_USAGE_STREAM, coded_buf->size);<br>
> +   context->coded_buf = coded_buf;<br>
> +<br>
> +   context->desc.h264enc.frame_idx[h264->CurrPic.picture_id] = h264->frame_num;<br>
> +   if (context->desc.h264enc.is_idr)<br>
> +      context->desc.h264enc.picture_type = PIPE_H264_ENC_PICTURE_TYPE_IDR;<br>
> +   else<br>
> +      context->desc.h264enc.picture_type = PIPE_H264_ENC_PICTURE_TYPE_P;<br>
> +<br>
> +   context->desc.h264enc.frame_num_cnt++;<br>
> +   context->desc.h264enc.gop_cnt++;<br>
> +   if (context->desc.h264enc.gop_cnt == context->desc.h264enc.gop_size)<br>
> +      context->desc.h264enc.gop_cnt = 0;<br>
> +<br>
> +   return VA_STATUS_SUCCESS;<br>
> +}<br>
> +<br>
> +static VAStatus<br>
> +handleVAEncSliceParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)<br>
> +{<br>
> +   VAEncSliceParameterBufferH264 *h264;<br>
> +<br>
> +   h264 = buf->data;<br>
> +   context->desc.h264enc.ref_idx_l0 = VA_INVALID_ID;<br>
> +   context->desc.h264enc.ref_idx_l1 = VA_INVALID_ID;<br>
> +<br>
> +   for (int i = 0; i < 32; i++) {<br>
> +      if (h264->RefPicList0[i].picture_id != VA_INVALID_ID) {<br>
> +         if (context->desc.h264enc.ref_idx_l0 == VA_INVALID_ID)<br>
> +            context->desc.h264enc.ref_idx_l0 = context->desc.h264enc.frame_idx[h264->RefPicList0[i].picture_id];<br>
> +      }<br>
> +      if (h264->RefPicList1[i].picture_id != VA_INVALID_ID && h264->slice_type == 1) {<br>
> +         if (context->desc.h264enc.ref_idx_l1 == VA_INVALID_ID)<br>
> +            context->desc.h264enc.ref_idx_l1 = context->desc.h264enc.frame_idx[h264->RefPicList1[i].picture_id];<br>
> +      }<br>
> +   }<br>
> +<br>
> +   if (h264->slice_type == 1)<br>
> +      context->desc.h264enc.picture_type = PIPE_H264_ENC_PICTURE_TYPE_B;<br>
> +   else if (h264->slice_type == 0)<br>
> +      context->desc.h264enc.picture_type = PIPE_H264_ENC_PICTURE_TYPE_P;<br>
> +   else if (h264->slice_type == 2) {<br>
> +      if (context->desc.h264enc.is_idr){<br>
> +         context->desc.h264enc.picture_type = PIPE_H264_ENC_PICTURE_TYPE_IDR;<br>
> +         context->desc.h264enc.idr_pic_id++;<br>
> +        } else<br>
> +         context->desc.h264enc.picture_type = PIPE_H264_ENC_PICTURE_TYPE_I;<br>
> +   } else<br>
> +      context->desc.h264enc.picture_type = PIPE_H264_ENC_PICTURE_TYPE_SKIP;<br>
> +<br>
> +   return VA_STATUS_SUCCESS;<br>
> +}<br>
> +<br>
>   VAStatus<br>
>   vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buffers, int num_buffers)<br>
>   {<br>
> @@ -328,6 +462,22 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff<br>
>            vaStatus = vlVaHandleVAProcPipelineParameterBufferType(drv, context, buf);<br>
>            break;<br>
>   <br>
> +      case VAEncSequenceParameterBufferType:<br>
> +         vaStatus = handleVAEncSequenceParameterBufferType(drv, context, buf);<br>
> +         break;<br>
> +<br>
> +      case VAEncMiscParameterBufferType:<br>
> +         vaStatus = handleVAEncMiscParameterBufferType(context, buf);<br>
> +         break;<br>
> +<br>
> +      case VAEncPictureParameterBufferType:<br>
> +         vaStatus = handleVAEncPictureParameterBufferType(drv, context, buf);<br>
> +         break;<br>
> +<br>
> +      case VAEncSliceParameterBufferType:<br>
> +         vaStatus = handleVAEncSliceParameterBufferType(drv, context, buf);<br>
> +         break;<br>
> +<br>
>         default:<br>
>            break;<br>
>         }<br>
> @@ -342,6 +492,9 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)<br>
>   {<br>
>      vlVaDriver *drv;<br>
>      vlVaContext *context;<br>
> +   vlVaBuffer *coded_buf;<br>
> +   unsigned int coded_size;<br>
> +   void *feedback;<br>
>   <br>
>      if (!ctx)<br>
>         return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
> @@ -365,7 +518,19 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)<br>
>      }<br>
>   <br>
>      context->mpeg4.frame_num++;<br>
> -   context->decoder->end_frame(context->decoder, context->target, &context->desc.base);<br>
> +<br>
> +   if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {<br>
> +      coded_buf = context->coded_buf;<br>
> +      context->decoder->begin_frame(context->decoder, context->target, &context->desc.base);<br>
> +      context->decoder->encode_bitstream(context->decoder, context->target,<br>
> +                                         coded_buf->derived_surface.resource, &feedback);<br>
> +      context->decoder->end_frame(context->decoder, context->target, &context->desc.base);<br>
> +      context->decoder->flush(context->decoder);<br>
> +      context->decoder->get_feedback(context->decoder, feedback, &coded_size);<br>
> +      coded_buf->coded_size = coded_size;<br>
> +   }<br>
> +   else<br>
> +      context->decoder->end_frame(context->decoder, context->target, &context->desc.base);<br>
>   <br>
>      return VA_STATUS_SUCCESS;<br>
>   }<br>
> diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h<br>
> index ad9010a..6d3ac38 100644<br>
> --- a/src/gallium/state_trackers/va/va_private.h<br>
> +++ b/src/gallium/state_trackers/va/va_private.h<br>
> @@ -229,6 +229,7 @@ typedef struct {<br>
>         struct pipe_vc1_picture_desc vc1;<br>
>         struct pipe_h264_picture_desc h264;<br>
>         struct pipe_h265_picture_desc h265;<br>
> +      struct pipe_h264_enc_picture_desc h264enc;<br>
>      } desc;<br>
>   <br>
>      struct {<br>
> @@ -241,6 +242,7 @@ typedef struct {<br>
>      } mpeg4;<br>
>   <br>
>      struct vl_deint_filter *deint;<br>
> +   struct vlVaBuffer *coded_buf;<br>
>   } vlVaContext;<br>
>   <br>
>   typedef struct {<br>
> @@ -260,6 +262,7 @@ typedef struct {<br>
>      } derived_surface;<br>
>      unsigned int export_refcount;<br>
>      VABufferInfo export_state;<br>
> +   unsigned int coded_size;<br>
>   } vlVaBuffer;<br>
>   <br>
>   typedef struct {<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>