[FFmpeg-devel] [PATCH v2] swscale: add unscaled conversion from yuv420p to p010

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Sep 4 14:18:24 EEST 2016


2016-09-04 13:10 GMT+02:00 Paul B Mahol <onemda at gmail.com>:
> On 9/4/16, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>> 2016-09-03 15:25 GMT+02:00 Timo Rothenpieler <timo at rothenpieler.org>:
>>
>>> +            output_pixel(tdstY++, (t | (t << 8)) & 0xFFC0);
>>
>> Please remove the "& 0xFFC0" here and below.
>
> Please explain your reasoning here.

The linked specification clearly explains that the content
of P016 and P010 is identical and that it is not necessary
to set the lsb's to 0.
I believe we agree that the patch is slightly ugly because
of the defines but developers seem to agree that it has
to be accepted for performance reasons (nobody
objected). Even if "& 0xFFC0" is very cheap, I don't think
it comes for free. (Or does it?)

Finally, with the change, the function can also be used
for P016, note that I tried to object to P010: It does not
serve any real purpose, if I remember correctly, the
explanation for the commit was that there is a bug in
FFmpeg's pix_fmt decision routine that needed to
be worked-around ("hacked").

Carl Eugen


More information about the ffmpeg-devel mailing list