00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "libavutil/x86_cpu.h"
00023 #include "libavcodec/avcodec.h"
00024 #include "libavcodec/snow.h"
00025
00026 void ff_snow_horizontal_compose97i_sse2(IDWTELEM *b, int width){
00027 const int w2= (width+1)>>1;
00028 DECLARE_ALIGNED_16(IDWTELEM, temp[width>>1]);
00029 const int w_l= (width>>1);
00030 const int w_r= w2 - 1;
00031 int i;
00032
00033 {
00034 IDWTELEM * const ref = b + w2 - 1;
00035 IDWTELEM b_0 = b[0];
00036
00037
00038
00039
00040 i = 0;
00041 __asm__ volatile(
00042 "pcmpeqd %%xmm7, %%xmm7 \n\t"
00043 "pcmpeqd %%xmm3, %%xmm3 \n\t"
00044 "psllw $1, %%xmm3 \n\t"
00045 "paddw %%xmm7, %%xmm3 \n\t"
00046 "psllw $13, %%xmm3 \n\t"
00047 ::);
00048 for(; i<w_l-15; i+=16){
00049 __asm__ volatile(
00050 "movdqu (%1), %%xmm1 \n\t"
00051 "movdqu 16(%1), %%xmm5 \n\t"
00052 "movdqu 2(%1), %%xmm2 \n\t"
00053 "movdqu 18(%1), %%xmm6 \n\t"
00054 "paddw %%xmm1, %%xmm2 \n\t"
00055 "paddw %%xmm5, %%xmm6 \n\t"
00056 "paddw %%xmm7, %%xmm2 \n\t"
00057 "paddw %%xmm7, %%xmm6 \n\t"
00058 "pmulhw %%xmm3, %%xmm2 \n\t"
00059 "pmulhw %%xmm3, %%xmm6 \n\t"
00060 "paddw (%0), %%xmm2 \n\t"
00061 "paddw 16(%0), %%xmm6 \n\t"
00062 "movdqa %%xmm2, (%0) \n\t"
00063 "movdqa %%xmm6, 16(%0) \n\t"
00064 :: "r"(&b[i]), "r"(&ref[i])
00065 : "memory"
00066 );
00067 }
00068 snow_horizontal_compose_lift_lead_out(i, b, b, ref, width, w_l, 0, W_DM, W_DO, W_DS);
00069 b[0] = b_0 - ((W_DM * 2 * ref[1]+W_DO)>>W_DS);
00070 }
00071
00072 {
00073 IDWTELEM * const dst = b+w2;
00074
00075 i = 0;
00076 for(; (((x86_reg)&dst[i]) & 0x1F) && i<w_r; i++){
00077 dst[i] = dst[i] - (b[i] + b[i + 1]);
00078 }
00079 for(; i<w_r-15; i+=16){
00080 __asm__ volatile(
00081 "movdqu (%1), %%xmm1 \n\t"
00082 "movdqu 16(%1), %%xmm5 \n\t"
00083 "movdqu 2(%1), %%xmm2 \n\t"
00084 "movdqu 18(%1), %%xmm6 \n\t"
00085 "paddw %%xmm1, %%xmm2 \n\t"
00086 "paddw %%xmm5, %%xmm6 \n\t"
00087 "movdqa (%0), %%xmm0 \n\t"
00088 "movdqa 16(%0), %%xmm4 \n\t"
00089 "psubw %%xmm2, %%xmm0 \n\t"
00090 "psubw %%xmm6, %%xmm4 \n\t"
00091 "movdqa %%xmm0, (%0) \n\t"
00092 "movdqa %%xmm4, 16(%0) \n\t"
00093 :: "r"(&dst[i]), "r"(&b[i])
00094 : "memory"
00095 );
00096 }
00097 snow_horizontal_compose_lift_lead_out(i, dst, dst, b, width, w_r, 1, W_CM, W_CO, W_CS);
00098 }
00099
00100 {
00101 IDWTELEM * const ref = b+w2 - 1;
00102 IDWTELEM b_0 = b[0];
00103
00104 i = 0;
00105 __asm__ volatile(
00106 "psllw $15, %%xmm7 \n\t"
00107 "pcmpeqw %%xmm6, %%xmm6 \n\t"
00108 "psrlw $13, %%xmm6 \n\t"
00109 "paddw %%xmm7, %%xmm6 \n\t"
00110 ::);
00111 for(; i<w_l-15; i+=16){
00112 __asm__ volatile(
00113 "movdqu (%1), %%xmm0 \n\t"
00114 "movdqu 16(%1), %%xmm4 \n\t"
00115 "movdqu 2(%1), %%xmm1 \n\t"
00116 "movdqu 18(%1), %%xmm5 \n\t"
00117 "paddw %%xmm6, %%xmm0 \n\t"
00118 "paddw %%xmm6, %%xmm4 \n\t"
00119 "paddw %%xmm7, %%xmm1 \n\t"
00120 "paddw %%xmm7, %%xmm5 \n\t"
00121 "pavgw %%xmm1, %%xmm0 \n\t"
00122 "pavgw %%xmm5, %%xmm4 \n\t"
00123 "psubw %%xmm7, %%xmm0 \n\t"
00124 "psubw %%xmm7, %%xmm4 \n\t"
00125 "psraw $1, %%xmm0 \n\t"
00126 "psraw $1, %%xmm4 \n\t"
00127 "movdqa (%0), %%xmm1 \n\t"
00128 "movdqa 16(%0), %%xmm5 \n\t"
00129 "paddw %%xmm1, %%xmm0 \n\t"
00130 "paddw %%xmm5, %%xmm4 \n\t"
00131 "psraw $2, %%xmm0 \n\t"
00132 "psraw $2, %%xmm4 \n\t"
00133 "paddw %%xmm1, %%xmm0 \n\t"
00134 "paddw %%xmm5, %%xmm4 \n\t"
00135 "movdqa %%xmm0, (%0) \n\t"
00136 "movdqa %%xmm4, 16(%0) \n\t"
00137 :: "r"(&b[i]), "r"(&ref[i])
00138 : "memory"
00139 );
00140 }
00141 snow_horizontal_compose_liftS_lead_out(i, b, b, ref, width, w_l);
00142 b[0] = b_0 + ((2 * ref[1] + W_BO-1 + 4 * b_0) >> W_BS);
00143 }
00144
00145 {
00146 IDWTELEM * const src = b+w2;
00147
00148 i = 0;
00149 for(; (((x86_reg)&temp[i]) & 0x1F) && i<w_r; i++){
00150 temp[i] = src[i] - ((-W_AM*(b[i] + b[i+1]))>>W_AS);
00151 }
00152 for(; i<w_r-7; i+=8){
00153 __asm__ volatile(
00154 "movdqu 2(%1), %%xmm2 \n\t"
00155 "movdqu 18(%1), %%xmm6 \n\t"
00156 "paddw (%1), %%xmm2 \n\t"
00157 "paddw 16(%1), %%xmm6 \n\t"
00158 "movdqu (%0), %%xmm0 \n\t"
00159 "movdqu 16(%0), %%xmm4 \n\t"
00160 "paddw %%xmm2, %%xmm0 \n\t"
00161 "paddw %%xmm6, %%xmm4 \n\t"
00162 "psraw $1, %%xmm2 \n\t"
00163 "psraw $1, %%xmm6 \n\t"
00164 "paddw %%xmm0, %%xmm2 \n\t"
00165 "paddw %%xmm4, %%xmm6 \n\t"
00166 "movdqa %%xmm2, (%2) \n\t"
00167 "movdqa %%xmm6, 16(%2) \n\t"
00168 :: "r"(&src[i]), "r"(&b[i]), "r"(&temp[i])
00169 : "memory"
00170 );
00171 }
00172 snow_horizontal_compose_lift_lead_out(i, temp, src, b, width, w_r, 1, -W_AM, W_AO+1, W_AS);
00173 }
00174
00175 {
00176 snow_interleave_line_header(&i, width, b, temp);
00177
00178 for (; (i & 0x3E) != 0x3E; i-=2){
00179 b[i+1] = temp[i>>1];
00180 b[i] = b[i>>1];
00181 }
00182 for (i-=62; i>=0; i-=64){
00183 __asm__ volatile(
00184 "movdqa (%1), %%xmm0 \n\t"
00185 "movdqa 16(%1), %%xmm2 \n\t"
00186 "movdqa 32(%1), %%xmm4 \n\t"
00187 "movdqa 48(%1), %%xmm6 \n\t"
00188 "movdqa (%1), %%xmm1 \n\t"
00189 "movdqa 16(%1), %%xmm3 \n\t"
00190 "movdqa 32(%1), %%xmm5 \n\t"
00191 "movdqa 48(%1), %%xmm7 \n\t"
00192 "punpcklwd (%2), %%xmm0 \n\t"
00193 "punpcklwd 16(%2), %%xmm2 \n\t"
00194 "punpcklwd 32(%2), %%xmm4 \n\t"
00195 "punpcklwd 48(%2), %%xmm6 \n\t"
00196 "movdqa %%xmm0, (%0) \n\t"
00197 "movdqa %%xmm2, 32(%0) \n\t"
00198 "movdqa %%xmm4, 64(%0) \n\t"
00199 "movdqa %%xmm6, 96(%0) \n\t"
00200 "punpckhwd (%2), %%xmm1 \n\t"
00201 "punpckhwd 16(%2), %%xmm3 \n\t"
00202 "punpckhwd 32(%2), %%xmm5 \n\t"
00203 "punpckhwd 48(%2), %%xmm7 \n\t"
00204 "movdqa %%xmm1, 16(%0) \n\t"
00205 "movdqa %%xmm3, 48(%0) \n\t"
00206 "movdqa %%xmm5, 80(%0) \n\t"
00207 "movdqa %%xmm7, 112(%0) \n\t"
00208 :: "r"(&(b)[i]), "r"(&(b)[i>>1]), "r"(&(temp)[i>>1])
00209 : "memory"
00210 );
00211 }
00212 }
00213 }
00214
00215 void ff_snow_horizontal_compose97i_mmx(IDWTELEM *b, int width){
00216 const int w2= (width+1)>>1;
00217 IDWTELEM temp[width >> 1];
00218 const int w_l= (width>>1);
00219 const int w_r= w2 - 1;
00220 int i;
00221
00222 {
00223 IDWTELEM * const ref = b + w2 - 1;
00224
00225 i = 1;
00226 b[0] = b[0] - ((W_DM * 2 * ref[1]+W_DO)>>W_DS);
00227 __asm__ volatile(
00228 "pcmpeqw %%mm7, %%mm7 \n\t"
00229 "pcmpeqw %%mm3, %%mm3 \n\t"
00230 "psllw $1, %%mm3 \n\t"
00231 "paddw %%mm7, %%mm3 \n\t"
00232 "psllw $13, %%mm3 \n\t"
00233 ::);
00234 for(; i<w_l-7; i+=8){
00235 __asm__ volatile(
00236 "movq (%1), %%mm2 \n\t"
00237 "movq 8(%1), %%mm6 \n\t"
00238 "paddw 2(%1), %%mm2 \n\t"
00239 "paddw 10(%1), %%mm6 \n\t"
00240 "paddw %%mm7, %%mm2 \n\t"
00241 "paddw %%mm7, %%mm6 \n\t"
00242 "pmulhw %%mm3, %%mm2 \n\t"
00243 "pmulhw %%mm3, %%mm6 \n\t"
00244 "paddw (%0), %%mm2 \n\t"
00245 "paddw 8(%0), %%mm6 \n\t"
00246 "movq %%mm2, (%0) \n\t"
00247 "movq %%mm6, 8(%0) \n\t"
00248 :: "r"(&b[i]), "r"(&ref[i])
00249 : "memory"
00250 );
00251 }
00252 snow_horizontal_compose_lift_lead_out(i, b, b, ref, width, w_l, 0, W_DM, W_DO, W_DS);
00253 }
00254
00255 {
00256 IDWTELEM * const dst = b+w2;
00257
00258 i = 0;
00259 for(; i<w_r-7; i+=8){
00260 __asm__ volatile(
00261 "movq (%1), %%mm2 \n\t"
00262 "movq 8(%1), %%mm6 \n\t"
00263 "paddw 2(%1), %%mm2 \n\t"
00264 "paddw 10(%1), %%mm6 \n\t"
00265 "movq (%0), %%mm0 \n\t"
00266 "movq 8(%0), %%mm4 \n\t"
00267 "psubw %%mm2, %%mm0 \n\t"
00268 "psubw %%mm6, %%mm4 \n\t"
00269 "movq %%mm0, (%0) \n\t"
00270 "movq %%mm4, 8(%0) \n\t"
00271 :: "r"(&dst[i]), "r"(&b[i])
00272 : "memory"
00273 );
00274 }
00275 snow_horizontal_compose_lift_lead_out(i, dst, dst, b, width, w_r, 1, W_CM, W_CO, W_CS);
00276 }
00277
00278 {
00279 IDWTELEM * const ref = b+w2 - 1;
00280
00281 i = 1;
00282 b[0] = b[0] + (((2 * ref[1] + W_BO) + 4 * b[0]) >> W_BS);
00283 __asm__ volatile(
00284 "psllw $15, %%mm7 \n\t"
00285 "pcmpeqw %%mm6, %%mm6 \n\t"
00286 "psrlw $13, %%mm6 \n\t"
00287 "paddw %%mm7, %%mm6 \n\t"
00288 ::);
00289 for(; i<w_l-7; i+=8){
00290 __asm__ volatile(
00291 "movq (%1), %%mm0 \n\t"
00292 "movq 8(%1), %%mm4 \n\t"
00293 "movq 2(%1), %%mm1 \n\t"
00294 "movq 10(%1), %%mm5 \n\t"
00295 "paddw %%mm6, %%mm0 \n\t"
00296 "paddw %%mm6, %%mm4 \n\t"
00297 "paddw %%mm7, %%mm1 \n\t"
00298 "paddw %%mm7, %%mm5 \n\t"
00299 "pavgw %%mm1, %%mm0 \n\t"
00300 "pavgw %%mm5, %%mm4 \n\t"
00301 "psubw %%mm7, %%mm0 \n\t"
00302 "psubw %%mm7, %%mm4 \n\t"
00303 "psraw $1, %%mm0 \n\t"
00304 "psraw $1, %%mm4 \n\t"
00305 "movq (%0), %%mm1 \n\t"
00306 "movq 8(%0), %%mm5 \n\t"
00307 "paddw %%mm1, %%mm0 \n\t"
00308 "paddw %%mm5, %%mm4 \n\t"
00309 "psraw $2, %%mm0 \n\t"
00310 "psraw $2, %%mm4 \n\t"
00311 "paddw %%mm1, %%mm0 \n\t"
00312 "paddw %%mm5, %%mm4 \n\t"
00313 "movq %%mm0, (%0) \n\t"
00314 "movq %%mm4, 8(%0) \n\t"
00315 :: "r"(&b[i]), "r"(&ref[i])
00316 : "memory"
00317 );
00318 }
00319 snow_horizontal_compose_liftS_lead_out(i, b, b, ref, width, w_l);
00320 }
00321
00322 {
00323 IDWTELEM * const src = b+w2;
00324 i = 0;
00325
00326 for(; i<w_r-7; i+=8){
00327 __asm__ volatile(
00328 "movq 2(%1), %%mm2 \n\t"
00329 "movq 10(%1), %%mm6 \n\t"
00330 "paddw (%1), %%mm2 \n\t"
00331 "paddw 8(%1), %%mm6 \n\t"
00332 "movq (%0), %%mm0 \n\t"
00333 "movq 8(%0), %%mm4 \n\t"
00334 "paddw %%mm2, %%mm0 \n\t"
00335 "paddw %%mm6, %%mm4 \n\t"
00336 "psraw $1, %%mm2 \n\t"
00337 "psraw $1, %%mm6 \n\t"
00338 "paddw %%mm0, %%mm2 \n\t"
00339 "paddw %%mm4, %%mm6 \n\t"
00340 "movq %%mm2, (%2) \n\t"
00341 "movq %%mm6, 8(%2) \n\t"
00342 :: "r"(&src[i]), "r"(&b[i]), "r"(&temp[i])
00343 : "memory"
00344 );
00345 }
00346 snow_horizontal_compose_lift_lead_out(i, temp, src, b, width, w_r, 1, -W_AM, W_AO+1, W_AS);
00347 }
00348
00349 {
00350 snow_interleave_line_header(&i, width, b, temp);
00351
00352 for (; (i & 0x1E) != 0x1E; i-=2){
00353 b[i+1] = temp[i>>1];
00354 b[i] = b[i>>1];
00355 }
00356 for (i-=30; i>=0; i-=32){
00357 __asm__ volatile(
00358 "movq (%1), %%mm0 \n\t"
00359 "movq 8(%1), %%mm2 \n\t"
00360 "movq 16(%1), %%mm4 \n\t"
00361 "movq 24(%1), %%mm6 \n\t"
00362 "movq (%1), %%mm1 \n\t"
00363 "movq 8(%1), %%mm3 \n\t"
00364 "movq 16(%1), %%mm5 \n\t"
00365 "movq 24(%1), %%mm7 \n\t"
00366 "punpcklwd (%2), %%mm0 \n\t"
00367 "punpcklwd 8(%2), %%mm2 \n\t"
00368 "punpcklwd 16(%2), %%mm4 \n\t"
00369 "punpcklwd 24(%2), %%mm6 \n\t"
00370 "movq %%mm0, (%0) \n\t"
00371 "movq %%mm2, 16(%0) \n\t"
00372 "movq %%mm4, 32(%0) \n\t"
00373 "movq %%mm6, 48(%0) \n\t"
00374 "punpckhwd (%2), %%mm1 \n\t"
00375 "punpckhwd 8(%2), %%mm3 \n\t"
00376 "punpckhwd 16(%2), %%mm5 \n\t"
00377 "punpckhwd 24(%2), %%mm7 \n\t"
00378 "movq %%mm1, 8(%0) \n\t"
00379 "movq %%mm3, 24(%0) \n\t"
00380 "movq %%mm5, 40(%0) \n\t"
00381 "movq %%mm7, 56(%0) \n\t"
00382 :: "r"(&b[i]), "r"(&b[i>>1]), "r"(&temp[i>>1])
00383 : "memory"
00384 );
00385 }
00386 }
00387 }
00388
00389 #if HAVE_7REGS
00390 #define snow_vertical_compose_sse2_load_add(op,r,t0,t1,t2,t3)\
00391 ""op" ("r",%%"REG_d"), %%"t0" \n\t"\
00392 ""op" 16("r",%%"REG_d"), %%"t1" \n\t"\
00393 ""op" 32("r",%%"REG_d"), %%"t2" \n\t"\
00394 ""op" 48("r",%%"REG_d"), %%"t3" \n\t"
00395
00396 #define snow_vertical_compose_sse2_load(r,t0,t1,t2,t3)\
00397 snow_vertical_compose_sse2_load_add("movdqa",r,t0,t1,t2,t3)
00398
00399 #define snow_vertical_compose_sse2_add(r,t0,t1,t2,t3)\
00400 snow_vertical_compose_sse2_load_add("paddw",r,t0,t1,t2,t3)
00401
00402 #define snow_vertical_compose_r2r_sub(s0,s1,s2,s3,t0,t1,t2,t3)\
00403 "psubw %%"s0", %%"t0" \n\t"\
00404 "psubw %%"s1", %%"t1" \n\t"\
00405 "psubw %%"s2", %%"t2" \n\t"\
00406 "psubw %%"s3", %%"t3" \n\t"
00407
00408 #define snow_vertical_compose_sse2_store(w,s0,s1,s2,s3)\
00409 "movdqa %%"s0", ("w",%%"REG_d") \n\t"\
00410 "movdqa %%"s1", 16("w",%%"REG_d") \n\t"\
00411 "movdqa %%"s2", 32("w",%%"REG_d") \n\t"\
00412 "movdqa %%"s3", 48("w",%%"REG_d") \n\t"
00413
00414 #define snow_vertical_compose_sra(n,t0,t1,t2,t3)\
00415 "psraw $"n", %%"t0" \n\t"\
00416 "psraw $"n", %%"t1" \n\t"\
00417 "psraw $"n", %%"t2" \n\t"\
00418 "psraw $"n", %%"t3" \n\t"
00419
00420 #define snow_vertical_compose_r2r_add(s0,s1,s2,s3,t0,t1,t2,t3)\
00421 "paddw %%"s0", %%"t0" \n\t"\
00422 "paddw %%"s1", %%"t1" \n\t"\
00423 "paddw %%"s2", %%"t2" \n\t"\
00424 "paddw %%"s3", %%"t3" \n\t"
00425
00426 #define snow_vertical_compose_r2r_pmulhw(s0,s1,s2,s3,t0,t1,t2,t3)\
00427 "pmulhw %%"s0", %%"t0" \n\t"\
00428 "pmulhw %%"s1", %%"t1" \n\t"\
00429 "pmulhw %%"s2", %%"t2" \n\t"\
00430 "pmulhw %%"s3", %%"t3" \n\t"
00431
00432 #define snow_vertical_compose_sse2_move(s0,s1,s2,s3,t0,t1,t2,t3)\
00433 "movdqa %%"s0", %%"t0" \n\t"\
00434 "movdqa %%"s1", %%"t1" \n\t"\
00435 "movdqa %%"s2", %%"t2" \n\t"\
00436 "movdqa %%"s3", %%"t3" \n\t"
00437
00438 void ff_snow_vertical_compose97i_sse2(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width){
00439 x86_reg i = width;
00440
00441 while(i & 0x1F)
00442 {
00443 i--;
00444 b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS;
00445 b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS;
00446 b2[i] += (W_BM*(b1[i] + b3[i])+4*b2[i]+W_BO)>>W_BS;
00447 b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
00448 }
00449 i+=i;
00450
00451 __asm__ volatile (
00452 "jmp 2f \n\t"
00453 "1: \n\t"
00454 snow_vertical_compose_sse2_load("%4","xmm0","xmm2","xmm4","xmm6")
00455 snow_vertical_compose_sse2_add("%6","xmm0","xmm2","xmm4","xmm6")
00456
00457
00458 "pcmpeqw %%xmm0, %%xmm0 \n\t"
00459 "pcmpeqw %%xmm2, %%xmm2 \n\t"
00460 "paddw %%xmm2, %%xmm2 \n\t"
00461 "paddw %%xmm0, %%xmm2 \n\t"
00462 "psllw $13, %%xmm2 \n\t"
00463 snow_vertical_compose_r2r_add("xmm0","xmm0","xmm0","xmm0","xmm1","xmm3","xmm5","xmm7")
00464 snow_vertical_compose_r2r_pmulhw("xmm2","xmm2","xmm2","xmm2","xmm1","xmm3","xmm5","xmm7")
00465 snow_vertical_compose_sse2_add("%5","xmm1","xmm3","xmm5","xmm7")
00466 snow_vertical_compose_sse2_store("%5","xmm1","xmm3","xmm5","xmm7")
00467 snow_vertical_compose_sse2_load("%4","xmm0","xmm2","xmm4","xmm6")
00468 snow_vertical_compose_sse2_add("%3","xmm1","xmm3","xmm5","xmm7")
00469 snow_vertical_compose_r2r_sub("xmm1","xmm3","xmm5","xmm7","xmm0","xmm2","xmm4","xmm6")
00470 snow_vertical_compose_sse2_store("%4","xmm0","xmm2","xmm4","xmm6")
00471
00472 "pcmpeqw %%xmm7, %%xmm7 \n\t"
00473 "pcmpeqw %%xmm5, %%xmm5 \n\t"
00474 "psllw $15, %%xmm7 \n\t"
00475 "psrlw $13, %%xmm5 \n\t"
00476 "paddw %%xmm7, %%xmm5 \n\t"
00477 snow_vertical_compose_r2r_add("xmm5","xmm5","xmm5","xmm5","xmm0","xmm2","xmm4","xmm6")
00478 "movq (%2,%%"REG_d"), %%xmm1 \n\t"
00479 "movq 8(%2,%%"REG_d"), %%xmm3 \n\t"
00480 "paddw %%xmm7, %%xmm1 \n\t"
00481 "paddw %%xmm7, %%xmm3 \n\t"
00482 "pavgw %%xmm1, %%xmm0 \n\t"
00483 "pavgw %%xmm3, %%xmm2 \n\t"
00484 "movq 16(%2,%%"REG_d"), %%xmm1 \n\t"
00485 "movq 24(%2,%%"REG_d"), %%xmm3 \n\t"
00486 "paddw %%xmm7, %%xmm1 \n\t"
00487 "paddw %%xmm7, %%xmm3 \n\t"
00488 "pavgw %%xmm1, %%xmm4 \n\t"
00489 "pavgw %%xmm3, %%xmm6 \n\t"
00490 snow_vertical_compose_r2r_sub("xmm7","xmm7","xmm7","xmm7","xmm0","xmm2","xmm4","xmm6")
00491 snow_vertical_compose_sra("1","xmm0","xmm2","xmm4","xmm6")
00492 snow_vertical_compose_sse2_add("%3","xmm0","xmm2","xmm4","xmm6")
00493
00494 snow_vertical_compose_sra("2","xmm0","xmm2","xmm4","xmm6")
00495 snow_vertical_compose_sse2_add("%3","xmm0","xmm2","xmm4","xmm6")
00496 snow_vertical_compose_sse2_store("%3","xmm0","xmm2","xmm4","xmm6")
00497 snow_vertical_compose_sse2_add("%1","xmm0","xmm2","xmm4","xmm6")
00498 snow_vertical_compose_sse2_move("xmm0","xmm2","xmm4","xmm6","xmm1","xmm3","xmm5","xmm7")
00499 snow_vertical_compose_sra("1","xmm0","xmm2","xmm4","xmm6")
00500 snow_vertical_compose_r2r_add("xmm1","xmm3","xmm5","xmm7","xmm0","xmm2","xmm4","xmm6")
00501 snow_vertical_compose_sse2_add("%2","xmm0","xmm2","xmm4","xmm6")
00502 snow_vertical_compose_sse2_store("%2","xmm0","xmm2","xmm4","xmm6")
00503
00504 "2: \n\t"
00505 "sub $64, %%"REG_d" \n\t"
00506 "jge 1b \n\t"
00507 :"+d"(i)
00508 :"r"(b0),"r"(b1),"r"(b2),"r"(b3),"r"(b4),"r"(b5));
00509 }
00510
00511 #define snow_vertical_compose_mmx_load_add(op,r,t0,t1,t2,t3)\
00512 ""op" ("r",%%"REG_d"), %%"t0" \n\t"\
00513 ""op" 8("r",%%"REG_d"), %%"t1" \n\t"\
00514 ""op" 16("r",%%"REG_d"), %%"t2" \n\t"\
00515 ""op" 24("r",%%"REG_d"), %%"t3" \n\t"
00516
00517 #define snow_vertical_compose_mmx_load(r,t0,t1,t2,t3)\
00518 snow_vertical_compose_mmx_load_add("movq",r,t0,t1,t2,t3)
00519
00520 #define snow_vertical_compose_mmx_add(r,t0,t1,t2,t3)\
00521 snow_vertical_compose_mmx_load_add("paddw",r,t0,t1,t2,t3)
00522
00523 #define snow_vertical_compose_mmx_store(w,s0,s1,s2,s3)\
00524 "movq %%"s0", ("w",%%"REG_d") \n\t"\
00525 "movq %%"s1", 8("w",%%"REG_d") \n\t"\
00526 "movq %%"s2", 16("w",%%"REG_d") \n\t"\
00527 "movq %%"s3", 24("w",%%"REG_d") \n\t"
00528
00529 #define snow_vertical_compose_mmx_move(s0,s1,s2,s3,t0,t1,t2,t3)\
00530 "movq %%"s0", %%"t0" \n\t"\
00531 "movq %%"s1", %%"t1" \n\t"\
00532 "movq %%"s2", %%"t2" \n\t"\
00533 "movq %%"s3", %%"t3" \n\t"
00534
00535
00536 void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width){
00537 x86_reg i = width;
00538 while(i & 15)
00539 {
00540 i--;
00541 b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS;
00542 b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS;
00543 b2[i] += (W_BM*(b1[i] + b3[i])+4*b2[i]+W_BO)>>W_BS;
00544 b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
00545 }
00546 i+=i;
00547 __asm__ volatile(
00548 "jmp 2f \n\t"
00549 "1: \n\t"
00550
00551 snow_vertical_compose_mmx_load("%4","mm1","mm3","mm5","mm7")
00552 snow_vertical_compose_mmx_add("%6","mm1","mm3","mm5","mm7")
00553 "pcmpeqw %%mm0, %%mm0 \n\t"
00554 "pcmpeqw %%mm2, %%mm2 \n\t"
00555 "paddw %%mm2, %%mm2 \n\t"
00556 "paddw %%mm0, %%mm2 \n\t"
00557 "psllw $13, %%mm2 \n\t"
00558 snow_vertical_compose_r2r_add("mm0","mm0","mm0","mm0","mm1","mm3","mm5","mm7")
00559 snow_vertical_compose_r2r_pmulhw("mm2","mm2","mm2","mm2","mm1","mm3","mm5","mm7")
00560 snow_vertical_compose_mmx_add("%5","mm1","mm3","mm5","mm7")
00561 snow_vertical_compose_mmx_store("%5","mm1","mm3","mm5","mm7")
00562 snow_vertical_compose_mmx_load("%4","mm0","mm2","mm4","mm6")
00563 snow_vertical_compose_mmx_add("%3","mm1","mm3","mm5","mm7")
00564 snow_vertical_compose_r2r_sub("mm1","mm3","mm5","mm7","mm0","mm2","mm4","mm6")
00565 snow_vertical_compose_mmx_store("%4","mm0","mm2","mm4","mm6")
00566 "pcmpeqw %%mm7, %%mm7 \n\t"
00567 "pcmpeqw %%mm5, %%mm5 \n\t"
00568 "psllw $15, %%mm7 \n\t"
00569 "psrlw $13, %%mm5 \n\t"
00570 "paddw %%mm7, %%mm5 \n\t"
00571 snow_vertical_compose_r2r_add("mm5","mm5","mm5","mm5","mm0","mm2","mm4","mm6")
00572 "movq (%2,%%"REG_d"), %%mm1 \n\t"
00573 "movq 8(%2,%%"REG_d"), %%mm3 \n\t"
00574 "paddw %%mm7, %%mm1 \n\t"
00575 "paddw %%mm7, %%mm3 \n\t"
00576 "pavgw %%mm1, %%mm0 \n\t"
00577 "pavgw %%mm3, %%mm2 \n\t"
00578 "movq 16(%2,%%"REG_d"), %%mm1 \n\t"
00579 "movq 24(%2,%%"REG_d"), %%mm3 \n\t"
00580 "paddw %%mm7, %%mm1 \n\t"
00581 "paddw %%mm7, %%mm3 \n\t"
00582 "pavgw %%mm1, %%mm4 \n\t"
00583 "pavgw %%mm3, %%mm6 \n\t"
00584 snow_vertical_compose_r2r_sub("mm7","mm7","mm7","mm7","mm0","mm2","mm4","mm6")
00585 snow_vertical_compose_sra("1","mm0","mm2","mm4","mm6")
00586 snow_vertical_compose_mmx_add("%3","mm0","mm2","mm4","mm6")
00587
00588 snow_vertical_compose_sra("2","mm0","mm2","mm4","mm6")
00589 snow_vertical_compose_mmx_add("%3","mm0","mm2","mm4","mm6")
00590 snow_vertical_compose_mmx_store("%3","mm0","mm2","mm4","mm6")
00591 snow_vertical_compose_mmx_add("%1","mm0","mm2","mm4","mm6")
00592 snow_vertical_compose_mmx_move("mm0","mm2","mm4","mm6","mm1","mm3","mm5","mm7")
00593 snow_vertical_compose_sra("1","mm0","mm2","mm4","mm6")
00594 snow_vertical_compose_r2r_add("mm1","mm3","mm5","mm7","mm0","mm2","mm4","mm6")
00595 snow_vertical_compose_mmx_add("%2","mm0","mm2","mm4","mm6")
00596 snow_vertical_compose_mmx_store("%2","mm0","mm2","mm4","mm6")
00597
00598 "2: \n\t"
00599 "sub $32, %%"REG_d" \n\t"
00600 "jge 1b \n\t"
00601 :"+d"(i)
00602 :"r"(b0),"r"(b1),"r"(b2),"r"(b3),"r"(b4),"r"(b5));
00603 }
00604 #endif //HAVE_7REGS
00605
00606 #define snow_inner_add_yblock_sse2_header \
00607 IDWTELEM * * dst_array = sb->line + src_y;\
00608 x86_reg tmp;\
00609 __asm__ volatile(\
00610 "mov %7, %%"REG_c" \n\t"\
00611 "mov %6, %2 \n\t"\
00612 "mov %4, %%"REG_S" \n\t"\
00613 "pxor %%xmm7, %%xmm7 \n\t" \
00614 "pcmpeqd %%xmm3, %%xmm3 \n\t"\
00615 "psllw $15, %%xmm3 \n\t"\
00616 "psrlw $12, %%xmm3 \n\t" \
00617 "1: \n\t"\
00618 "mov %1, %%"REG_D" \n\t"\
00619 "mov (%%"REG_D"), %%"REG_D" \n\t"\
00620 "add %3, %%"REG_D" \n\t"
00621
00622 #define snow_inner_add_yblock_sse2_start_8(out_reg1, out_reg2, ptr_offset, s_offset)\
00623 "mov "PTR_SIZE"*"ptr_offset"(%%"REG_a"), %%"REG_d"; \n\t"\
00624 "movq (%%"REG_d"), %%"out_reg1" \n\t"\
00625 "movq (%%"REG_d", %%"REG_c"), %%"out_reg2" \n\t"\
00626 "punpcklbw %%xmm7, %%"out_reg1" \n\t"\
00627 "punpcklbw %%xmm7, %%"out_reg2" \n\t"\
00628 "movq "s_offset"(%%"REG_S"), %%xmm0 \n\t"\
00629 "movq "s_offset"+16(%%"REG_S"), %%xmm4 \n\t"\
00630 "punpcklbw %%xmm7, %%xmm0 \n\t"\
00631 "punpcklbw %%xmm7, %%xmm4 \n\t"\
00632 "pmullw %%xmm0, %%"out_reg1" \n\t"\
00633 "pmullw %%xmm4, %%"out_reg2" \n\t"
00634
00635 #define snow_inner_add_yblock_sse2_start_16(out_reg1, out_reg2, ptr_offset, s_offset)\
00636 "mov "PTR_SIZE"*"ptr_offset"(%%"REG_a"), %%"REG_d"; \n\t"\
00637 "movq (%%"REG_d"), %%"out_reg1" \n\t"\
00638 "movq 8(%%"REG_d"), %%"out_reg2" \n\t"\
00639 "punpcklbw %%xmm7, %%"out_reg1" \n\t"\
00640 "punpcklbw %%xmm7, %%"out_reg2" \n\t"\
00641 "movq "s_offset"(%%"REG_S"), %%xmm0 \n\t"\
00642 "movq "s_offset"+8(%%"REG_S"), %%xmm4 \n\t"\
00643 "punpcklbw %%xmm7, %%xmm0 \n\t"\
00644 "punpcklbw %%xmm7, %%xmm4 \n\t"\
00645 "pmullw %%xmm0, %%"out_reg1" \n\t"\
00646 "pmullw %%xmm4, %%"out_reg2" \n\t"
00647
00648 #define snow_inner_add_yblock_sse2_accum_8(ptr_offset, s_offset) \
00649 snow_inner_add_yblock_sse2_start_8("xmm2", "xmm6", ptr_offset, s_offset)\
00650 "paddusw %%xmm2, %%xmm1 \n\t"\
00651 "paddusw %%xmm6, %%xmm5 \n\t"
00652
00653 #define snow_inner_add_yblock_sse2_accum_16(ptr_offset, s_offset) \
00654 snow_inner_add_yblock_sse2_start_16("xmm2", "xmm6", ptr_offset, s_offset)\
00655 "paddusw %%xmm2, %%xmm1 \n\t"\
00656 "paddusw %%xmm6, %%xmm5 \n\t"
00657
00658 #define snow_inner_add_yblock_sse2_end_common1\
00659 "add $32, %%"REG_S" \n\t"\
00660 "add %%"REG_c", %0 \n\t"\
00661 "add %%"REG_c", "PTR_SIZE"*3(%%"REG_a");\n\t"\
00662 "add %%"REG_c", "PTR_SIZE"*2(%%"REG_a");\n\t"\
00663 "add %%"REG_c", "PTR_SIZE"*1(%%"REG_a");\n\t"\
00664 "add %%"REG_c", (%%"REG_a") \n\t"
00665
00666 #define snow_inner_add_yblock_sse2_end_common2\
00667 "jnz 1b \n\t"\
00668 :"+m"(dst8),"+m"(dst_array),"=&r"(tmp)\
00669 :\
00670 "rm"((x86_reg)(src_x<<1)),"m"(obmc),"a"(block),"m"((x86_reg)b_h),"m"((x86_reg)src_stride):\
00671 "%"REG_c"","%"REG_S"","%"REG_D"","%"REG_d"");
00672
00673 #define snow_inner_add_yblock_sse2_end_8\
00674 "sal $1, %%"REG_c" \n\t"\
00675 "add $"PTR_SIZE"*2, %1 \n\t"\
00676 snow_inner_add_yblock_sse2_end_common1\
00677 "sar $1, %%"REG_c" \n\t"\
00678 "sub $2, %2 \n\t"\
00679 snow_inner_add_yblock_sse2_end_common2
00680
00681 #define snow_inner_add_yblock_sse2_end_16\
00682 "add $"PTR_SIZE"*1, %1 \n\t"\
00683 snow_inner_add_yblock_sse2_end_common1\
00684 "dec %2 \n\t"\
00685 snow_inner_add_yblock_sse2_end_common2
00686
00687 static void inner_add_yblock_bw_8_obmc_16_bh_even_sse2(const uint8_t *obmc, const x86_reg obmc_stride, uint8_t * * block, int b_w, x86_reg b_h,
00688 int src_x, int src_y, x86_reg src_stride, slice_buffer * sb, int add, uint8_t * dst8){
00689 snow_inner_add_yblock_sse2_header
00690 snow_inner_add_yblock_sse2_start_8("xmm1", "xmm5", "3", "0")
00691 snow_inner_add_yblock_sse2_accum_8("2", "8")
00692 snow_inner_add_yblock_sse2_accum_8("1", "128")
00693 snow_inner_add_yblock_sse2_accum_8("0", "136")
00694
00695 "mov %0, %%"REG_d" \n\t"
00696 "movdqa (%%"REG_D"), %%xmm0 \n\t"
00697 "movdqa %%xmm1, %%xmm2 \n\t"
00698
00699 "punpckhwd %%xmm7, %%xmm1 \n\t"
00700 "punpcklwd %%xmm7, %%xmm2 \n\t"
00701 "paddd %%xmm2, %%xmm0 \n\t"
00702 "movdqa 16(%%"REG_D"), %%xmm2 \n\t"
00703 "paddd %%xmm1, %%xmm2 \n\t"
00704 "paddd %%xmm3, %%xmm0 \n\t"
00705 "paddd %%xmm3, %%xmm2 \n\t"
00706
00707 "mov %1, %%"REG_D" \n\t"
00708 "mov "PTR_SIZE"(%%"REG_D"), %%"REG_D";\n\t"
00709 "add %3, %%"REG_D" \n\t"
00710
00711 "movdqa (%%"REG_D"), %%xmm4 \n\t"
00712 "movdqa %%xmm5, %%xmm6 \n\t"
00713 "punpckhwd %%xmm7, %%xmm5 \n\t"
00714 "punpcklwd %%xmm7, %%xmm6 \n\t"
00715 "paddd %%xmm6, %%xmm4 \n\t"
00716 "movdqa 16(%%"REG_D"), %%xmm6 \n\t"
00717 "paddd %%xmm5, %%xmm6 \n\t"
00718 "paddd %%xmm3, %%xmm4 \n\t"
00719 "paddd %%xmm3, %%xmm6 \n\t"
00720
00721 "psrad $8, %%xmm0 \n\t"
00722 "psrad $8, %%xmm2 \n\t"
00723 "packssdw %%xmm2, %%xmm0 \n\t"
00724 "packuswb %%xmm7, %%xmm0 \n\t"
00725 "movq %%xmm0, (%%"REG_d") \n\t"
00726
00727 "psrad $8, %%xmm4 \n\t"
00728 "psrad $8, %%xmm6 \n\t"
00729 "packssdw %%xmm6, %%xmm4 \n\t"
00730 "packuswb %%xmm7, %%xmm4 \n\t"
00731 "movq %%xmm4, (%%"REG_d",%%"REG_c");\n\t"
00732 snow_inner_add_yblock_sse2_end_8
00733 }
00734
00735 static void inner_add_yblock_bw_16_obmc_32_sse2(const uint8_t *obmc, const x86_reg obmc_stride, uint8_t * * block, int b_w, x86_reg b_h,
00736 int src_x, int src_y, x86_reg src_stride, slice_buffer * sb, int add, uint8_t * dst8){
00737 snow_inner_add_yblock_sse2_header
00738 snow_inner_add_yblock_sse2_start_16("xmm1", "xmm5", "3", "0")
00739 snow_inner_add_yblock_sse2_accum_16("2", "16")
00740 snow_inner_add_yblock_sse2_accum_16("1", "512")
00741 snow_inner_add_yblock_sse2_accum_16("0", "528")
00742
00743 "mov %0, %%"REG_d" \n\t"
00744 "psrlw $4, %%xmm1 \n\t"
00745 "psrlw $4, %%xmm5 \n\t"
00746 "paddw (%%"REG_D"), %%xmm1 \n\t"
00747 "paddw 16(%%"REG_D"), %%xmm5 \n\t"
00748 "paddw %%xmm3, %%xmm1 \n\t"
00749 "paddw %%xmm3, %%xmm5 \n\t"
00750 "psraw $4, %%xmm1 \n\t"
00751 "psraw $4, %%xmm5 \n\t"
00752 "packuswb %%xmm5, %%xmm1 \n\t"
00753
00754 "movdqu %%xmm1, (%%"REG_d") \n\t"
00755
00756 snow_inner_add_yblock_sse2_end_16
00757 }
00758
00759 #define snow_inner_add_yblock_mmx_header \
00760 IDWTELEM * * dst_array = sb->line + src_y;\
00761 x86_reg tmp;\
00762 __asm__ volatile(\
00763 "mov %7, %%"REG_c" \n\t"\
00764 "mov %6, %2 \n\t"\
00765 "mov %4, %%"REG_S" \n\t"\
00766 "pxor %%mm7, %%mm7 \n\t" \
00767 "pcmpeqd %%mm3, %%mm3 \n\t"\
00768 "psllw $15, %%mm3 \n\t"\
00769 "psrlw $12, %%mm3 \n\t" \
00770 "1: \n\t"\
00771 "mov %1, %%"REG_D" \n\t"\
00772 "mov (%%"REG_D"), %%"REG_D" \n\t"\
00773 "add %3, %%"REG_D" \n\t"
00774
00775 #define snow_inner_add_yblock_mmx_start(out_reg1, out_reg2, ptr_offset, s_offset, d_offset)\
00776 "mov "PTR_SIZE"*"ptr_offset"(%%"REG_a"), %%"REG_d"; \n\t"\
00777 "movd "d_offset"(%%"REG_d"), %%"out_reg1" \n\t"\
00778 "movd "d_offset"+4(%%"REG_d"), %%"out_reg2" \n\t"\
00779 "punpcklbw %%mm7, %%"out_reg1" \n\t"\
00780 "punpcklbw %%mm7, %%"out_reg2" \n\t"\
00781 "movd "s_offset"(%%"REG_S"), %%mm0 \n\t"\
00782 "movd "s_offset"+4(%%"REG_S"), %%mm4 \n\t"\
00783 "punpcklbw %%mm7, %%mm0 \n\t"\
00784 "punpcklbw %%mm7, %%mm4 \n\t"\
00785 "pmullw %%mm0, %%"out_reg1" \n\t"\
00786 "pmullw %%mm4, %%"out_reg2" \n\t"
00787
00788 #define snow_inner_add_yblock_mmx_accum(ptr_offset, s_offset, d_offset) \
00789 snow_inner_add_yblock_mmx_start("mm2", "mm6", ptr_offset, s_offset, d_offset)\
00790 "paddusw %%mm2, %%mm1 \n\t"\
00791 "paddusw %%mm6, %%mm5 \n\t"
00792
00793 #define snow_inner_add_yblock_mmx_mix(read_offset, write_offset)\
00794 "mov %0, %%"REG_d" \n\t"\
00795 "psrlw $4, %%mm1 \n\t"\
00796 "psrlw $4, %%mm5 \n\t"\
00797 "paddw "read_offset"(%%"REG_D"), %%mm1 \n\t"\
00798 "paddw "read_offset"+8(%%"REG_D"), %%mm5 \n\t"\
00799 "paddw %%mm3, %%mm1 \n\t"\
00800 "paddw %%mm3, %%mm5 \n\t"\
00801 "psraw $4, %%mm1 \n\t"\
00802 "psraw $4, %%mm5 \n\t"\
00803 "packuswb %%mm5, %%mm1 \n\t"\
00804 "movq %%mm1, "write_offset"(%%"REG_d") \n\t"
00805
00806 #define snow_inner_add_yblock_mmx_end(s_step)\
00807 "add $"s_step", %%"REG_S" \n\t"\
00808 "add %%"REG_c", "PTR_SIZE"*3(%%"REG_a");\n\t"\
00809 "add %%"REG_c", "PTR_SIZE"*2(%%"REG_a");\n\t"\
00810 "add %%"REG_c", "PTR_SIZE"*1(%%"REG_a");\n\t"\
00811 "add %%"REG_c", (%%"REG_a") \n\t"\
00812 "add $"PTR_SIZE"*1, %1 \n\t"\
00813 "add %%"REG_c", %0 \n\t"\
00814 "dec %2 \n\t"\
00815 "jnz 1b \n\t"\
00816 :"+m"(dst8),"+m"(dst_array),"=&r"(tmp)\
00817 :\
00818 "rm"((x86_reg)(src_x<<1)),"m"(obmc),"a"(block),"m"((x86_reg)b_h),"m"((x86_reg)src_stride):\
00819 "%"REG_c"","%"REG_S"","%"REG_D"","%"REG_d"");
00820
00821 static void inner_add_yblock_bw_8_obmc_16_mmx(const uint8_t *obmc, const x86_reg obmc_stride, uint8_t * * block, int b_w, x86_reg b_h,
00822 int src_x, int src_y, x86_reg src_stride, slice_buffer * sb, int add, uint8_t * dst8){
00823 snow_inner_add_yblock_mmx_header
00824 snow_inner_add_yblock_mmx_start("mm1", "mm5", "3", "0", "0")
00825 snow_inner_add_yblock_mmx_accum("2", "8", "0")
00826 snow_inner_add_yblock_mmx_accum("1", "128", "0")
00827 snow_inner_add_yblock_mmx_accum("0", "136", "0")
00828 snow_inner_add_yblock_mmx_mix("0", "0")
00829 snow_inner_add_yblock_mmx_end("16")
00830 }
00831
00832 static void inner_add_yblock_bw_16_obmc_32_mmx(const uint8_t *obmc, const x86_reg obmc_stride, uint8_t * * block, int b_w, x86_reg b_h,
00833 int src_x, int src_y, x86_reg src_stride, slice_buffer * sb, int add, uint8_t * dst8){
00834 snow_inner_add_yblock_mmx_header
00835 snow_inner_add_yblock_mmx_start("mm1", "mm5", "3", "0", "0")
00836 snow_inner_add_yblock_mmx_accum("2", "16", "0")
00837 snow_inner_add_yblock_mmx_accum("1", "512", "0")
00838 snow_inner_add_yblock_mmx_accum("0", "528", "0")
00839 snow_inner_add_yblock_mmx_mix("0", "0")
00840
00841 snow_inner_add_yblock_mmx_start("mm1", "mm5", "3", "8", "8")
00842 snow_inner_add_yblock_mmx_accum("2", "24", "8")
00843 snow_inner_add_yblock_mmx_accum("1", "520", "8")
00844 snow_inner_add_yblock_mmx_accum("0", "536", "8")
00845 snow_inner_add_yblock_mmx_mix("16", "8")
00846 snow_inner_add_yblock_mmx_end("32")
00847 }
00848
00849 void ff_snow_inner_add_yblock_sse2(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h,
00850 int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8){
00851
00852 if (b_w == 16)
00853 inner_add_yblock_bw_16_obmc_32_sse2(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
00854 else if (b_w == 8 && obmc_stride == 16) {
00855 if (!(b_h & 1))
00856 inner_add_yblock_bw_8_obmc_16_bh_even_sse2(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
00857 else
00858 inner_add_yblock_bw_8_obmc_16_mmx(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
00859 } else
00860 ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
00861 }
00862
00863 void ff_snow_inner_add_yblock_mmx(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h,
00864 int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8){
00865 if (b_w == 16)
00866 inner_add_yblock_bw_16_obmc_32_mmx(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
00867 else if (b_w == 8 && obmc_stride == 16)
00868 inner_add_yblock_bw_8_obmc_16_mmx(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
00869 else
00870 ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
00871 }