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

Pedro Arthur bygrandao at gmail.com
Wed Aug 15 16:37:09 EEST 2018


2018-08-14 19:49 GMT-03:00 Marton Balint <cus at passwd.hu>:
>
> 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.
The sr cnn tries to restore high frequency therefore it is aplied only
to luminance because applying it to chrominance does not improve much
quality and would be much slower.
The most efficient way to do it is convert only Y channel to float
apply the cnn to it and convert it back to int, and just upscale the
UV with swscale bicubic filter.
>
> Thanks,
> Marton
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list