[FFmpeg-devel] [PATCH] tests/checkasm/pixblockdsp: Test only aligned by 8 diff/get pixels

Michael Niedermayer michael at niedermayer.cc
Mon Jun 27 22:48:01 CEST 2016


On Sun, Jun 26, 2016 at 01:59:05PM +0200, Hendrik Leppkes wrote:
> On Sun, Jun 26, 2016 at 11:16 AM, Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> > They are documented as requiring 8 byte aligned source
> >
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  tests/checkasm/pixblockdsp.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/checkasm/pixblockdsp.c b/tests/checkasm/pixblockdsp.c
> > index 66bfdb7..28ee500 100644
> > --- a/tests/checkasm/pixblockdsp.c
> > +++ b/tests/checkasm/pixblockdsp.c
> > @@ -49,7 +49,7 @@
> >          int i;                                                                             \
> >          declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);    \
> >                                                                                             \
> > -        for (i = 0; i < BUF_UNITS; i++) {                                              \
> > +        for (i = 0; i < BUF_UNITS; i+=8) {                                              \
> >              int src_offset = i * 64 * sizeof(type) + i; /* Test various alignments */      \
> >              int dst_offset = i * 64; /* dst must be aligned */                             \
> >              randomize_buffers();                                                           \
> > @@ -66,7 +66,7 @@
> >          int i;                                                                             \
> >          declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *av_restrict block, const uint8_t *s1, const uint8_t *s2, int stride); \
> >                                                                                             \
> > -        for (i = 0; i < BUF_UNITS; i++) {                                              \
> > +        for (i = 0; i < BUF_UNITS; i+=8) {                                              \
> >              int src_offset = i * 64 * sizeof(type) + i; /* Test various alignments */      \
> >              int dst_offset = i * 64; /* dst must be aligned */                             \
> >              randomize_buffers();                                                           \
> > --
> > 1.7.9.5
> >
> 
> BUF_UNITS is 8, so that change would entirely eliminate the loop.
> Maybe src_offset should just be changed to be aligned properly,
> keeping the loop? Or is the only purpose of the loop to test
> alignment?

you mean something like this? :
commit e3ff4df1c0a83a178d0aaf102486d7fbc97994d1
Author: Michael Niedermayer <michael at niedermayer.cc>
Date:   Mon Jun 27 22:03:14 2016 +0200

    tests/checkasm/pixblockdsp: Test 8 byte aligned positions

    The code is documented as to require 8byte alignment

    Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

diff --git a/tests/checkasm/pixblockdsp.c b/tests/checkasm/pixblockdsp.c
index 66bfdb7..2b88e7d 100644
--- a/tests/checkasm/pixblockdsp.c
+++ b/tests/checkasm/pixblockdsp.c
@@ -26,7 +26,7 @@
 #include "libavutil/intreadwrite.h"

 #define BUF_UNITS 8
-#define BUF_SIZE (BUF_UNITS * 128 + BUF_UNITS)
+#define BUF_SIZE (BUF_UNITS * 128 + 8 * BUF_UNITS)

 #define randomize_buffers()                 \
     do {                                    \
@@ -50,7 +50,7 @@
         declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);    \
                                                                                            \
         for (i = 0; i < BUF_UNITS; i++) {                                              \
-            int src_offset = i * 64 * sizeof(type) + i; /* Test various alignments */      \
+            int src_offset = i * 64 * sizeof(type) + 8 * i; /* Test various alignments */      \
             int dst_offset = i * 64; /* dst must be aligned */                             \
             randomize_buffers();                                                           \
             call_ref(dst0 + dst_offset, src10 + src_offset, 8);                            \
@@ -67,7 +67,7 @@
         declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *av_restrict block, const uint8_t *s1, const uint8_t *s2, int stride); \
                                                                                            \
         for (i = 0; i < BUF_UNITS; i++) {                                              \
-            int src_offset = i * 64 * sizeof(type) + i; /* Test various alignments */      \
+            int src_offset = i * 64 * sizeof(type) + 8 * i; /* Test various alignments */      \
             int dst_offset = i * 64; /* dst must be aligned */                             \
             randomize_buffers();                                                           \
             call_ref(dst0 + dst_offset, src10 + src_offset, src20 + src_offset, 8);        \


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160627/4386cdbc/attachment.sig>


More information about the ffmpeg-devel mailing list