[FFmpeg-devel] [PATCH 5/6] swscale/swscale_unscaled: clear the low bits in planar8ToP01xleWrapper

James Almer jamrial at gmail.com
Mon Oct 21 02:56:07 EEST 2024


On 10/20/2024 8:52 PM, Michael Niedermayer wrote:
> On Fri, Oct 18, 2024 at 11:34:47PM -0300, James Almer wrote:
>> This makes the unscaled output of p010le and p016le match the generic path.
>>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   libswscale/swscale_unscaled.c           | 6 +++---
>>   tests/ref/fate/filter-pixdesc-p010le    | 2 +-
>>   tests/ref/fate/filter-pixdesc-p016le    | 2 +-
>>   tests/ref/fate/filter-pixfmts-copy      | 4 ++--
>>   tests/ref/fate/filter-pixfmts-crop      | 4 ++--
>>   tests/ref/fate/filter-pixfmts-field     | 4 ++--
>>   tests/ref/fate/filter-pixfmts-hflip     | 4 ++--
>>   tests/ref/fate/filter-pixfmts-il        | 4 ++--
>>   tests/ref/fate/filter-pixfmts-null      | 4 ++--
>>   tests/ref/fate/filter-pixfmts-pad       | 4 ++--
>>   tests/ref/fate/filter-pixfmts-scale     | 4 ++--
>>   tests/ref/fate/filter-pixfmts-transpose | 4 ++--
>>   tests/ref/fate/filter-pixfmts-vflip     | 4 ++--
>>   13 files changed, 25 insertions(+), 25 deletions(-)
>>
>> diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
>> index edb51a8250..a7fdb438a6 100644
>> --- a/libswscale/swscale_unscaled.c
>> +++ b/libswscale/swscale_unscaled.c
>> @@ -340,7 +340,7 @@ static int planar8ToP01xleWrapper(SwsContext *c, const uint8_t *const src[],
>>           const uint8_t *tsrc0 = src0;
>>           for (x = c->srcW; x > 0; x--) {
>>               t = *tsrc0++;
>> -            output_pixel(tdstY++, t | (t << 8));
>> +            output_pixel(tdstY++, t << 8);
>>           }
>>           src0 += srcStride[0];
>>           dstY += dstStride[0] / 2;
>> @@ -351,9 +351,9 @@ static int planar8ToP01xleWrapper(SwsContext *c, const uint8_t *const src[],
>>               const uint8_t *tsrc2 = src2;
>>               for (x = c->srcW / 2; x > 0; x--) {
>>                   t = *tsrc1++;
>> -                output_pixel(tdstUV++, t | (t << 8));
>> +                output_pixel(tdstUV++, t << 8);
>>                   t = *tsrc2++;
>> -                output_pixel(tdstUV++, t | (t << 8));
>> +                output_pixel(tdstUV++, t << 8);
> 
> does this turn white into gray ?
> i mean 0xFF -> 0xFF00 instead of 0xFFFF

Is 0xFF white in YUV? And do you know a way to test that?
Like i said in the commit message, the output of this function after 
this change matches what the code in output.c generates.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241020/1a704519/attachment.sig>


More information about the ffmpeg-devel mailing list