"Ronald S. Bultje" <[email protected]> writes: > Hi, > > On Mon, Jul 25, 2011 at 9:58 AM, Ronald S. Bultje <[email protected]> wrote: >> Hi, >> >> 2011/7/25 Måns Rullgård <[email protected]>: >>> "Ronald S. Bultje" <[email protected]> writes: >>>> On Mon, Jul 25, 2011 at 8:18 AM, Mans Rullgard <[email protected]> wrote: >>>>> Signed-off-by: Mans Rullgard <[email protected]> >>>>> --- >>>>> libswscale/ppc/swscale_altivec.c | 3 ++- >>>>> 1 files changed, 2 insertions(+), 1 deletions(-) >>>>> >>>>> diff --git a/libswscale/ppc/swscale_altivec.c >>>>> b/libswscale/ppc/swscale_altivec.c >>>>> index 369e93b..501a4f7 100644 >>>>> --- a/libswscale/ppc/swscale_altivec.c >>>>> +++ b/libswscale/ppc/swscale_altivec.c >>>>> @@ -409,7 +409,8 @@ void ff_sws_init_swScale_altivec(SwsContext *c) >>>>> if (c->scalingBpp == 8) { >>>>> c->hScale = hScale_altivec_real; >>>>> } >>>>> - if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && >>>>> + if (!is16BPS(c->srcFormat) && !is9_OR_10BPS(c->srcFormat) && >>>>> + !is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && >>>> >>>> Why? >>>> >>>> yuv2yuvX is output vertical scaling, if input is >8bit, 19to15Fw >>>> scales it back to a range that yuv2yuvX understands. (Jason thinks >>>> this is non-optimal, so I'll look into changing this, but currently, I >>>> don't think this patch is necessary.) >>> >>> The 10-bit dnxhd tests fail without it. How should that be fixed instead? >> >> I think it's because yuv2yuvX doesn't add dither. If you look at the C >> code, you'll see it adds dither to the signal, the altivec function >> should do that also. > > So more specifically: > > DECLARE_ALIGNED(16, int, val)[dstW]; > > for (i = 0; i < (dstW -7); i+=4) { > vec_st(vini, i << 2, val); > } > for (; i < dstW; i++) { > val[i] = (1 << 18); > } > > That code should not use 1 << 18, but something like c->lumDither8 and > c->chrDither8 further down for the chroma. It can use c->dither32 as a > temporary buffer if that helps. The C code should make most of this > obvious.
I give up. -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
