Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > VSs > VSs__H264__App
comparison libavcodec/cell/mathops_spu.h @ 7:c8259123d224
hide animating VP and entry point
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Wed, 15 May 2013 15:26:14 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:291234ea562b |
|---|---|
| 1 /* | |
| 2 * simple math operations | |
| 3 * Copyright (c) 2001, 2002 Fabrice Bellard | |
| 4 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al | |
| 5 * | |
| 6 * This file is part of FFmpeg. | |
| 7 * | |
| 8 * FFmpeg is free software; you can redistribute it and/or | |
| 9 * modify it under the terms of the GNU Lesser General Public | |
| 10 * License as published by the Free Software Foundation; either | |
| 11 * version 2.1 of the License, or (at your option) any later version. | |
| 12 * | |
| 13 * FFmpeg is distributed in the hope that it will be useful, | |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 16 * Lesser General Public License for more details. | |
| 17 * | |
| 18 * You should have received a copy of the GNU Lesser General Public | |
| 19 * License along with FFmpeg; if not, write to the Free Software | |
| 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 21 */ | |
| 22 #ifndef AVCODEC_MATHOPS_H | |
| 23 #define AVCODEC_MATHOPS_H | |
| 24 | |
| 25 // #include "libavutil/common.h" | |
| 26 // #include "libavutil/internal.h" | |
| 27 // | |
| 28 // /* generic implementation */ | |
| 29 // | |
| 30 // #ifndef MULL | |
| 31 // # define MULL(a,b,s) (((int64_t)(a) * (int64_t)(b)) >> (s)) | |
| 32 // #endif | |
| 33 // | |
| 34 // #ifndef MULH | |
| 35 // //gcc 3.4 creates an incredibly bloated mess out of this | |
| 36 // //# define MULH(a,b) (((int64_t)(a) * (int64_t)(b))>>32) | |
| 37 // | |
| 38 // static av_always_inline int MULH(int a, int b){ | |
| 39 // return ((int64_t)(a) * (int64_t)(b))>>32; | |
| 40 // } | |
| 41 // #endif | |
| 42 // | |
| 43 // #ifndef UMULH | |
| 44 // static av_always_inline unsigned UMULH(unsigned a, unsigned b){ | |
| 45 // return ((uint64_t)(a) * (uint64_t)(b))>>32; | |
| 46 // } | |
| 47 // #endif | |
| 48 // | |
| 49 // #ifndef MUL64 | |
| 50 // # define MUL64(a,b) ((int64_t)(a) * (int64_t)(b)) | |
| 51 // #endif | |
| 52 // | |
| 53 // #ifndef MAC64 | |
| 54 // # define MAC64(d, a, b) ((d) += MUL64(a, b)) | |
| 55 // #endif | |
| 56 // | |
| 57 // #ifndef MLS64 | |
| 58 // # define MLS64(d, a, b) ((d) -= MUL64(a, b)) | |
| 59 // #endif | |
| 60 // | |
| 61 // /* signed 16x16 -> 32 multiply add accumulate */ | |
| 62 // #ifndef MAC16 | |
| 63 // # define MAC16(rt, ra, rb) rt += (ra) * (rb) | |
| 64 // #endif | |
| 65 // | |
| 66 // /* signed 16x16 -> 32 multiply */ | |
| 67 // #ifndef MUL16 | |
| 68 // # define MUL16(ra, rb) ((ra) * (rb)) | |
| 69 // #endif | |
| 70 // | |
| 71 // #ifndef MLS16 | |
| 72 // # define MLS16(rt, ra, rb) ((rt) -= (ra) * (rb)) | |
| 73 // #endif | |
| 74 | |
| 75 /* median of 3 */ | |
| 76 #ifndef mid_pred | |
| 77 #define mid_pred mid_pred | |
| 78 static inline av_const int mid_pred(int a, int b, int c) | |
| 79 { | |
| 80 #if 0 | |
| 81 int t= (a-b)&((a-b)>>31); | |
| 82 a-=t; | |
| 83 b+=t; | |
| 84 b-= (b-c)&((b-c)>>31); | |
| 85 b+= (a-b)&((a-b)>>31); | |
| 86 | |
| 87 return b; | |
| 88 #else | |
| 89 if(a>b){ | |
| 90 if(c>b){ | |
| 91 if(c>a) b=a; | |
| 92 else b=c; | |
| 93 } | |
| 94 }else{ | |
| 95 if(b>c){ | |
| 96 if(c>a) b=c; | |
| 97 else b=a; | |
| 98 } | |
| 99 } | |
| 100 return b; | |
| 101 #endif | |
| 102 } | |
| 103 #endif | |
| 104 | |
| 105 // #ifndef sign_extend | |
| 106 // static inline av_const int sign_extend(int val, unsigned bits) | |
| 107 // { | |
| 108 // return (val << (INT_BIT - bits)) >> (INT_BIT - bits); | |
| 109 // } | |
| 110 // #endif | |
| 111 // | |
| 112 // #ifndef zero_extend | |
| 113 // static inline av_const unsigned zero_extend(unsigned val, unsigned bits) | |
| 114 // { | |
| 115 // return (val << (INT_BIT - bits)) >> (INT_BIT - bits); | |
| 116 // } | |
| 117 // #endif | |
| 118 // | |
| 119 // #ifndef COPY3_IF_LT | |
| 120 // #define COPY3_IF_LT(x, y, a, b, c, d)\ | |
| 121 // if ((y) < (x)) {\ | |
| 122 // (x) = (y);\ | |
| 123 // (a) = (b);\ | |
| 124 // (c) = (d);\ | |
| 125 // } | |
| 126 // #endif | |
| 127 // | |
| 128 // #ifndef NEG_SSR32 | |
| 129 // # define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) | |
| 130 // #endif | |
| 131 // | |
| 132 // #ifndef NEG_USR32 | |
| 133 // # define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) | |
| 134 // #endif | |
| 135 | |
| 136 #endif /* AVCODEC_MATHOPS_H */ | |
| 137 |
