[FFmpeg-devel] [PATCH v1 1/1] swscale/swscale_unscaled: fixed the issue that when width/height is not 2-multiple, transition of nv12 to u/v planes is not completed.

Lin, Decai decai.lin at intel.com
Thu Mar 28 13:39:02 EET 2019



> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Michael Niedermayer
> Sent: 2019年3月28日 8:06
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v1 1/1] swscale/swscale_unscaled: fixed
> the issue that when width/height is not 2-multiple, transition of nv12 to u/v
> planes is not completed.
> 
> On Wed, Mar 27, 2019 at 06:18:28PM +0800, Decai Lin wrote:
> > From: "Dong, Jerry" <jerry.dong at intel.com>
> >
> > Signed-off-by: Dong, Jerry <jerry.dong at intel.com>
> > Signed-off-by: Decai Lin <decai.lin at intel.com>
> > ---
> >  libswscale/swscale_unscaled.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/libswscale/swscale_unscaled.c
> > b/libswscale/swscale_unscaled.c index 058f2b9..2ba2907 100644
> > --- a/libswscale/swscale_unscaled.c
> > +++ b/libswscale/swscale_unscaled.c
> > @@ -150,10 +150,10 @@ static int planarToNv12Wrapper(SwsContext *c,
> const uint8_t *src[],
> >                dstParam[0], dstStride[0]);
> >
> >      if (c->dstFormat == AV_PIX_FMT_NV12)
> > -        interleaveBytes(src[1], src[2], dst, c->srcW / 2, srcSliceH / 2,
> > +        interleaveBytes(src[1], src[2], dst, (c->srcW + 1) / 2,
> > + (srcSliceH + 1) / 2,
> >                          srcStride[1], srcStride[2], dstStride[1]);
> >      else
> > -        interleaveBytes(src[2], src[1], dst, c->srcW / 2, srcSliceH / 2,
> > +        interleaveBytes(src[2], src[1], dst, (c->srcW + 1) / 2,
> > + (srcSliceH + 1) / 2,
> >                          srcStride[2], srcStride[1], dstStride[1]);
> >
> >      return srcSliceH;
> 
> this can probably use chrSrcW

Yes it is. Will update it. 
Thanks 

> [...]
> --
> Michael     GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Freedom in capitalist society always remains about the same as it was in
> ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


More information about the ffmpeg-devel mailing list