Hi Andy, I am attaching the patches. Does it cause any difference in the corruption in this video?
https://drive.google.com/drive/folders/0BxP5-S1t9VEEbkR4dWhTUFozV2s Regards, Nayan On Fri, Feb 10, 2017 at 11:15 PM, Andy Furniss <adf.li...@gmail.com> wrote: > Nayan Deshmukh wrote: > >>>> Any ideas why? I am attaching the diff for reference. >>> >>> >>> >>> Could be that the shader based decoder has a bug with multiple slices as >>> well. >>> >> It could be. Andy can you test it with your hardware decoder to see if >> its specific >> to shader decoder. > > > Can you re-send or attach anything you want me to try to the bug. > > The diff in here is too corrupt to apply. > > It's a long time since I used shader decode (on rv790 before it got uvd). > > IIRC there were samples that were a bit wrong - but then that was > testing with vdpau. > >
From 4e99ae5a79c60ceae8d1942fc6a9b66704221452 Mon Sep 17 00:00:00 2001 From: Nayan Deshmukh <nayan26deshm...@gmail.com> Date: Tue, 31 Jan 2017 10:45:20 +0530 Subject: [PATCH 1/2] st/va: remove assert for single slice we anyway allow for multiple slices v2: do not remove assert to check for buf->size Signed-off-by: Nayan Deshmukh <nayan26deshm...@gmail.com> --- src/gallium/state_trackers/va/picture_mpeg12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/va/picture_mpeg12.c b/src/gallium/state_trackers/va/picture_mpeg12.c index 812e9e5..1e5a9c7 100644 --- a/src/gallium/state_trackers/va/picture_mpeg12.c +++ b/src/gallium/state_trackers/va/picture_mpeg12.c @@ -81,6 +81,6 @@ void vlVaHandleIQMatrixBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) void vlVaHandleSliceParameterBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) { - assert(buf->size >= sizeof(VASliceParameterBufferMPEG2) && buf->num_elements == 1); + assert(buf->size >= sizeof(VASliceParameterBufferMPEG2)); context->desc.mpeg12.num_slices += buf->num_elements; } -- 2.9.3
From 516c54ed7ab608f69fb50b554a28cc59015ddba7 Mon Sep 17 00:00:00 2001 From: Nayan Deshmukh <nayan26deshm...@gmail.com> Date: Mon, 6 Feb 2017 00:37:03 +0530 Subject: [PATCH 2/2] st/va: use the slice size provided in VASliceParameterBuffer Signed-off-by: Nayan Deshmukh <nayan26deshm...@gmail.com> --- src/gallium/state_trackers/va/picture.c | 19 +++++++++++++------ src/gallium/state_trackers/va/picture_mpeg12.c | 11 +++++++++++ src/gallium/state_trackers/va/va_private.h | 1 + 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c index 82584ea..8e68e35 100644 --- a/src/gallium/state_trackers/va/picture.c +++ b/src/gallium/state_trackers/va/picture.c @@ -262,8 +262,10 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf) { enum pipe_video_format format; unsigned num_buffers = 0; - void * const *buffers[2]; - unsigned sizes[2]; + void * const *buffers[context->desc.mpeg12.num_slices + 1]; + unsigned sizes[context->desc.mpeg12.num_slices + 1]; + char *cur; + int i; static const uint8_t start_code_h264[] = { 0x00, 0x00, 0x01 }; static const uint8_t start_code_h265[] = { 0x00, 0x00, 0x01 }; static const uint8_t start_code_vc1[] = { 0x00, 0x00, 0x01, 0x0d }; @@ -306,9 +308,12 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf) break; } - buffers[num_buffers] = buf->data; - sizes[num_buffers] = buf->size; - ++num_buffers; + cur = buf->data; + for (i = 0; i < context->desc.mpeg12.num_slices; ++i) { + buffers[i] = cur; + cur = cur + context->sizes[i]; + } + if (context->needs_begin_frame) { context->decoder->begin_frame(context->decoder, context->target, @@ -316,7 +321,8 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf) context->needs_begin_frame = false; } context->decoder->decode_bitstream(context->decoder, context->target, &context->desc.base, - num_buffers, (const void * const*)buffers, sizes); + context->desc.mpeg12.num_slices, (const void * const*)buffers, context->sizes); + } static VAStatus @@ -586,6 +592,7 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) } context->decoder->end_frame(context->decoder, context->target, &context->desc.base); + FREE(context->sizes); if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) { int idr_period = context->desc.h264enc.gop_size / context->gop_coeff; int p_remain_in_idr = idr_period - context->desc.h264enc.frame_num; diff --git a/src/gallium/state_trackers/va/picture_mpeg12.c b/src/gallium/state_trackers/va/picture_mpeg12.c index 1e5a9c7..b9d8667 100644 --- a/src/gallium/state_trackers/va/picture_mpeg12.c +++ b/src/gallium/state_trackers/va/picture_mpeg12.c @@ -82,5 +82,16 @@ void vlVaHandleIQMatrixBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) void vlVaHandleSliceParameterBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) { assert(buf->size >= sizeof(VASliceParameterBufferMPEG2)); + VASliceParameterBufferMPEG2 *mpeg2 = buf->data; + unsigned *sizes = MALLOC(buf->num_elements * sizeof(unsigned)); + int i; + context->desc.mpeg12.num_slices += buf->num_elements; + + for(i = 0; i < buf->num_elements; ++i) { + sizes[i] = mpeg2->slice_data_size; + mpeg2 = mpeg2 + 1; + } + + context->sizes = sizes; } diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h index a744461..47cb65e 100644 --- a/src/gallium/state_trackers/va/va_private.h +++ b/src/gallium/state_trackers/va/va_private.h @@ -263,6 +263,7 @@ typedef struct { bool first_single_submitted; int gop_coeff; bool needs_begin_frame; + unsigned *sizes; } vlVaContext; typedef struct { -- 2.9.3
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev