Message ID | 968a0227-86bc-eb2d-ce72-3b7858bb2375@googlemail.com |
---|---|
State | Accepted |
Commit | 3932ccc472ad4f4d370dcfc1c2f574b0f3acb88c |
Headers | show |
2016-11-02 21:34 GMT+01:00 Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>: > This was broken by the following Libav commit: > 4c387c7 ppc: dsputil: do unaligned block accesses correctly > > The following tests fail due to this: > fate-checkasm > fate-vsynth1-dnxhd-2k-hr-hq fate-vsynth1-dnxhd-edge1-hr > fate-vsynth1-dnxhd-edge2-hr fate-vsynth1-dnxhd-edge3-hr > fate-vsynth1-dnxhd-hr-sq-mov fate-vsynth1-dnxhd-hr-hq-mov > fate-vsynth2-dnxhd-2k-hr-hq fate-vsynth2-dnxhd-edge1-hr > fate-vsynth2-dnxhd-edge2-hr fate-vsynth2-dnxhd-edge3-hr > fate-vsynth2-dnxhd-hr-sq-mov fate-vsynth2-dnxhd-hr-hq-mov > fate-vsynth3-dnxhd-2k-hr-hq fate-vsynth3-dnxhd-edge1-hr > fate-vsynth3-dnxhd-edge2-hr fate-vsynth3-dnxhd-edge3-hr > fate-vsynth3-dnxhd-hr-sq-mov fate-vsynth3-dnxhd-hr-hq-mov > > Fixes trac ticket #5508. > > Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> > --- > > Tested with qemu on ppc32be and ppc64be. Fixes the affected fate tests on ppc32 and ppc64be, ppc64le still works. (rv20-1239 fails on ppc32 and ppc64le, works on ppc64be) Thank you! Carl Eugen
On 02.11.2016 23:41, Carl Eugen Hoyos wrote: > 2016-11-02 21:34 GMT+01:00 Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>: >> This was broken by the following Libav commit: >> 4c387c7 ppc: dsputil: do unaligned block accesses correctly >> >> The following tests fail due to this: >> fate-checkasm >> fate-vsynth1-dnxhd-2k-hr-hq fate-vsynth1-dnxhd-edge1-hr >> fate-vsynth1-dnxhd-edge2-hr fate-vsynth1-dnxhd-edge3-hr >> fate-vsynth1-dnxhd-hr-sq-mov fate-vsynth1-dnxhd-hr-hq-mov >> fate-vsynth2-dnxhd-2k-hr-hq fate-vsynth2-dnxhd-edge1-hr >> fate-vsynth2-dnxhd-edge2-hr fate-vsynth2-dnxhd-edge3-hr >> fate-vsynth2-dnxhd-hr-sq-mov fate-vsynth2-dnxhd-hr-hq-mov >> fate-vsynth3-dnxhd-2k-hr-hq fate-vsynth3-dnxhd-edge1-hr >> fate-vsynth3-dnxhd-edge2-hr fate-vsynth3-dnxhd-edge3-hr >> fate-vsynth3-dnxhd-hr-sq-mov fate-vsynth3-dnxhd-hr-hq-mov >> >> Fixes trac ticket #5508. >> >> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> >> --- >> >> Tested with qemu on ppc32be and ppc64be. > > Fixes the affected fate tests on ppc32 and ppc64be, ppc64le still works. Thanks for confirming, pushed. > (rv20-1239 fails on ppc32 and ppc64le, works on ppc64be) This test works for me with qemu emulating ppc32, haven't tested the others. Best regards, Andreas
diff --git a/libavcodec/ppc/pixblockdsp.c b/libavcodec/ppc/pixblockdsp.c index 84aa562..f3a5050 100644 --- a/libavcodec/ppc/pixblockdsp.c +++ b/libavcodec/ppc/pixblockdsp.c @@ -67,10 +67,10 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, ptrdiff_t line_size) { int i; - vec_u8 perm = vec_lvsl(0, pixels); const vec_u8 zero = (const vec_u8)vec_splat_u8(0); for (i = 0; i < 8; i++) { + vec_u8 perm = vec_lvsl(0, pixels); /* Read potentially unaligned pixels. * We're reading 16 pixels, and actually only want 8, * but we simply ignore the extras. */ @@ -157,8 +157,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, const uint8_t *s2, int stride) { int i; - vec_u8 perm1 = vec_lvsl(0, s1); - vec_u8 perm2 = vec_lvsl(0, s2); + vec_u8 perm; const vec_u8 zero = (const vec_u8)vec_splat_u8(0); vec_s16 shorts1, shorts2; @@ -166,17 +165,19 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, /* Read potentially unaligned pixels. * We're reading 16 pixels, and actually only want 8, * but we simply ignore the extras. */ + perm = vec_lvsl(0, s1); vec_u8 pixl = vec_ld(0, s1); vec_u8 pixr = vec_ld(15, s1); - vec_u8 bytes = vec_perm(pixl, pixr, perm1); + vec_u8 bytes = vec_perm(pixl, pixr, perm); // Convert the bytes into shorts. shorts1 = (vec_s16)vec_mergeh(zero, bytes); // Do the same for the second block of pixels. + perm = vec_lvsl(0, s2); pixl = vec_ld(0, s2); pixr = vec_ld(15, s2); - bytes = vec_perm(pixl, pixr, perm2); + bytes = vec_perm(pixl, pixr, perm); // Convert the bytes into shorts. shorts2 = (vec_s16)vec_mergeh(zero, bytes); @@ -197,17 +198,19 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, /* Read potentially unaligned pixels. * We're reading 16 pixels, and actually only want 8, * but we simply ignore the extras. */ + perm = vec_lvsl(0, s1); pixl = vec_ld(0, s1); pixr = vec_ld(15, s1); - bytes = vec_perm(pixl, pixr, perm1); + bytes = vec_perm(pixl, pixr, perm); // Convert the bytes into shorts. shorts1 = (vec_s16)vec_mergeh(zero, bytes); // Do the same for the second block of pixels. + perm = vec_lvsl(0, s2); pixl = vec_ld(0, s2); pixr = vec_ld(15, s2); - bytes = vec_perm(pixl, pixr, perm2); + bytes = vec_perm(pixl, pixr, perm); // Convert the bytes into shorts. shorts2 = (vec_s16)vec_mergeh(zero, bytes);
This was broken by the following Libav commit: 4c387c7 ppc: dsputil: do unaligned block accesses correctly The following tests fail due to this: fate-checkasm fate-vsynth1-dnxhd-2k-hr-hq fate-vsynth1-dnxhd-edge1-hr fate-vsynth1-dnxhd-edge2-hr fate-vsynth1-dnxhd-edge3-hr fate-vsynth1-dnxhd-hr-sq-mov fate-vsynth1-dnxhd-hr-hq-mov fate-vsynth2-dnxhd-2k-hr-hq fate-vsynth2-dnxhd-edge1-hr fate-vsynth2-dnxhd-edge2-hr fate-vsynth2-dnxhd-edge3-hr fate-vsynth2-dnxhd-hr-sq-mov fate-vsynth2-dnxhd-hr-hq-mov fate-vsynth3-dnxhd-2k-hr-hq fate-vsynth3-dnxhd-edge1-hr fate-vsynth3-dnxhd-edge2-hr fate-vsynth3-dnxhd-edge3-hr fate-vsynth3-dnxhd-hr-sq-mov fate-vsynth3-dnxhd-hr-hq-mov Fixes trac ticket #5508. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> --- Tested with qemu on ppc32be and ppc64be. --- libavcodec/ppc/pixblockdsp.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)