diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-10-20 21:34:02 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-10-20 21:34:02 +0000 |
commit | e08f5806444afec09b169f49b0e3bc1eb94da880 (patch) | |
tree | 5a57f8e2f98d6709f036b0458dd74eadb1ff6a29 /libavcodec/cabac.h | |
parent | 94e4c3a333c50170c6645bc5ea43578270249644 (diff) | |
download | ffmpeg-e08f5806444afec09b169f49b0e3bc1eb94da880.tar.gz |
decode_significance_8x8_x86()
8% faster decode_cabac_residual() (8x8 case only) on P3
Originally committed as revision 6750 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cabac.h')
-rw-r--r-- | libavcodec/cabac.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index ff3e06ae10..d47252eb90 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -721,6 +721,62 @@ static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *sign ); return coeff_count; } + +static int decode_significance_8x8_x86(CABACContext *c, uint8_t *significant_coeff_ctx_base, int *index, uint8_t *sig_off){ + int minusindex= 4-(int)index; + int coeff_count; + int last=0; + asm volatile( + "movl "RANGE "(%3), %%esi \n\t" + "movl "LOW "(%3), %%ebx \n\t" + + "mov %1, %%edi \n\t" + "2: \n\t" + + "mov %6, %%eax \n\t" + "movzbl (%%eax, %%edi), %%edi \n\t" + "add %5, %%edi \n\t" + + BRANCHLESS_GET_CABAC("%%edx", "%3", "(%%edi)", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al") + + "mov %1, %%edi \n\t" + "test $1, %%edx \n\t" + " jz 3f \n\t" + + "movzbl "MANGLE(last_coeff_flag_offset_8x8)"(%%edi), %%edi\n\t" + "add %5, %%edi \n\t" + + BRANCHLESS_GET_CABAC("%%edx", "%3", "15(%%edi)", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al") + + "movl %2, %%eax \n\t" + "mov %1, %%edi \n\t" + "movl %%edi, (%%eax) \n\t" + + "test $1, %%edx \n\t" + " jnz 4f \n\t" + + "addl $4, %%eax \n\t" + "movl %%eax, %2 \n\t" + + "3: \n\t" + "addl $1, %%edi \n\t" + "mov %%edi, %1 \n\t" + "cmpl $63, %%edi \n\t" + " jb 2b \n\t" + "movl %2, %%eax \n\t" + "movl %%edi, (%%eax) \n\t" + "4: \n\t" + "addl %4, %%eax \n\t" + "shr $2, %%eax \n\t" + + "movl %%esi, "RANGE "(%3) \n\t" + "movl %%ebx, "LOW "(%3) \n\t" + :"=&a"(coeff_count),"+m"(last), "+m"(index)\ + :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off)\ + : "%ecx", "%ebx", "%edx", "%esi", "%edi", "memory"\ + ); + return coeff_count; +} #endif /** |