media/libyuv/source/compare_neon.cc

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2  *  Copyright 2012 The LibYuv Project Authors. All rights reserved.
     3  *
     4  *  Use of this source code is governed by a BSD-style license
     5  *  that can be found in the LICENSE file in the root of the source
     6  *  tree. An additional intellectual property rights grant can be found
     7  *  in the file PATENTS. All contributing project authors may
     8  *  be found in the AUTHORS file in the root of the source tree.
     9  */
    11 #include "libyuv/basic_types.h"
    13 #ifdef __cplusplus
    14 namespace libyuv {
    15 extern "C" {
    16 #endif
    18 #if !defined(LIBYUV_DISABLE_NEON) && defined(__ARM_NEON__)
    20 uint32 SumSquareError_NEON(const uint8* src_a, const uint8* src_b, int count) {
    21   volatile uint32 sse;
    22   asm volatile (
    23     "vmov.u8    q8, #0                         \n"
    24     "vmov.u8    q10, #0                        \n"
    25     "vmov.u8    q9, #0                         \n"
    26     "vmov.u8    q11, #0                        \n"
    28     ".p2align  2                               \n"
    29   "1:                                          \n"
    30     "vld1.8     {q0}, [%0]!                    \n"
    31     "vld1.8     {q1}, [%1]!                    \n"
    32     "subs       %2, %2, #16                    \n"
    33     "vsubl.u8   q2, d0, d2                     \n"
    34     "vsubl.u8   q3, d1, d3                     \n"
    35     "vmlal.s16  q8, d4, d4                     \n"
    36     "vmlal.s16  q9, d6, d6                     \n"
    37     "vmlal.s16  q10, d5, d5                    \n"
    38     "vmlal.s16  q11, d7, d7                    \n"
    39     "bgt        1b                             \n"
    41     "vadd.u32   q8, q8, q9                     \n"
    42     "vadd.u32   q10, q10, q11                  \n"
    43     "vadd.u32   q11, q8, q10                   \n"
    44     "vpaddl.u32 q1, q11                        \n"
    45     "vadd.u64   d0, d2, d3                     \n"
    46     "vmov.32    %3, d0[0]                      \n"
    47     : "+r"(src_a),
    48       "+r"(src_b),
    49       "+r"(count),
    50       "=r"(sse)
    51     :
    52     : "memory", "cc", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11");
    53   return sse;
    54 }
    56 #endif  // __ARM_NEON__
    58 #ifdef __cplusplus
    59 }  // extern "C"
    60 }  // namespace libyuv
    61 #endif

mercurial