00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00055 #ifndef AVCODEC_MIPS_COMPUTE_ANTIALIAS_FIXED_H
00056 #define AVCODEC_MIPS_COMPUTE_ANTIALIAS_FIXED_H
00057
00058 #if HAVE_INLINE_ASM
00059 static void compute_antialias_mips_fixed(MPADecodeContext *s,
00060 GranuleDef *g)
00061 {
00062 int32_t *ptr, *csa;
00063 int n, i;
00064 int MAX_lo = 0xffffffff;
00065
00066
00067 if (g->block_type == 2) {
00068 if (!g->switch_point)
00069 return;
00070
00071 n = 1;
00072 } else {
00073 n = SBLIMIT - 1;
00074 }
00075
00076
00077 ptr = g->sb_hybrid + 18;
00078
00079 for(i = n;i > 0;i--) {
00080 int tmp0, tmp1, tmp2, tmp00, tmp11;
00081 int temp_reg1, temp_reg2, temp_reg3, temp_reg4, temp_reg5, temp_reg6;
00082 csa = &csa_table[0][0];
00083
00087 __asm__ volatile (
00088 "lw %[tmp0], -1*4(%[ptr]) \n\t"
00089 "lw %[tmp1], 0*4(%[ptr]) \n\t"
00090 "lw %[temp_reg1], 0*4(%[csa]) \n\t"
00091 "lw %[temp_reg2], 2*4(%[csa]) \n\t"
00092 "add %[tmp2], %[tmp0], %[tmp1] \n\t"
00093 "lw %[temp_reg3], 3*4(%[csa]) \n\t"
00094 "mult $ac0, %[tmp2], %[temp_reg1] \n\t"
00095 "mult $ac1, %[tmp2], %[temp_reg1] \n\t"
00096 "lw %[tmp00], -2*4(%[ptr]) \n\t"
00097 "lw %[tmp11], 1*4(%[ptr]) \n\t"
00098 "lw %[temp_reg4], 4*4(%[csa]) \n\t"
00099 "mtlo %[MAX_lo], $ac0 \n\t"
00100 "mtlo $zero, $ac1 \n\t"
00101 "msub $ac0, %[tmp1], %[temp_reg2] \n\t"
00102 "madd $ac1, %[tmp0], %[temp_reg3] \n\t"
00103 "add %[tmp2], %[tmp00], %[tmp11] \n\t"
00104 "lw %[temp_reg5], 6*4(%[csa]) \n\t"
00105 "mult $ac2, %[tmp2], %[temp_reg4] \n\t"
00106 "mult $ac3, %[tmp2], %[temp_reg4] \n\t"
00107 "mfhi %[temp_reg1], $ac0 \n\t"
00108 "mfhi %[temp_reg2], $ac1 \n\t"
00109 "lw %[temp_reg6], 7*4(%[csa]) \n\t"
00110 "mtlo %[MAX_lo], $ac2 \n\t"
00111 "msub $ac2, %[tmp11], %[temp_reg5] \n\t"
00112 "mtlo $zero, $ac3 \n\t"
00113 "madd $ac3, %[tmp00], %[temp_reg6] \n\t"
00114 "sll %[temp_reg1], %[temp_reg1], 2 \n\t"
00115 "sw %[temp_reg1], -1*4(%[ptr]) \n\t"
00116 "mfhi %[temp_reg4], $ac2 \n\t"
00117 "sll %[temp_reg2], %[temp_reg2], 2 \n\t"
00118 "mfhi %[temp_reg5], $ac3 \n\t"
00119 "sw %[temp_reg2], 0*4(%[ptr]) \n\t"
00120 "lw %[tmp0], -3*4(%[ptr]) \n\t"
00121 "lw %[tmp1], 2*4(%[ptr]) \n\t"
00122 "lw %[temp_reg1], 8*4(%[csa]) \n\t"
00123 "sll %[temp_reg4], %[temp_reg4], 2 \n\t"
00124 "add %[tmp2], %[tmp0], %[tmp1] \n\t"
00125 "sll %[temp_reg5], %[temp_reg5], 2 \n\t"
00126 "mult $ac0, %[tmp2], %[temp_reg1] \n\t"
00127 "mult $ac1, %[tmp2], %[temp_reg1] \n\t"
00128 "sw %[temp_reg4], -2*4(%[ptr]) \n\t"
00129 "sw %[temp_reg5], 1*4(%[ptr]) \n\t"
00130 "lw %[temp_reg2], 10*4(%[csa]) \n\t"
00131 "mtlo %[MAX_lo], $ac0 \n\t"
00132 "lw %[temp_reg3], 11*4(%[csa]) \n\t"
00133 "msub $ac0, %[tmp1], %[temp_reg2] \n\t"
00134 "mtlo $zero, $ac1 \n\t"
00135 "madd $ac1, %[tmp0], %[temp_reg3] \n\t"
00136 "lw %[tmp00], -4*4(%[ptr]) \n\t"
00137 "lw %[tmp11], 3*4(%[ptr]) \n\t"
00138 "mfhi %[temp_reg1], $ac0 \n\t"
00139 "lw %[temp_reg4], 12*4(%[csa]) \n\t"
00140 "mfhi %[temp_reg2], $ac1 \n\t"
00141 "add %[tmp2], %[tmp00], %[tmp11] \n\t"
00142 "mult $ac2, %[tmp2], %[temp_reg4] \n\t"
00143 "mult $ac3, %[tmp2], %[temp_reg4] \n\t"
00144 "lw %[temp_reg5], 14*4(%[csa]) \n\t"
00145 "lw %[temp_reg6], 15*4(%[csa]) \n\t"
00146 "sll %[temp_reg1], %[temp_reg1], 2 \n\t"
00147 "mtlo %[MAX_lo], $ac2 \n\t"
00148 "msub $ac2, %[tmp11], %[temp_reg5] \n\t"
00149 "mtlo $zero, $ac3 \n\t"
00150 "madd $ac3, %[tmp00], %[temp_reg6] \n\t"
00151 "sll %[temp_reg2], %[temp_reg2], 2 \n\t"
00152 "sw %[temp_reg1], -3*4(%[ptr]) \n\t"
00153 "mfhi %[temp_reg4], $ac2 \n\t"
00154 "sw %[temp_reg2], 2*4(%[ptr]) \n\t"
00155 "mfhi %[temp_reg5], $ac3 \n\t"
00156 "lw %[tmp0], -5*4(%[ptr]) \n\t"
00157 "lw %[tmp1], 4*4(%[ptr]) \n\t"
00158 "lw %[temp_reg1], 16*4(%[csa]) \n\t"
00159 "lw %[temp_reg2], 18*4(%[csa]) \n\t"
00160 "add %[tmp2], %[tmp0], %[tmp1] \n\t"
00161 "lw %[temp_reg3], 19*4(%[csa]) \n\t"
00162 "mult $ac0, %[tmp2], %[temp_reg1] \n\t"
00163 "mult $ac1, %[tmp2], %[temp_reg1] \n\t"
00164 "sll %[temp_reg4], %[temp_reg4], 2 \n\t"
00165 "sll %[temp_reg5], %[temp_reg5], 2 \n\t"
00166 "sw %[temp_reg4], -4*4(%[ptr]) \n\t"
00167 "mtlo %[MAX_lo], $ac0 \n\t"
00168 "msub $ac0, %[tmp1], %[temp_reg2] \n\t"
00169 "mtlo $zero, $ac1 \n\t"
00170 "madd $ac1, %[tmp0], %[temp_reg3] \n\t"
00171 "sw %[temp_reg5], 3*4(%[ptr]) \n\t"
00172 "lw %[tmp00], -6*4(%[ptr]) \n\t"
00173 "mfhi %[temp_reg1], $ac0 \n\t"
00174 "lw %[tmp11], 5*4(%[ptr]) \n\t"
00175 "mfhi %[temp_reg2], $ac1 \n\t"
00176 "lw %[temp_reg4], 20*4(%[csa]) \n\t"
00177 "add %[tmp2], %[tmp00], %[tmp11] \n\t"
00178 "lw %[temp_reg5], 22*4(%[csa]) \n\t"
00179 "mult $ac2, %[tmp2], %[temp_reg4] \n\t"
00180 "mult $ac3, %[tmp2], %[temp_reg4] \n\t"
00181 "lw %[temp_reg6], 23*4(%[csa]) \n\t"
00182 "sll %[temp_reg1], %[temp_reg1], 2 \n\t"
00183 "sll %[temp_reg2], %[temp_reg2], 2 \n\t"
00184 "mtlo %[MAX_lo], $ac2 \n\t"
00185 "msub $ac2, %[tmp11], %[temp_reg5] \n\t"
00186 "mtlo $zero, $ac3 \n\t"
00187 "madd $ac3, %[tmp00], %[temp_reg6] \n\t"
00188 "sw %[temp_reg1], -5*4(%[ptr]) \n\t"
00189 "sw %[temp_reg2], 4*4(%[ptr]) \n\t"
00190 "mfhi %[temp_reg4], $ac2 \n\t"
00191 "lw %[tmp0], -7*4(%[ptr]) \n\t"
00192 "mfhi %[temp_reg5], $ac3 \n\t"
00193 "lw %[tmp1], 6*4(%[ptr]) \n\t"
00194 "lw %[temp_reg1], 24*4(%[csa]) \n\t"
00195 "lw %[temp_reg2], 26*4(%[csa]) \n\t"
00196 "add %[tmp2], %[tmp0], %[tmp1] \n\t"
00197 "lw %[temp_reg3], 27*4(%[csa]) \n\t"
00198 "mult $ac0, %[tmp2], %[temp_reg1] \n\t"
00199 "mult $ac1, %[tmp2], %[temp_reg1] \n\t"
00200 "sll %[temp_reg4], %[temp_reg4], 2 \n\t"
00201 "sll %[temp_reg5], %[temp_reg5], 2 \n\t"
00202 "sw %[temp_reg4], -6*4(%[ptr]) \n\t"
00203 "mtlo %[MAX_lo], $ac0 \n\t"
00204 "msub $ac0, %[tmp1], %[temp_reg2] \n\t"
00205 "mtlo $zero, $ac1 \n\t"
00206 "madd $ac1, %[tmp0], %[temp_reg3] \n\t"
00207 "sw %[temp_reg5], 5*4(%[ptr]) \n\t"
00208 "lw %[tmp00], -8*4(%[ptr]) \n\t"
00209 "mfhi %[temp_reg1], $ac0 \n\t"
00210 "lw %[tmp11], 7*4(%[ptr]) \n\t"
00211 "mfhi %[temp_reg2], $ac1 \n\t"
00212 "lw %[temp_reg4], 28*4(%[csa]) \n\t"
00213 "add %[tmp2], %[tmp00], %[tmp11] \n\t"
00214 "lw %[temp_reg5], 30*4(%[csa]) \n\t"
00215 "mult $ac2, %[tmp2], %[temp_reg4] \n\t"
00216 "mult $ac3, %[tmp2], %[temp_reg4] \n\t"
00217 "lw %[temp_reg6], 31*4(%[csa]) \n\t"
00218 "sll %[temp_reg1], %[temp_reg1], 2 \n\t"
00219 "sll %[temp_reg2], %[temp_reg2], 2 \n\t"
00220 "mtlo %[MAX_lo], $ac2 \n\t"
00221 "msub $ac2, %[tmp11], %[temp_reg5] \n\t"
00222 "mtlo $zero, $ac3 \n\t"
00223 "madd $ac3, %[tmp00], %[temp_reg6] \n\t"
00224 "sw %[temp_reg1], -7*4(%[ptr]) \n\t"
00225 "sw %[temp_reg2], 6*4(%[ptr]) \n\t"
00226 "mfhi %[temp_reg4], $ac2 \n\t"
00227 "mfhi %[temp_reg5], $ac3 \n\t"
00228 "sll %[temp_reg4], %[temp_reg4], 2 \n\t"
00229 "sll %[temp_reg5], %[temp_reg5], 2 \n\t"
00230 "sw %[temp_reg4], -8*4(%[ptr]) \n\t"
00231 "sw %[temp_reg5], 7*4(%[ptr]) \n\t"
00232
00233 : [tmp0] "=&r" (tmp0), [tmp1] "=&r" (tmp1), [tmp2] "=&r" (tmp2),
00234 [tmp00] "=&r" (tmp00), [tmp11] "=&r" (tmp11),
00235 [temp_reg1] "=&r" (temp_reg1), [temp_reg2] "=&r" (temp_reg2),
00236 [temp_reg3] "=&r" (temp_reg3), [temp_reg4] "=&r" (temp_reg4),
00237 [temp_reg5] "=&r" (temp_reg5), [temp_reg6] "=&r" (temp_reg6)
00238 : [csa] "r" (csa), [ptr] "r" (ptr),
00239 [MAX_lo] "r" (MAX_lo)
00240 );
00241
00242 ptr += 18;
00243 }
00244 }
00245 #define compute_antialias compute_antialias_mips_fixed
00246 #endif
00247
00248 #endif