[mythtv] ffmpeg SWSCALE!

Yeasah Pell yeasah at schwide.com
Thu Aug 31 07:08:58 UTC 2006


Daniel Kristjansson wrote:
>
> Right, I understand the artifact you are talking about, it
> is simply not called aliasing.
>   
Hee hee, ok, ok, I'll stop calling it that!
>> A grid of colored squares is an ideal representation of a pre-filtered 
>> raw discrete output, it's the 2 dimensional analog of the stair-stepped
>>     
> Umm, I would not consider that ideal at all. I would consider point
> samples convolved with an infinite sinc function to be ideal. And
> I would consider the sampled Gaussian blur of a CRT to be more ideal
> than this the box filter.
>   
"Ideal" there means "mathematically pure model", not "best suited". Like 
an "ideal diode" -- it's ideal in the sense that it is a perfect 
representation of a particular model. The model in that case is an 
abstract array of pixels. I guess that was pretty ambiguous though.

>> The difference between those two pictures shows the high frequency 
>> components that should have been filtered out, i.e. the nyquist aliasing:
>>     
> Nope, only a small portion of the residual is due to the high frequency
> components, you would need to filter that with the sinc function in
> order for the image to contain just the high frequencies. And that
> still wouldn't be called aliasing.
>   
Oops, you're right -- I forgot to filter the comparison image to limit 
its bandwidth before taking the difference. I knew it looked wrong -- it 
should have been aligned mainly along the pixel grid. Here's the real 
difference image that shows only the artifacts that are being discussed, 
it's more subtle, all high frequency, and since it's all more detailed 
(higher frequency) than the image being displayed I figure there must be 
a distance to view where you can't see the artifacts but you can see the 
full detail of the image being displayed.

http://schwide.com/aliasing/difference2.jpg

> Oh, I wasn't saying you should play the video back any faster.
> What I was saying you could do is interpolate the motion vectors
> and the residuals to generate new frames in between the encoded
> frames. This would work 90% of the time, but you would need to
> detect scene changes. You would need to use more accuracy in the
> reconstruction which means more CPU, and it would require very
> extensive changes to ffmpeg.. But you can think of the video as
> just a 3-D space column of data from which you sample, and you
> do not have to sample at the same spots as in the source, so long
> as there is no discontinuity. This can not be done practically
> as a post filter, but the data needed for this is already in
> the MPEG stream. MPEG works by creating this function in 3-D
> and then coding residuals for the errors in the prediction based
> on the function representing the 3-D column. The problem would
> be how good your reconstructions would be because your residuals
> would be off, but you could maybe snap to the encoder frames if
> the residuals were large and the motion was small. Then you would
> get judder only at scene changes where it is less noticable anyway.
> In high motion losing a little pixel fidelity is probably not as
> important as keeping the motion spot on, think of Michael Jordan
> making a slam dunk. I didn't say it would be completely trivial
> to implement :)
>   
Wow, that's a really neat idea! I notice you dodged the question of 
whether you can diddle the frame rate of the graphics card though, I was 
hoping you'd have some idea about that -- I think I've seen programs 
that let you adjust the X video mode timings in realtime, haven't I? In 
theory you could modify the video frame rate that way, though the hard 
part would be finding a way to do it such that video output isn't 
disturbed -- at a minimum it would have to be vsync'd, worst case it's 
just not possible to do that without noticeably affecting the video in 
some way. Would probably depend on the particular card. Still, if it's 
possible, it'd be a lot easier than essentially creating 
alternate-universe renderings of MPEG data. :-)

/y



More information about the mythtv-dev mailing list