From 28c1115a915e4e198bfb6bd39909b2d1327c1454 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 2 Aug 2011 15:42:35 -0700 Subject: swscale: use 15-bit intermediates for 9/10-bit scaling. --- libswscale/ppc/swscale_altivec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libswscale/ppc') diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c index 369e93b85a..f988b534ac 100644 --- a/libswscale/ppc/swscale_altivec.c +++ b/libswscale/ppc/swscale_altivec.c @@ -406,7 +406,7 @@ void ff_sws_init_swScale_altivec(SwsContext *c) if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return; - if (c->scalingBpp == 8) { + if (c->srcBpc == 8 && c->dstBpc <= 10) { c->hScale = hScale_altivec_real; } if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && -- cgit v1.2.3 From 3304a1e69a8a050eb66d2304acd2d01354fa1aac Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Wed, 10 Aug 2011 02:16:26 +0200 Subject: swscale: add dithering to yuv2yuvX_altivec_real It just does that part in scalar form, I doubt using a vector store over 2 array would speed it up particularly. The function should be written to not use a scratch buffer. --- libswscale/ppc/swscale_altivec.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'libswscale/ppc') diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c index f988b534ac..7fdca39acb 100644 --- a/libswscale/ppc/swscale_altivec.c +++ b/libswscale/ppc/swscale_altivec.c @@ -92,6 +92,7 @@ altivec_packIntArrayToCharArray(int *val, uint8_t* dest, int dstW) } } +//FIXME remove the usage of scratch buffers. static void yuv2yuvX_altivec_real(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, @@ -101,17 +102,13 @@ yuv2yuvX_altivec_real(SwsContext *c, uint8_t *dest[4], int dstW, int chrDstW) { uint8_t *yDest = dest[0], *uDest = dest[1], *vDest = dest[2]; - const vector signed int vini = {(1 << 18), (1 << 18), (1 << 18), (1 << 18)}; + const uint8_t *lumDither = c->lumDither8, *chrDither = c->chrDither8; register int i, j; { 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); - } + for (i=0; i