44 #if HAVE_7REGS && !BROKEN_COMPILER 45 #define decode_significance decode_significance_x86 46 static int decode_significance_x86(
CABACContext *
c,
int max_coeff,
47 uint8_t *significant_coeff_ctx_base,
49 void *end= significant_coeff_ctx_base + max_coeff - 1;
50 int minusstart= -(intptr_t)significant_coeff_ctx_base;
51 int minusindex= 4-(intptr_t)index;
55 #ifdef BROKEN_RELOCATIONS 68 BRANCHLESS_GET_CABAC(
"%4",
"%q4",
"(%1)",
"%3",
"%w3",
69 "%5",
"%q5",
"%k0",
"%b0",
70 "%c11(%6)",
"%c12(%6)",
80 BRANCHLESS_GET_CABAC(
"%4",
"%q4",
"(%1)",
"%3",
"%w3",
81 "%5",
"%q5",
"%k0",
"%b0",
82 "%c11(%6)",
"%c12(%6)",
91 "add %1, %%"FF_REG_c
" \n\t" 92 "movl %%ecx, (%0) \n\t" 97 "add"FF_OPSIZE
" $4, %2 \n\t" 104 "movl %7, %%ecx \n\t" 105 "add %1, %%"FF_REG_c
" \n\t" 106 "movl %%ecx, (%0) \n\t" 110 :
"=&q"(coeff_count),
"+r"(significant_coeff_ctx_base),
"+m"(
index),
112 :
"r"(
c),
"m"(minusstart),
"m"(end),
"m"(minusindex),
"m"(last_off),
116 :
"%"FF_REG_c,
"memory" 121 #define decode_significance_8x8 decode_significance_8x8_x86 123 uint8_t *significant_coeff_ctx_base,
124 int *index,
uint8_t *last_coeff_ctx_base,
const uint8_t *sig_off){
125 int minusindex= 4-(intptr_t)index;
131 #ifdef BROKEN_RELOCATIONS 146 "movzb (%0, %6), %6 \n\t" 149 BRANCHLESS_GET_CABAC(
"%4",
"%q4",
"(%6)",
"%3",
"%w3",
150 "%5",
"%q5",
"%k0",
"%b0",
151 "%c12(%7)",
"%c13(%7)",
161 #ifdef BROKEN_RELOCATIONS 162 "movzb %c14(%15, %q6), %6\n\t" 168 BRANCHLESS_GET_CABAC(
"%4",
"%q4",
"(%6)",
"%3",
"%w3",
169 "%5",
"%q5",
"%k0",
"%b0",
170 "%c12(%7)",
"%c13(%7)",
183 "add"FF_OPSIZE
" $4, %2 \n\t" 195 :
"=&q"(coeff_count),
"+"REG64(last),
"+"REG64(index),
"+&r"(c->
low),
196 "=&r"(bit),
"+&r"(c->
range),
"=&r"(state)
197 :
"r"(
c),
"m"(minusindex),
"m"(significant_coeff_ctx_base),
198 REG64(sig_off), REG64(last_coeff_ctx_base),
202 :
"%"FF_REG_c,
"memory"
#define NAMED_CONSTRAINTS_ARRAY(...)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
#define H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET
#define H264_MLPS_STATE_OFFSET
Writing a table generator This documentation is preliminary Parts of the API are not good and should be changed Basic concepts A table generator consists of two *_tablegen c and *_tablegen h The h file will provide the variable declarations and initialization code for the tables
#define H264_NORM_SHIFT_OFFSET
const uint8_t ff_h264_cabac_tables[512+4 *2 *64+4 *64+63]
#define bit(string, value)
__asm__(".macro parse_r var r\n\t""\\var = -1\n\t"_IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31)".iflt \\var\n\t"".error \"Unable to parse register name \\r\"\n\t"".endif\n\t"".endm")
Context Adaptive Binary Arithmetic Coder.
#define H264_LPS_RANGE_OFFSET