[FFmpeg-devel] [PATCH 6/7] libavfilter/vf_sr.c: Removes uint8 -> float and float -> uint8 conversions.

Marton Balint cus at passwd.hu
Wed Aug 15 01:49:56 EEST 2018

On Tue, 14 Aug 2018, Pedro Arthur wrote:

> 2018-08-14 15:45 GMT-03:00 Rostislav Pehlivanov <atomnuker at gmail.com>:
>> On Thu, 2 Aug 2018 at 20:00, Sergey Lavrushkin <dualfal at gmail.com> wrote:
>>> This patch removes conversions, declared inside the sr filter, and uses
>>> libswscale inside
>>> the filter to perform them for only Y channel of input. The sr filter
>>> still has uint
>>> formats as input, as it does not use chroma channels in models and these
>>> channels are
>>> upscaled using libswscale, float formats for input would cause unnecessary
>>> conversions
>>> during scaling for these channels.


>> You are planning to remove *all* conversion still, right? Its still
>> unacceptable that there *are* conversions.
> They are here because it is the most efficient way to do it. The
> filter works only on luminance channel therefore we only apply
> conversion to Y channel, and bicubic upscale to chrominance.
> I can't see how one can achieve the same result, without doing useless
> computations, if not in this way.

Is there a reason why only the luminance channel is scaled this way? Can't 
you also train scaling chroma planes the same way? This way you could 
really eliminate the internal calls to swscale. If the user prefers to 
scale only one channel, he can always split the planes and scale them 
separately (using different filters) and then merge them.


More information about the ffmpeg-devel mailing list