[mythtv-users] nonlinear 16:9 stretch?
Michael T. Dean
mtdean at thirdcontact.com
Mon Nov 21 17:54:52 EST 2005
Robert Denier wrote:
>I spent a few minutes and tried to figure out a quick way to do this non
>linear stretch. I could maybe come up with something nicer later as for as a
>function to do the stretch, but the problem is this needs to be real time,
>and if it gets too fancy it takes significant resources.
>
>Assume input video is X horizontal pixels. The exact number doesn't matter,
>but for simplicity 480 will be assumed here. Assume further that you can
>divide it into 10 equally, or nearly equally wide vertical stripes.
>
>1) For the stripe on the far left you could repeat each pixel 3 times.
>2) For the next two stripe repeat each 2 times.
>3) Then stripes four through seven are just a normal one:one mapping.
>4) The next two stripes would be the same as (2).
>5) The final stripe would be the same as (1)
>
>In other words the pattern for repeating pixels would be...
>[3,2,2,1,1,1,1,2,2,3]
>
>Depending on the true original horizontal pixel size one might have to adjust
>the video scaling parameters to make sure the center section has the right
>overall ratio.
>
>The advantages to such an approach are
>
>1) Very fast
>2) Somestimes just repeating pixels makes things less blurry, but thats usualy
>not an issue.
>
>The disadvantages
>1) It is a non smooth way to stretch an image. Something bicubic or similar
>would be cleaner, at the expense of cpu time.
>2) This may look poor in practice, although I suppose one would have to try
>it. It is just the simplest approach I could think of quickly to do this.
>
>
And, since you're the one interested in this stretch mode, I vote that
you do the tests. ;) You could easily make some test images with an
image editor. Post the shots showing the original (4:3), the linear
strech (16:9), and your new non-linear stretch (16:9).
Mike
More information about the mythtv-users
mailing list