Hey, I've just written a new video filter and I wanna make sure it's ok to add it to cvs before I commit. The file is attached. The basic idea behind this filter, halfpack, is as follows: Suppose you want to display a hires movie on a low resolution device, e.g. a tv screen. If your video device supports scaling overlays down properly, no problem, right? Well some cards don't support scaling down at all, and others (g200) use nearest neighbor when scaling down, resulting in horrible output quality. The normal solution would be to use the sw scaler to scale down. But suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine. Here's where -vop halfpack comes in. It converts planar yuv input to packed yuv (yuy2) output, halving the vertical luma resolution but keeping all the original chroma samples. Right now it still has a few problems -- averaging two lines of luma doesn't make for the best quality when scaling down, direct rendering doesn't seem to be taking effect, and I'm not positive it works with plane-swapped input -- but it can't break or affect anything else in mplayer, so I'd like to go ahead and get it in cvs if that's ok. Oh, it's also probably a bit slow -- I'll implement an asm version when I get a chance, and hopefully fix dr. Rich
Hi,
The normal solution would be to use the sw scaler to scale down. But suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine.
Here's where -vop halfpack comes in. It converts planar yuv input to packed yuv (yuy2) output, halving the vertical luma resolution but keeping all the original chroma samples.
hmm. what about just calling the 422p -> yuy2 converter, with doubled Y stride value and half height? that code is already mmx etc optimized and is part of postproc/* A'rpi / Astral & ESP-team -- Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
On Wed, Jul 26, 2000 at 11:18:05PM +0200, Arpi wrote:
Hi,
The normal solution would be to use the sw scaler to scale down. But suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine.
Here's where -vop halfpack comes in. It converts planar yuv input to packed yuv (yuy2) output, halving the vertical luma resolution but keeping all the original chroma samples.
hmm. what about just calling the 422p -> yuy2 converter, with doubled Y stride value and half height?
that code is already mmx etc optimized and is part of postproc/*
That would be nice, except it will just drop every other line of luma, which will look horrible. Rich
Hi,
suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine.
Here's where -vop halfpack comes in. It converts planar yuv input to packed yuv (yuy2) output, halving the vertical luma resolution but keeping all the original chroma samples.
hmm. what about just calling the 422p -> yuy2 converter, with doubled Y stride value and half height?
that code is already mmx etc optimized and is part of postproc/*
That would be nice, except it will just drop every other line of luma, which will look horrible.
hmm. input from TV tuners is usually interlaced, so droping every second luma just looks better than interpolating them... imho. A'rpi / Astral & ESP-team -- Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
On Thu, Jul 27, 2000 at 12:16:20PM +0200, Arpi wrote:
Hi,
suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine.
Here's where -vop halfpack comes in. It converts planar yuv input to packed yuv (yuy2) output, halving the vertical luma resolution but keeping all the original chroma samples.
hmm. what about just calling the 422p -> yuy2 converter, with doubled Y stride value and half height?
that code is already mmx etc optimized and is part of postproc/*
That would be nice, except it will just drop every other line of luma, which will look horrible.
hmm. input from TV tuners is usually interlaced, so droping every second luma just looks better than interpolating them... imho.
Huh? This isn't for input from tv tuners. It's for output TO a tv! Rich
Hi,
The normal solution would be to use the sw scaler to scale down. But suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine.
ah and i forgot to say that swscaler can do yv12 -> yuy2 scaling, so chroma won't lost... A'rpi / Astral & ESP-team -- Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
On Wed, Jul 26, 2000 at 11:19:54PM +0200, Arpi wrote:
Hi,
The normal solution would be to use the sw scaler to scale down. But suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine.
ah and i forgot to say that swscaler can do yv12 -> yuy2 scaling, so chroma won't lost...
How? It's not listed in the supported conversions, and the following just says the colorspace is unsupported, then segfaults, at least for me: mplayer -vop format=yuy2,scale ... Are you sure swscaler does yuy2 output? Rich
Hi On Wednesday 26 July 2023 19:54, Arpi wrote:
Hi,
The normal solution would be to use the sw scaler to scale down. But suppose you have to scale a 640x480 movie down to 640x240. Assuming your codec outputs a planar colorspace such as yv12, the vertical chroma resolution after scalind down will be 120. You've thrown away half your chroma samples for no reason, since 240 lines of chroma would still fit perfectly fine.
ah and i forgot to say that swscaler can do yv12 -> yuy2 scaling, so chroma won't lost... yuy2 output isnt supported yet (input is), its on my todo list ...
[...] Michael
participants (3)
-
Arpi -
D Richard Felker III -
Michael Niedermayer