[Mesa-dev] [PATCH] nir/lower_tex: Fix the channel ordering during conversion of AYUV images

Tapani Pälli tapani.palli at intel.com
Tue Jan 15 07:45:52 UTC 2019



On 1/15/19 4:34 AM, Lionel Landwerlin wrote:
> When writing this I used this page to figure the bytes' ordering : 
> https://docs.microsoft.com/en-us/windows/desktop/medfound/recommended-8-bit-yuv-formats-for-video-rendering#ayuv 
> 
> Of course endianess confuses everything :(
> 
> sunxi seems to support AYUV & VUYA : 
> https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/include/video/sunxi_display2.h#L40 
> 
> 
> Finally this patch (and its gstreamer comments) confuses me even more : 
> https://patchwork.freedesktop.org/patch/255529/
> 
> I really don't know what's right or wrong here...

IMO order 1230 seems wrong to me. Vivek, was the order chosen just 
because vivid driver outputs that or is it based on anything else, like 
some specification or other information?


> -
> Lionel
> 
> On 15/01/2019 00:49, Vivek Kasireddy wrote:
>> From: "Kasireddy, Vivek" <vivek.kasireddy at intel.com>
>>
>> The channel ordering should be 1230 instead of 2103.
>>
>> While displaying the packed YUV buffers generated by the Vivid (Virtual
>> Video) driver on Weston, it was observed that AYUV images were not
>> displayed correctly. Changing the ordering to 1230 makes AYUV buffers
>> display as expected.
>>
>> CC: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>> CC: Tapani Palli <tapani.palli at intel.com>
>> Signed-off-by: Vivek Kasireddy <vivek.kasireddy at intel.com>
>> ---
>>   src/compiler/nir/nir_lower_tex.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/compiler/nir/nir_lower_tex.c 
>> b/src/compiler/nir/nir_lower_tex.c
>> index a618b86b34c..7058c54f17c 100644
>> --- a/src/compiler/nir/nir_lower_tex.c
>> +++ b/src/compiler/nir/nir_lower_tex.c
>> @@ -434,10 +434,10 @@ lower_ayuv_external(nir_builder *b, 
>> nir_tex_instr *tex)
>>     nir_ssa_def *ayuv = sample_plane(b, tex, 0);
>>     convert_yuv_to_rgb(b, tex,
>> -                     nir_channel(b, ayuv, 2),
>>                        nir_channel(b, ayuv, 1),
>> -                     nir_channel(b, ayuv, 0),
>> -                     nir_channel(b, ayuv, 3));
>> +                     nir_channel(b, ayuv, 2),
>> +                     nir_channel(b, ayuv, 3),
>> +                     nir_channel(b, ayuv, 0));
>>   }
>>   /*
> 
> 


More information about the mesa-dev mailing list