comparison cabac.h @ 3950:900d21b85dd6 libavcodec

renorm_cabac_decoder_once START/STOP_TIMER scores for athlon
author michael
date Sat, 07 Oct 2006 22:34:32 +0000
parents 3edbf131ee44
children 751bfc30df72
comparison
equal deleted inserted replaced
3949:6020c2f3b16b 3950:900d21b85dd6
298 298
299 static inline void renorm_cabac_decoder_once(CABACContext *c){ 299 static inline void renorm_cabac_decoder_once(CABACContext *c){
300 #ifdef ARCH_X86 300 #ifdef ARCH_X86
301 int temp; 301 int temp;
302 #if 0 302 #if 0
303 //P3:683 303 //P3:683 athlon:475
304 asm( 304 asm(
305 "lea -0x2000000(%0), %2 \n\t" 305 "lea -0x2000000(%0), %2 \n\t"
306 "shr $31, %2 \n\t" //FIXME 31->63 for x86-64 306 "shr $31, %2 \n\t" //FIXME 31->63 for x86-64
307 "shl %%cl, %0 \n\t" 307 "shl %%cl, %0 \n\t"
308 "shl %%cl, %1 \n\t" 308 "shl %%cl, %1 \n\t"
309 : "+r"(c->range), "+r"(c->low), "+c"(temp) 309 : "+r"(c->range), "+r"(c->low), "+c"(temp)
310 ); 310 );
311 #elif 0 311 #elif 0
312 //P3:680 312 //P3:680 athlon:474
313 asm( 313 asm(
314 "cmp $0x2000000, %0 \n\t" 314 "cmp $0x2000000, %0 \n\t"
315 "setb %%cl \n\t" //FIXME 31->63 for x86-64 315 "setb %%cl \n\t" //FIXME 31->63 for x86-64
316 "shl %%cl, %0 \n\t" 316 "shl %%cl, %0 \n\t"
317 "shl %%cl, %1 \n\t" 317 "shl %%cl, %1 \n\t"
318 : "+r"(c->range), "+r"(c->low), "+c"(temp) 318 : "+r"(c->range), "+r"(c->low), "+c"(temp)
319 ); 319 );
320 #elif 1 320 #elif 1
321 int temp2; 321 int temp2;
322 //P3:665 322 //P3:665 athlon:517
323 asm( 323 asm(
324 "lea -0x2000000(%0), %%eax \n\t" 324 "lea -0x2000000(%0), %%eax \n\t"
325 "cdq \n\t" 325 "cdq \n\t"
326 "mov %0, %%eax \n\t" 326 "mov %0, %%eax \n\t"
327 "and %%edx, %0 \n\t" 327 "and %%edx, %0 \n\t"
330 "add %%edx, %1 \n\t" 330 "add %%edx, %1 \n\t"
331 : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2) 331 : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2)
332 ); 332 );
333 #elif 0 333 #elif 0
334 int temp2; 334 int temp2;
335 //P3:673 335 //P3:673 athlon:509
336 asm( 336 asm(
337 "cmp $0x2000000, %0 \n\t" 337 "cmp $0x2000000, %0 \n\t"
338 "sbb %%edx, %%edx \n\t" 338 "sbb %%edx, %%edx \n\t"
339 "mov %0, %%eax \n\t" 339 "mov %0, %%eax \n\t"
340 "and %%edx, %0 \n\t" 340 "and %%edx, %0 \n\t"
343 "add %%edx, %1 \n\t" 343 "add %%edx, %1 \n\t"
344 : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2) 344 : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2)
345 ); 345 );
346 #else 346 #else
347 int temp2; 347 int temp2;
348 //P3:677 348 //P3:677 athlon:511
349 asm( 349 asm(
350 "cmp $0x2000000, %0 \n\t" 350 "cmp $0x2000000, %0 \n\t"
351 "lea (%0, %0), %%eax \n\t" 351 "lea (%0, %0), %%eax \n\t"
352 "lea (%1, %1), %%edx \n\t" 352 "lea (%1, %1), %%edx \n\t"
353 "cmovb %%eax, %0 \n\t" 353 "cmovb %%eax, %0 \n\t"
354 "cmovb %%edx, %1 \n\t" 354 "cmovb %%edx, %1 \n\t"
355 : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2) 355 : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2)
356 ); 356 );
357 #endif 357 #endif
358 #else 358 #else
359 //P3:675 359 //P3:675 athlon:476
360 int shift= (uint32_t)(c->range - (0x200 << CABAC_BITS))>>31; 360 int shift= (uint32_t)(c->range - (0x200 << CABAC_BITS))>>31;
361 c->range<<= shift; 361 c->range<<= shift;
362 c->low <<= shift; 362 c->low <<= shift;
363 #endif 363 #endif
364 if(!(c->low & CABAC_MASK)) 364 if(!(c->low & CABAC_MASK))