27#define decode_significance decode_significance_loongarch
29 uint8_t *significant_coeff_ctx_base,
int *
index,
int64_t last_off)
31 void *end = significant_coeff_ctx_base + max_coeff - 1;
35 uint8_t *
state = significant_coeff_ctx_base;
39#if UNCHECKED_BITSTREAM_READER
44 "blt %[bit], %[one], 4f \n\t"
45 "add.d %[state], %[state], %[last_off] \n\t"
46#if UNCHECKED_BITSTREAM_READER
51 "sub.d %[state], %[state], %[last_off] \n\t"
52 "add.d %[tmp0], %[state], %[minusstart] \n\t"
53 "st.w %[tmp0], %[index], 0 \n\t"
54 "bge %[bit], %[one], 5f \n\t"
55 "addi.d %[index], %[index], 4 \n\t"
57 "addi.d %[state], %[state], 1 \n\t"
58 "blt %[state], %[end], 3b \n\t"
59 "add.d %[tmp0], %[state], %[minusstart] \n\t"
60 "st.w %[tmp0], %[index], 0 \n\t"
62 "add.d %[tmp0], %[index], %[minusindex] \n\t"
63 "srli.d %[tmp0], %[tmp0], 2 \n\t"
64 : [
bit]
"=&r"(
bit), [tmp0]
"=&r"(tmp0), [tmp1]
"=&r"(tmp1), [tmp2]
"=&r"(tmp2),
65 [c_range]
"+&r"(
c->range), [c_low]
"+&r"(
c->low), [
state]
"+&r"(
state),
66 [c_bytestream]
"+&r"(
c->bytestream), [
index]
"+&r"(
index)
68 [minusstart]
"r"(minusstart), [minusindex]
"r"(minusindex),
69 [last_off]
"r"(last_off),
70#if !UNCHECKED_BITSTREAM_READER
71 [c_bytestream_end]
"r"(
c->bytestream_end),
83#define decode_significance_8x8 decode_significance_8x8_loongarch
86 int *
index, uint8_t *last_coeff_ctx_base,
const uint8_t *sig_off)
89 int64_t bit, tmp0, tmp1, tmp2, one = 1, end = 63, last = 0;
95 "ldx.bu %[tmp0], %[sig_off], %[last] \n\t"
96 "add.d %[state], %[tmp0], %[significant_coeff_ctx_base] \n\t"
97#if UNCHECKED_BITSTREAM_READER
102 "blt %[bit], %[one], 4f \n\t"
103 "add.d %[tmp0], %[tables], %[flag_offset] \n\t"
104 "ldx.bu %[tmp1], %[tmp0], %[last] \n\t"
105 "add.d %[state], %[tmp1], %[last_coeff_ctx_base] \n\t"
106#if UNCHECKED_BITSTREAM_READER
111 "st.w %[last], %[index], 0 \n\t"
112 "bge %[bit], %[one], 5f \n\t"
113 "addi.d %[index], %[index], 4 \n\t"
115 "addi.d %[last], %[last], 1 \n\t"
116 "blt %[last], %[end], 3b \n\t"
117 "st.w %[last], %[index], 0 \n\t"
119 "add.d %[tmp0], %[index], %[minusindex] \n\t"
120 "srli.d %[tmp0], %[tmp0], 2 \n\t"
121 : [
bit]
"=&r"(
bit), [tmp0]
"=&r"(tmp0), [tmp1]
"=&r"(tmp1),
122 [tmp2]
"=&r"(tmp2), [c_range]
"+&r"(
c->range),
123 [c_low]
"+&r"(
c->low), [
state]
"+&r"(
state), [last]
"+&r"(last),
124 [c_bytestream]
"+&r"(
c->bytestream), [
index]
"+&r"(
index)
126 [one]
"r"(one), [minusindex]
"r"(minusindex),
127 [last_coeff_ctx_base]
"r"(last_coeff_ctx_base),
128 [flag_offset]
"r"(flag_offset),
129#if !UNCHECKED_BITSTREAM_READER
130 [c_bytestream_end]
"r"(
c->bytestream_end),
136 [significant_coeff_ctx_base]
"r"(significant_coeff_ctx_base)
__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_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET
#define H264_LPS_RANGE_OFFSET
#define H264_MLPS_STATE_OFFSET
#define H264_NORM_SHIFT_OFFSET
const uint8_t ff_h264_cabac_tables[512+4 *2 *64+4 *64+63]
#define bit(string, value)
static struct @346255127015250356166251341105367306144006377143 state
#define GET_CABAC_LOONGARCH_UNCBSR
#define GET_CABAC_LOONGARCH
static int decode_significance_loongarch(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index, int64_t last_off)
static int decode_significance_8x8_loongarch(CABACContext *c, uint8_t *significant_coeff_ctx_base, int *index, uint8_t *last_coeff_ctx_base, const uint8_t *sig_off)
static const uint8_t *const tables[]