os/ossrv/genericopenlibs/liboil/src/copy/trans8x8_c.c
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2  * LIBOIL - Library of Optimized Inner Loops
     3  * Copyright (c) 2004 David A. Schleef <ds@schleef.org>
     4  * All rights reserved.
     5  *
     6  * Redistribution and use in source and binary forms, with or without
     7  * modification, are permitted provided that the following conditions
     8  * are met:
     9  * 1. Redistributions of source code must retain the above copyright
    10  *    notice, this list of conditions and the following disclaimer.
    11  * 2. Redistributions in binary form must reproduce the above copyright
    12  *    notice, this list of conditions and the following disclaimer in the
    13  *    documentation and/or other materials provided with the distribution.
    14  * 
    15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
    19  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    21  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    23  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
    24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    25  * POSSIBILITY OF SUCH DAMAGE.
    26  */
    27 //Portions Copyright (c)  2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
    28 
    29 #ifdef HAVE_CONFIG_H
    30 #include "config.h"
    31 #endif
    32 
    33 #include <liboil/liboil.h>
    34 #include <liboil/liboilfunction.h>
    35 
    36 OIL_DECLARE_CLASS (trans8x8_u16);
    37 
    38 static void
    39 trans8x8_u16_c1 (uint16_t *dest, int dstr, const uint16_t *src, int sstr)
    40 {
    41   int i;
    42   int j;
    43   uint16_t *d, *s;
    44 
    45   for(i=0;i<8;i++){
    46     d = OIL_OFFSET(dest, 2*i);
    47     s = OIL_OFFSET(src, sstr*i);
    48     for(j=0;j<8;j++){
    49       OIL_GET(d,dstr*j,uint16_t) = s[j];
    50     }
    51   }
    52 }
    53 OIL_DEFINE_IMPL (trans8x8_u16_c1, trans8x8_u16);
    54 
    55 static void
    56 trans8x8_u16_c2 (uint16_t *dest, int dstr, const uint16_t *src, int sstr)
    57 {
    58   int i;
    59   uint16_t *d, *s;
    60 
    61   for(i=0;i<8;i++){
    62     d = OIL_OFFSET(dest, 2*i);
    63     s = OIL_OFFSET(src, sstr*i);
    64     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    65     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    66     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    67     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    68     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    69     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    70     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    71     *d = *s; s++; d = OIL_OFFSET(d, dstr);
    72   }
    73 }
    74 OIL_DEFINE_IMPL (trans8x8_u16_c2, trans8x8_u16);
    75 
    76 static void
    77 trans8x8_u16_c3 (uint16_t *dest, int dstr, const uint16_t *src, int sstr)
    78 {
    79   int i;
    80   uint16_t *d, *s;
    81 
    82   for(i=0;i<8;i++){
    83     d = OIL_OFFSET(dest, 2*i);
    84     s = OIL_OFFSET(src, sstr*i);
    85     OIL_GET(d,dstr*0,uint16_t) = s[0];
    86     OIL_GET(d,dstr*1,uint16_t) = s[1];
    87     OIL_GET(d,dstr*2,uint16_t) = s[2];
    88     OIL_GET(d,dstr*3,uint16_t) = s[3];
    89     OIL_GET(d,dstr*4,uint16_t) = s[4];
    90     OIL_GET(d,dstr*5,uint16_t) = s[5];
    91     OIL_GET(d,dstr*6,uint16_t) = s[6];
    92     OIL_GET(d,dstr*7,uint16_t) = s[7];
    93   }
    94 }
    95 OIL_DEFINE_IMPL (trans8x8_u16_c3, trans8x8_u16);
    96 
    97 static void
    98 trans8x8_u16_c4 (uint16_t *dest, int dstr, const uint16_t *src, int sstr)
    99 {
   100   int i;
   101   uint16_t *d, *s;
   102 
   103   for(i=0;i<8;i++){
   104     d = OIL_OFFSET(dest, 2*i);
   105     s = OIL_OFFSET(src, sstr*i);
   106     OIL_GET(d,dstr*0,uint16_t) = *s++;
   107     OIL_GET(d,dstr*1,uint16_t) = *s++;
   108     OIL_GET(d,dstr*2,uint16_t) = *s++;
   109     OIL_GET(d,dstr*3,uint16_t) = *s++;
   110     OIL_GET(d,dstr*4,uint16_t) = *s++;
   111     OIL_GET(d,dstr*5,uint16_t) = *s++;
   112     OIL_GET(d,dstr*6,uint16_t) = *s++;
   113     OIL_GET(d,dstr*7,uint16_t) = *s++;
   114   }
   115 }
   116 
   117 OIL_DEFINE_IMPL (trans8x8_u16_c4, trans8x8_u16);
   118 
   119 
   120 
   121 
   122 #ifdef	__SYMBIAN32__
   123  
   124 OilFunctionImpl* __oil_function_impl_trans8x8_u16_c1() {
   125 		return &_oil_function_impl_trans8x8_u16_c1;
   126 }
   127 #endif
   128 
   129 #ifdef	__SYMBIAN32__
   130  
   131 OilFunctionImpl* __oil_function_impl_trans8x8_u16_c2() {
   132 		return &_oil_function_impl_trans8x8_u16_c2;
   133 }
   134 #endif
   135 
   136 #ifdef	__SYMBIAN32__
   137  
   138 OilFunctionImpl* __oil_function_impl_trans8x8_u16_c3() {
   139 		return &_oil_function_impl_trans8x8_u16_c3;
   140 }
   141 #endif
   142 
   143 #ifdef	__SYMBIAN32__
   144  
   145 OilFunctionImpl* __oil_function_impl_trans8x8_u16_c4() {
   146 		return &_oil_function_impl_trans8x8_u16_c4;
   147 }
   148 #endif
   149