Hi,

On Tue, Jun 28, 2011 at 3:13 PM, Ronald S. Bultje <[email protected]> wrote:
> 2011/6/28 Måns Rullgård <[email protected]>:
>> "Ronald S. Bultje" <[email protected]> writes:
>>> 2011/6/28 Måns Rullgård <[email protected]>:
>>>> The pixfmts_scale test fails with Altivec for several reasons:
>>>>
>>>> - yuv2yuvX_altivec_real() crashes writing nv12/nv21 since it assumes
>>>> there are either zero or two chroma planes.  Adding a trivial check in
>>>> that function produces wrong output.
>>>
>>> See x86/swscale_template.c, the assignment should only be if pixfmt !=
>>> NV21/12. NV21/12 output writing is obviously different than "regular"
>>> planar YUV, and thus the function does something else also.
>>>
>>>> - yuva420p output is wrong, unknown why.
>>>
>>> yuv2yuvX_altivec() doesn't handle alpha (at all). Should probably be
>>> included in the if() as mentioned above also.
>>
>> Like this?
>>
>> diff --git a/libswscale/ppc/swscale_altivec.c 
>> b/libswscale/ppc/swscale_altivec.c
>> index 14f35b6..5e3c42d 100644
>> --- a/libswscale/ppc/swscale_altivec.c
>> +++ b/libswscale/ppc/swscale_altivec.c
>> @@ -407,7 +407,9 @@ void ff_sws_init_swScale_altivec(SwsContext *c)
>>         return;
>>
>>     c->hScale       = hScale_altivec_real;
>> -    if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat)) {
>> +    if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
>> +        dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 &&
>> +        dstFormat != PIX_FMT_YUVA420P) {
>>         c->yuv2yuvX     = yuv2yuvX_altivec_real;
>>     }
>>
>
> Yep.

Or that last one, I believe other pieces of sws use "c->alpPixBuf ==
NULL" as check to make sure there's no alpha.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to