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

Paul B Mahol onemda at gmail.com
Wed Aug 15 19:01:24 EEST 2018


On 8/15/18, Sergey Lavrushkin <dualfal at gmail.com> wrote:
> 2018-08-15 1: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.
>>
>
> If it is possible, I can then change sr filter to work only for Y channel.
> Can you give me some examples of how to split the planes, filter them
> separately
> and merge them back?

see extractplanes and mergeplanes filters documentation.


More information about the ffmpeg-devel mailing list