[Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0

Carl Lindqvist lulebo at gmail.com
Fri May 25 00:52:37 CEST 2012


2012/5/24 Alex Cohn <alexcohn at netvision.net.il>

> On Thu, May 24, 2012 at 11:19 AM, Carl Lindqvist <lulebo at gmail.com> wrote:
> >
> > Yes, my input is raw SDI video. Interlaced SD 4:2:2 8bit (or 10bit, but I
> > use 8bit). I want the output to be interlaced, full field rade. Right
> now,
> > swscale produces chroma samples that are scaled from both fields, which
> give
> > the effect in the image in the stack overflow thread when looking at the
> > final video.
> >
> > I have been reading what I can find about swscale, but can't really find
> any
> > info on this. This is the code I use (just standard stuff):
> >
> > img_convert_ctx = sws_getContext(destWidth, destHeight,
> >                                                  PIX_FMT_UYVY422,
> >                                                  c->width, c->height,
> >                                                  c->pix_fmt,
> >                                                  sws_flags, NULL, NULL,
> > NULL);
> >
> > sws_scale(img_convert_ctx, tmp_picture->data, tmp_picture->linesize,
> >                       0, destHeight, picture->data, picture->linesize);
>
> What are the input and output sizes in your case?
>
> > Is there a flag that sets this? There are some flags like
> > SWS_FULL_CHR_H_INP, but I can't find any info on what they do.
> >
> > Regards
> > Carl Lindqvist
>
> BR
> Alex
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>

In this case the video is just standard SD video, 720x576 8bit uyvy. But I
also have some 1080i video i would like to process in the same way. If I
understand how to do one, I can probably figure out how to do the other
one. I can probably do my own calculations and even optimize a bit with
SSE, since I think I get how the chroma samples should behave, but it would
be nice to have swscale do it for me if it is supported. Is it really
necessary to have 2 instances, one for each field. It seems as if this
would be a pretty common thing to want to do.

I have not yet looked at MPlayer/libmpcodecs/vf_scale.c, will do it
tomorrow and see what I can find.

How does the ffmpeg app do it? What file should I look at for source
examples?

Regards
Carl Lindqvist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120525/37f7e3b9/attachment.html>


More information about the Libav-user mailing list