Hi, New patch please find in the attachment. There are two patches to re-submit, this is the second. The fate test result is here: Rong Yan
------------------ ???????? ------------------ ??????: "Tony Lin";<linzhaolo...@gmail.com>; ????????: 2014??11??10??(??????) ????11:32 ??????: "rongyan"<rongyan...@foxmail.com>; ????: Fwd: [FFmpeg-devel] [patch 4/4] Fix bug for POWERLE: libswscale/ppc/swscale_altivec.c Forwarded conversation Subject: [FFmpeg-devel] [patch 4/4] Fix bug for POWERLE: libswscale/ppc/swscale_altivec.c ------------------------ From: rongyan <rongyan...@foxmail.com> Date: 2014-11-07 17:43 GMT+08:00 To: ffmpeg-devel <ffmpeg-devel@ffmpeg.org> Hi, There are 4 patches presented to fix bugs for POWER8 little endian. I will send 4 patches in 4 different email. This is the fourth. It fixed the function hScale_altivec_real(), yuv2planeX_16_altivec(), yuv2planeX_8(). The fate test result on POWER BE and POWER LE after merge these 4 patches are attached here to facilitate the review: The passed test cases change from 1679/2182 to 2010/2236. Rong Yan ------------------ The world has enough for everyone's need, but not enough for everyone's greed. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ---------- From: Michael Niedermayer <michae...@gmx.at> Date: 2014-11-08 1:54 GMT+08:00 To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> > swscale_altivec.c | 142 > +++++++++++++++++++----------------------------------- > 1 file changed, 50 insertions(+), 92 deletions(-) > 0c364d48e08b7df42bee5e269fe46b2d7be0f4b9 > 0004-libswscale-ppc-swscale_altivec.c-fix-hScale_altivec_.patch > From 9ec626726d1cc30db54390ee81f52cfe53ebeedf Mon Sep 17 00:00:00 2001 > From: Rong Yan <rongyan...@gmail.com> > Date: Fri, 7 Nov 2014 09:09:09 +0000 > Subject: [PATCH 4/4] libswscale/ppc/swscale_altivec.c : fix > hScale_altivec_real() yuv2planeX_16_altivec() yuv2planeX_8() for POWER LE > > --- > libswscale/ppc/swscale_altivec.c | 142 > ++++++++++++++------------------------- > 1 file changed, 50 insertions(+), 92 deletions(-) > > diff --git a/libswscale/ppc/swscale_altivec.c > b/libswscale/ppc/swscale_altivec.c > index 86f40ab..1673b8b 100644 > --- a/libswscale/ppc/swscale_altivec.c > +++ b/libswscale/ppc/swscale_altivec.c > @@ -29,20 +29,30 @@ > #include "libavutil/attributes.h" > #include "libavutil/cpu.h" > #include "yuv2rgb_altivec.h" > +#include "libavutil/ppc/util_altivec.h" > > #if HAVE_ALTIVEC > #define vzero vec_splat_s32(0) > > -#define yuv2planeX_8(d1, d2, l1, src, x, perm, filter) do { \ > - vector signed short l2 = vec_ld(((x) << 1) + 16, src); \ > - vector signed short ls = vec_perm(l1, l2, perm); \ > - vector signed int i1 = vec_mule(filter, ls); \ > - vector signed int i2 = vec_mulo(filter, ls); \ > - vector signed int vf1 = vec_mergeh(i1, i2); \ > - vector signed int vf2 = vec_mergel(i1, i2); \ > - d1 = vec_add(d1, vf1); \ > - d2 = vec_add(d2, vf2); \ > - l1 = l2; \ > +#if HAVE_BIGENDIAN > +#define GET_VF(a, b) {\ > + a = vec_mergeh(i1, i2);\ > + b = vec_mergel(i1, i2);\ > + } > +#else > +#define GET_VF(a, b) {\ > + a = vec_mergel(i2, i1);\ > + b = vec_mergeh(i2, i1);\ > + } > +#endif > + > +#define yuv2planeX_8(d1, d2, l1, src, x, filter) do {\ > + vector signed int i1 = vec_mule(filter, l1);\ > + vector signed int i2 = vec_mulo(filter, l1);\ > + vector signed int vf1, vf2;\ > + GET_VF(vf1, vf2);\ > + d1 = vec_add(d1, vf1);\ > + d2 = vec_add(d2, vf2);\ > } while (0) > > static void yuv2planeX_16_altivec(const int16_t *filter, int filterSize, > @@ -66,16 +76,13 @@ static void yuv2planeX_16_altivec(const int16_t *filter, > int filterSize, > vo4 = vec_ld(48, val); > > for (j = 0; j < filterSize; j++) { > - vector signed short l1, vLumFilter = vec_ld(j << 1, filter); > - vector unsigned char perm, perm0 = vec_lvsl(j << 1, filter); > - vLumFilter = vec_perm(vLumFilter, vLumFilter, perm0); > + vector signed short l1, l2; > + vector signed short vLumFilter = (vector signed > short)unaligned_load(j << 1, filter); > vLumFilter = vec_splat(vLumFilter, 0); // lumFilter[j] is loaded 8 > times in vLumFilter > - > - perm = vec_lvsl(x << 1, src[j]); > - l1 = vec_ld(x << 1, src[j]); > - > - yuv2planeX_8(vo1, vo2, l1, src[j], x, perm, vLumFilter); > - yuv2planeX_8(vo3, vo4, l1, src[j], x + 8, perm, vLumFilter); > + l1 = (vector signed short)unaligned_load(x << 1, src[j]); > + l2 = (vector signed short)unaligned_load(((x) << 1) + 16, src[j]); > + yuv2planeX_8(vo1, vo2, l1, src[j], x, vLumFilter); > + yuv2planeX_8(vo3, vo4, l2, src[j], x + 8, vLumFilter); > } i belive this uses more vec_ld() on big endian than before. i counted 4 before and 6 after the change this would likely slow big endian down [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
0002-libswscale-ppc-swscale_altivec.c-fix-hScale_altivec_.patch
Description: Binary data
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel