Mercurial > libavcodec.hg
comparison i386/h264_i386.h @ 6617:e3a1ff3099d6 libavcodec
Cosmetics:
Break long lines.
Correct spelling in comment (duplicatin -> duplicating)
author | heydowns |
---|---|
date | Wed, 16 Apr 2008 20:43:37 +0000 |
parents | e226f34ca284 |
children | 33896780c612 |
comparison
equal
deleted
inserted
replaced
6616:ee769fedd9ec | 6617:e3a1ff3099d6 |
---|---|
30 #define FFMPEG_H264_I386_H | 30 #define FFMPEG_H264_I386_H |
31 | 31 |
32 | 32 |
33 #include "cabac.h" | 33 #include "cabac.h" |
34 | 34 |
35 //FIXME use some macros to avoid duplicatin get_cabac (cannot be done yet as that would make optimization work hard) | 35 //FIXME use some macros to avoid duplicating get_cabac (cannot be done yet |
36 #if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) | 36 //as that would make optimization work hard) |
37 static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){ | 37 #if defined(ARCH_X86) && defined(HAVE_7REGS) && \ |
38 defined(HAVE_EBX_AVAILABLE) && \ | |
39 !defined(BROKEN_RELOCATIONS) | |
40 static int decode_significance_x86(CABACContext *c, int max_coeff, | |
41 uint8_t *significant_coeff_ctx_base, | |
42 int *index){ | |
38 void *end= significant_coeff_ctx_base + max_coeff - 1; | 43 void *end= significant_coeff_ctx_base + max_coeff - 1; |
39 int minusstart= -(int)significant_coeff_ctx_base; | 44 int minusstart= -(int)significant_coeff_ctx_base; |
40 int minusindex= 4-(int)index; | 45 int minusindex= 4-(int)index; |
41 int coeff_count; | 46 int coeff_count; |
42 asm volatile( | 47 asm volatile( |
43 "movl "RANGE "(%3), %%esi \n\t" | 48 "movl "RANGE "(%3), %%esi \n\t" |
44 "movl "LOW "(%3), %%ebx \n\t" | 49 "movl "LOW "(%3), %%ebx \n\t" |
45 | 50 |
46 "2: \n\t" | 51 "2: \n\t" |
47 | 52 |
48 BRANCHLESS_GET_CABAC("%%edx", "%3", "(%1)", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al") | 53 BRANCHLESS_GET_CABAC("%%edx", "%3", "(%1)", "%%ebx", |
54 "%%bx", "%%esi", "%%eax", "%%al") | |
49 | 55 |
50 "test $1, %%edx \n\t" | 56 "test $1, %%edx \n\t" |
51 " jz 3f \n\t" | 57 " jz 3f \n\t" |
52 | 58 |
53 BRANCHLESS_GET_CABAC("%%edx", "%3", "61(%1)", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al") | 59 BRANCHLESS_GET_CABAC("%%edx", "%3", "61(%1)", "%%ebx", |
60 "%%bx", "%%esi", "%%eax", "%%al") | |
54 | 61 |
55 "mov %2, %%"REG_a" \n\t" | 62 "mov %2, %%"REG_a" \n\t" |
56 "movl %4, %%ecx \n\t" | 63 "movl %4, %%ecx \n\t" |
57 "add %1, %%"REG_c" \n\t" | 64 "add %1, %%"REG_c" \n\t" |
58 "movl %%ecx, (%%"REG_a") \n\t" | 65 "movl %%ecx, (%%"REG_a") \n\t" |
82 : "%"REG_c, "%ebx", "%edx", "%esi", "memory" | 89 : "%"REG_c, "%ebx", "%edx", "%esi", "memory" |
83 ); | 90 ); |
84 return coeff_count; | 91 return coeff_count; |
85 } | 92 } |
86 | 93 |
87 static int decode_significance_8x8_x86(CABACContext *c, uint8_t *significant_coeff_ctx_base, int *index, const uint8_t *sig_off){ | 94 static int decode_significance_8x8_x86(CABACContext *c, |
95 uint8_t *significant_coeff_ctx_base, | |
96 int *index, const uint8_t *sig_off){ | |
88 int minusindex= 4-(int)index; | 97 int minusindex= 4-(int)index; |
89 int coeff_count; | 98 int coeff_count; |
90 long last=0; | 99 long last=0; |
91 asm volatile( | 100 asm volatile( |
92 "movl "RANGE "(%3), %%esi \n\t" | 101 "movl "RANGE "(%3), %%esi \n\t" |
97 | 106 |
98 "mov %6, %%"REG_a" \n\t" | 107 "mov %6, %%"REG_a" \n\t" |
99 "movzbl (%%"REG_a", %%"REG_D"), %%edi \n\t" | 108 "movzbl (%%"REG_a", %%"REG_D"), %%edi \n\t" |
100 "add %5, %%"REG_D" \n\t" | 109 "add %5, %%"REG_D" \n\t" |
101 | 110 |
102 BRANCHLESS_GET_CABAC("%%edx", "%3", "(%%"REG_D")", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al") | 111 BRANCHLESS_GET_CABAC("%%edx", "%3", "(%%"REG_D")", "%%ebx", |
112 "%%bx", "%%esi", "%%eax", "%%al") | |
103 | 113 |
104 "mov %1, %%edi \n\t" | 114 "mov %1, %%edi \n\t" |
105 "test $1, %%edx \n\t" | 115 "test $1, %%edx \n\t" |
106 " jz 3f \n\t" | 116 " jz 3f \n\t" |
107 | 117 |
108 "movzbl "MANGLE(last_coeff_flag_offset_8x8)"(%%edi), %%edi\n\t" | 118 "movzbl "MANGLE(last_coeff_flag_offset_8x8)"(%%edi), %%edi\n\t" |
109 "add %5, %%"REG_D" \n\t" | 119 "add %5, %%"REG_D" \n\t" |
110 | 120 |
111 BRANCHLESS_GET_CABAC("%%edx", "%3", "15(%%"REG_D")", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al") | 121 BRANCHLESS_GET_CABAC("%%edx", "%3", "15(%%"REG_D")", "%%ebx", |
122 "%%bx", "%%esi", "%%eax", "%%al") | |
112 | 123 |
113 "mov %2, %%"REG_a" \n\t" | 124 "mov %2, %%"REG_a" \n\t" |
114 "mov %1, %%edi \n\t" | 125 "mov %1, %%edi \n\t" |
115 "movl %%edi, (%%"REG_a") \n\t" | 126 "movl %%edi, (%%"REG_a") \n\t" |
116 | 127 |
137 :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off) | 148 :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off) |
138 : "%"REG_c, "%ebx", "%edx", "%esi", "%"REG_D, "memory" | 149 : "%"REG_c, "%ebx", "%edx", "%esi", "%"REG_D, "memory" |
139 ); | 150 ); |
140 return coeff_count; | 151 return coeff_count; |
141 } | 152 } |
142 #endif /* defined(ARCH_X86) && && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ | 153 #endif /* defined(ARCH_X86) && defined(HAVE_7REGS) && */ |
154 /* defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ | |
143 | 155 |
144 #endif /* FFMPEG_H264_I386_H */ | 156 #endif /* FFMPEG_H264_I386_H */ |