comparison cabac.h @ 5547:81226e690378 libavcodec

CONFIG_7REGS -> HAVE_7REGS
author ramiro
date Wed, 15 Aug 2007 21:19:13 +0000
parents 20bea6a9950c
children 9ad4e94cc5b8
comparison
equal deleted inserted replaced
5546:e12027d324cc 5547:81226e690378
377 #else 377 #else
378 #define BYTESTART "12" 378 #define BYTESTART "12"
379 #define BYTE "16" 379 #define BYTE "16"
380 #define BYTEEND "20" 380 #define BYTEEND "20"
381 #endif 381 #endif
382 #if defined(ARCH_X86) && defined(CONFIG_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) 382 #if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS)
383 int bit; 383 int bit;
384 384
385 #ifndef BRANCHLESS_CABAC_DECODER 385 #ifndef BRANCHLESS_CABAC_DECODER
386 asm volatile( 386 asm volatile(
387 "movzbl (%1), %0 \n\t" 387 "movzbl (%1), %0 \n\t"
533 :"r"(state), "r"(c) 533 :"r"(state), "r"(c)
534 : "%"REG_c, "%ebx", "%edx", "%esi", "memory" 534 : "%"REG_c, "%ebx", "%edx", "%esi", "memory"
535 ); 535 );
536 bit&=1; 536 bit&=1;
537 #endif /* BRANCHLESS_CABAC_DECODER */ 537 #endif /* BRANCHLESS_CABAC_DECODER */
538 #else /* defined(ARCH_X86) && defined(CONFIG_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ 538 #else /* defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */
539 int s = *state; 539 int s = *state;
540 int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s]; 540 int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s];
541 int bit, lps_mask av_unused; 541 int bit, lps_mask av_unused;
542 542
543 c->range -= RangeLPS; 543 c->range -= RangeLPS;
572 c->range<<= lps_mask; 572 c->range<<= lps_mask;
573 c->low <<= lps_mask; 573 c->low <<= lps_mask;
574 if(!(c->low & CABAC_MASK)) 574 if(!(c->low & CABAC_MASK))
575 refill2(c); 575 refill2(c);
576 #endif /* BRANCHLESS_CABAC_DECODER */ 576 #endif /* BRANCHLESS_CABAC_DECODER */
577 #endif /* defined(ARCH_X86) && defined(CONFIG_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ 577 #endif /* defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */
578 return bit; 578 return bit;
579 } 579 }
580 580
581 static int av_noinline get_cabac_noinline(CABACContext *c, uint8_t * const state){ 581 static int av_noinline get_cabac_noinline(CABACContext *c, uint8_t * const state){
582 return get_cabac_inline(c,state); 582 return get_cabac_inline(c,state);
681 #endif 681 #endif
682 } 682 }
683 683
684 //FIXME the x86 code from this file should be moved into i386/h264 or cabac something.c/h (note ill kill you if you move my code away from under my fingers before iam finished with it!) 684 //FIXME the x86 code from this file should be moved into i386/h264 or cabac something.c/h (note ill kill you if you move my code away from under my fingers before iam finished with it!)
685 //FIXME use some macros to avoid duplicatin get_cabac (cannot be done yet as that would make optimization work hard) 685 //FIXME use some macros to avoid duplicatin get_cabac (cannot be done yet as that would make optimization work hard)
686 #if defined(ARCH_X86) && defined(CONFIG_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) 686 #if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS)
687 static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){ 687 static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){
688 void *end= significant_coeff_ctx_base + max_coeff - 1; 688 void *end= significant_coeff_ctx_base + max_coeff - 1;
689 int minusstart= -(int)significant_coeff_ctx_base; 689 int minusstart= -(int)significant_coeff_ctx_base;
690 int minusindex= 4-(int)index; 690 int minusindex= 4-(int)index;
691 int coeff_count; 691 int coeff_count;
787 :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off)\ 787 :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off)\
788 : "%"REG_c, "%ebx", "%edx", "%esi", "%"REG_D, "memory"\ 788 : "%"REG_c, "%ebx", "%edx", "%esi", "%"REG_D, "memory"\
789 ); 789 );
790 return coeff_count; 790 return coeff_count;
791 } 791 }
792 #endif /* defined(ARCH_X86) && && defined(CONFIG_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ 792 #endif /* defined(ARCH_X86) && && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */
793 793
794 /** 794 /**
795 * 795 *
796 * @return the number of bytes read or 0 if no end 796 * @return the number of bytes read or 0 if no end
797 */ 797 */