<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 23 December 2015 at 09:42, Christian König <span dir="ltr"><<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 23.12.2015 10:28, Julien Isorce wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The counter was not set but used by the driver.<br>
It is required otherwise visual output is garbage.<br>
<br>
Signed-off-by: Julien Isorce <<a href="mailto:j.isorce@samsung.com" target="_blank">j.isorce@samsung.com</a>><br>
</blockquote>
<br></span>
One minor nit pick below, apart from that the patch look good to me.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
src/gallium/state_trackers/va/picture.c | 22 ++++++++++++++++++++++<br>
src/gallium/state_trackers/va/picture_h264.c | 2 ++<br>
src/gallium/state_trackers/va/picture_mpeg12.c | 7 +++++++<br>
src/gallium/state_trackers/va/picture_vc1.c | 8 ++++++++<br>
src/gallium/state_trackers/va/va_private.h | 2 ++<br>
5 files changed, 41 insertions(+)<br>
<br>
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c<br>
index 7b30bf8..5029eb8 100644<br>
--- a/src/gallium/state_trackers/va/picture.c<br>
+++ b/src/gallium/state_trackers/va/picture.c<br>
@@ -60,6 +60,20 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende<br>
context->target = surf->buffer;<br>
+ switch (u_reduce_video_profile(context->templat.profile)) {<br>
+ case PIPE_VIDEO_FORMAT_MPEG12:<br>
+ context->desc.mpeg12.num_slices = 0;<br>
+ break;<br>
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC:<br>
+ context->desc.h264.slice_count = 0;<br>
+ break;<br>
+ case PIPE_VIDEO_FORMAT_VC1:<br>
+ context->desc.vc1.slice_count = 0;<br>
+ break;<br>
+ default:<br>
+ break;<br>
+ }<br>
+<br>
</blockquote>
<br></div></div>
We don't have anything in the picture description that needs to be preserved from frame to frame, don't we?<br>
<br>
So I would say just make nails with heads and clear the whole structure at the beginning of each from with zeros.<br>
<br>
Regards,<br>
Christian.</blockquote><div><br></div><div>Hi Christian,<br></div><div><br></div><div>Matrix can be common between frames:<br><br>struct pipe_mpeg12_picture_desc<br>{<br> ...<br> const uint8_t *intra_matrix;<br> const uint8_t *non_intra_matrix;<br><br> struct pipe_video_buffer *ref[2];<br>};<br><br></div><div>And it is hard to say what will be common or not in general. But you are right we should clear as much as possible.<br></div><div><br></div><div>For now I'll just move "context->desc.mpeg12.num_slices = 0;" to vlVaHandlePictureParameterBufferMPEG12. Same for h264 and vc1.<br></div><div><br></div><div>Thx<br></div><div>Julien<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
if (!context->decoder) {<br>
/* VPP */<br>
if (context->templat.profile == PIPE_VIDEO_PROFILE_UNKNOWN &&<br>
@@ -174,6 +188,14 @@ static void<br>
handleSliceParameterBuffer(vlVaContext *context, vlVaBuffer *buf)<br>
{<br>
switch (u_reduce_video_profile(context->templat.profile)) {<br>
+ case PIPE_VIDEO_FORMAT_MPEG12:<br>
+ vlVaHandleSliceParameterBufferMPEG12(context, buf);<br>
+ break;<br>
+<br>
+ case PIPE_VIDEO_FORMAT_VC1:<br>
+ vlVaHandleSliceParameterBufferVC1(context, buf);<br>
+ break;<br>
+<br>
case PIPE_VIDEO_FORMAT_MPEG4_AVC:<br>
vlVaHandleSliceParameterBufferH264(context, buf);<br>
break;<br>
diff --git a/src/gallium/state_trackers/va/picture_h264.c b/src/gallium/state_trackers/va/picture_h264.c<br>
index acbfe5d..d98a20a 100644<br>
--- a/src/gallium/state_trackers/va/picture_h264.c<br>
+++ b/src/gallium/state_trackers/va/picture_h264.c<br>
@@ -162,6 +162,8 @@ void vlVaHandleSliceParameterBufferH264(vlVaContext *context, vlVaBuffer *buf)<br>
VASliceParameterBufferH264 *h264 = buf->data;<br>
assert(buf->size >= sizeof(VASliceParameterBufferH264) && buf->num_elements == 1);<br>
+<br>
+ context->desc.h264.slice_count += buf->num_elements;<br>
context->desc.h264.num_ref_idx_l0_active_minus1 =<br>
h264->num_ref_idx_l0_active_minus1;<br>
context->desc.h264.num_ref_idx_l1_active_minus1 =<br>
diff --git a/src/gallium/state_trackers/va/picture_mpeg12.c b/src/gallium/state_trackers/va/picture_mpeg12.c<br>
index e587b1e..f0a2ae0 100644<br>
--- a/src/gallium/state_trackers/va/picture_mpeg12.c<br>
+++ b/src/gallium/state_trackers/va/picture_mpeg12.c<br>
@@ -78,3 +78,10 @@ void vlVaHandleIQMatrixBufferMPEG12(vlVaContext *context, vlVaBuffer *buf)<br>
context->desc.mpeg12.non_intra_matrix = NULL;<br>
}<br>
+void vlVaHandleSliceParameterBufferMPEG12(vlVaContext *context, vlVaBuffer *buf)<br>
+{<br>
+ assert(buf->size >= sizeof(VASliceParameterBufferMPEG2) && buf->num_elements == 1);<br>
+<br>
+ context->desc.mpeg12.num_slices += buf->num_elements;<br>
+}<br>
+<br>
diff --git a/src/gallium/state_trackers/va/picture_vc1.c b/src/gallium/state_trackers/va/picture_vc1.c<br>
index f95fd83..496bae3 100644<br>
--- a/src/gallium/state_trackers/va/picture_vc1.c<br>
+++ b/src/gallium/state_trackers/va/picture_vc1.c<br>
@@ -65,3 +65,11 @@ void vlVaHandlePictureParameterBufferVC1(vlVaDriver *drv, vlVaContext *context,<br>
context->desc.vc1.deblockEnable = vc1->post_processing != 0;<br>
context->desc.vc1.pquant = vc1->pic_quantizer_fields.bits.pic_quantizer_scale;<br>
}<br>
+<br>
+void vlVaHandleSliceParameterBufferVC1(vlVaContext *context, vlVaBuffer *buf)<br>
+{<br>
+ assert(buf->size >= sizeof(VASliceParameterBufferVC1) && buf->num_elements == 1);<br>
+<br>
+ context->desc.vc1.slice_count += buf->num_elements;<br>
+}<br>
+<br>
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h<br>
index fa6e0fb..bf9d24b 100644<br>
--- a/src/gallium/state_trackers/va/va_private.h<br>
+++ b/src/gallium/state_trackers/va/va_private.h<br>
@@ -351,10 +351,12 @@ VAStatus vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContex<br>
void vlVaGetReferenceFrame(vlVaDriver *drv, VASurfaceID surface_id, struct pipe_video_buffer **ref_frame);<br>
void vlVaHandlePictureParameterBufferMPEG12(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandleIQMatrixBufferMPEG12(vlVaContext *context, vlVaBuffer *buf);<br>
+void vlVaHandleSliceParameterBufferMPEG12(vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandlePictureParameterBufferH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandleIQMatrixBufferH264(vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandleSliceParameterBufferH264(vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandlePictureParameterBufferVC1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);<br>
+void vlVaHandleSliceParameterBufferVC1(vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandlePictureParameterBufferMPEG4(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandleIQMatrixBufferMPEG4(vlVaContext *context, vlVaBuffer *buf);<br>
void vlVaHandleSliceParameterBufferMPEG4(vlVaContext *context, vlVaBuffer *buf);<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div></div>