[Mesa-dev] [PATCH 2/3] st/omx: add support for nouveau / interlaced

Leo Liu leo.liu at amd.com
Wed Jun 29 12:46:06 UTC 2016



On 06/28/2016 05:07 AM, Christian König wrote:
> Hi Leo,
>
> nice catch patch is Reviewed-by: Christian König 
> <christian.koenig at amd.com>.
>
>> But we still need to fix transcoding issue with interlaced as true. 
>> Our transcode support tunneling, basic the decode buffer will be used 
>> directly for encode.
>>
> Ah, yes of course. Sorry I was a bit fast with giving my rb on that, 
> should have thought about it more.
>
> The problem is that the VCE engine can only handle progressive frames 
> and not the interlaced memory layout.
>
> What we should do is implementing interlaced -> progressive conversion 
> in the omx state tracker tunneling handling when that happens. Then 
> set interlaced to false in the template and reallocate the video 
> buffer for the next trancoding round.
>
> The weave filter from the compositor could be used for interlaced -> 
> progressive conversion. And btw: We are going to have the same problem 
> with the VA-API state tracker.

Just concern this may cause performance compromised. How about we add a 
environment variable at the same time to false the interlaced, so that 
it's up to user to choose either way.

Regards,
Leo

>
> Regards,
> Christian.
>
> Am 28.06.2016 um 09:01 schrieb Julien Isorce:
>> Thx Leo.
>> I confirm it works with nouveau driver so your fix is:
>> Tested-by: Julien Isorce <j.isorce at samsung.com 
>> <mailto:j.isorce at samsung.com>>
>>
>> On 28 June 2016 at 02:27, Liu, Leo <Leo.Liu at amd.com 
>> <mailto:Leo.Liu at amd.com>> wrote:
>>
>>     Hi Julien and Christian,
>>
>>
>>     I got a patch attached to fix the "fillout" problem, and please
>>     review.
>>
>>
>>     But we still need to fix transcoding issue with interlaced as
>>     true. Our transcode support tunneling, basic the decode buffer
>>     will be used directly for encode.
>>
>>
>>     Thanks,
>>
>>     Leo
>>
>>
>>
>>     ------------------------------------------------------------------------
>>     *From:* Julien Isorce <julien.isorce at gmail.com
>>     <mailto:julien.isorce at gmail.com>>
>>     *Sent:* June 27, 2016 4:54:07 PM
>>     *To:* Liu, Leo
>>     *Cc:* ML mesa-dev; Gurkirpal Singh; Koenig, Christian
>>     *Subject:* Re: [Mesa-dev] [PATCH 2/3] st/omx: add support for
>>     nouveau / interlaced
>>     Hi Leo,
>>
>>     Sorry for the inconvenience, could you let me know how to
>>     reproduce the problem ?
>>     I have been playing with some gst pipelines and they all work but
>>     I can only test with nouveau driver.
>>
>>     Cheers
>>     Julien
>>
>>
>>     On 27 June 2016 at 21:35, Leo Liu <leo.liu at amd.com> wrote:
>>
>>         This patch break omx decode to file, it got seg fault. Will
>>         take look further.
>>
>>         Regards,
>>         Leo
>>
>>
>>
>>         On 06/27/2016 04:16 AM, Julien Isorce wrote:
>>
>>             Signed-off-by: Julien Isorce <j.isorce at samsung.com>
>>             ---
>>             src/gallium/state_trackers/omx/vid_dec.c | 51
>>             ++++++++++++++++----------------
>>               1 file changed, 26 insertions(+), 25 deletions(-)
>>
>>             diff --git a/src/gallium/state_trackers/omx/vid_dec.c
>>             b/src/gallium/state_trackers/omx/vid_dec.c
>>             index 564ca2f..85ffb88 100644
>>             --- a/src/gallium/state_trackers/omx/vid_dec.c
>>             +++ b/src/gallium/state_trackers/omx/vid_dec.c
>>             @@ -48,6 +48,7 @@
>>               #include "pipe/p_video_codec.h"
>>               #include "util/u_memory.h"
>>               #include "util/u_surface.h"
>>             +#include "vl/vl_video_buffer.h"
>>               #include "vl/vl_vlc.h"
>>                 #include "entrypoint.h"
>>             @@ -515,34 +516,34 @@ static void
>>             vid_dec_FillOutput(vid_dec_PrivateType *priv, struct
>>             pipe_video_buff
>>                  OMX_VIDEO_PORTDEFINITIONTYPE *def =
>>             &port->sPortParam.format.video;
>>                    struct pipe_sampler_view **views;
>>             -   struct pipe_transfer *transfer;
>>             -   struct pipe_box box = { };
>>             -   uint8_t *src, *dst;
>>             +   unsigned i, j;
>>             +   unsigned width, height;
>>                    views = buf->get_sampler_view_planes(buf);
>>               -   dst = output->pBuffer;
>>             -
>>             -   box.width = def->nFrameWidth;
>>             -   box.height = def->nFrameHeight;
>>             -   box.depth = 1;
>>             -
>>             -   src = priv->pipe->transfer_map(priv->pipe,
>>             views[0]->texture, 0,
>>             - PIPE_TRANSFER_READ, &box, &transfer);
>>             -   util_copy_rect(dst, views[0]->texture->format,
>>             def->nStride, 0, 0,
>>             -                  box.width, box.height, src,
>>             transfer->stride, 0, 0);
>>             -   pipe_transfer_unmap(priv->pipe, transfer);
>>             -
>>             -   dst = ((uint8_t*)output->pBuffer) + (def->nStride *
>>             box.height);
>>             -
>>             -   box.width = def->nFrameWidth / 2;
>>             -   box.height = def->nFrameHeight / 2;
>>             -
>>             -   src = priv->pipe->transfer_map(priv->pipe,
>>             views[1]->texture, 0,
>>             - PIPE_TRANSFER_READ, &box, &transfer);
>>             -   util_copy_rect(dst, views[1]->texture->format,
>>             def->nStride, 0, 0,
>>             -                  box.width, box.height, src,
>>             transfer->stride, 0, 0);
>>             -   pipe_transfer_unmap(priv->pipe, transfer);
>>             +   for (i = 0; i < 2 /* NV12 */; i++) {
>>             +      if (!views[i]) continue;
>>             +      width = buf->width;
>>             +      height = buf->height;
>>             + vl_video_buffer_adjust_size(&width, &height, i,
>>             buf->interlaced, buf->chroma_format);
>>             +      for (j = 0; j < views[i]->texture->array_size; ++j) {
>>             +         struct pipe_box box = {0, 0, j, width, height, 1};
>>             +         struct pipe_transfer *transfer;
>>             +         uint8_t *map, *dst;
>>             +         map = priv->pipe->transfer_map(priv->pipe,
>>             views[i]->texture, 0,
>>             +                  PIPE_TRANSFER_READ, &box, &transfer);
>>             +         if (!map)
>>             +            return;
>>             +
>>             +         dst = ((uint8_t*)output->pBuffer +
>>             output->nOffset) + j * def->nStride + i * buf->width *
>>             buf->height;
>>             +         util_copy_rect(dst,
>>             + views[i]->texture->format,
>>             +            def->nStride *
>>             views[i]->texture->array_size, 0, 0,
>>             +            box.width, box.height, map,
>>             transfer->stride, 0, 0);
>>             +
>>             +  pipe_transfer_unmap(priv->pipe, transfer);
>>             +      }
>>             +   }
>>               }
>>                 static void vid_dec_FrameDecoded(OMX_COMPONENTTYPE
>>             *comp, OMX_BUFFERHEADERTYPE* input,
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160629/5f36a1b8/attachment-0001.html>


More information about the mesa-dev mailing list