40 int (*
cmp)(
void *key,
const void *
b),
void *next[2])
46 next[v >> 31] = t->
elem;
73 key = t->
elem = next_elem[i];
83 int i = (v >> 31) ^ !!*next;
85 t->
state += 2 * i - 1;
87 if (!(t->
state & 1)) {
109 if ((*child)->state * 2 == -t->
state) {
110 *tp = (*child)->
child[i ^ 1];
113 *child = (*tp)->
child[i ^ 1];
114 (*tp)->
child[i ^ 1] = t;
117 (*tp)->child[1]->state = (*tp)->state < 0;
121 *child = (*child)->
child[i ^ 1];
122 (*tp)->
child[i ^ 1] = t;
127 (*tp)->state = -t->
state;
131 if (!(*tp)->state ^ !!*next)
156 int (*
cmp)(
void *opaque,
void *
elem),
157 int (*enu)(
void *opaque,
void *elem))
164 enu(opaque, t->
elem);
181 if (left > 999 || right > 999)
183 if (right - left != t->
state)
187 return FFMAX(left, right) + 1;
195 for (i = 0; i < depth * 4; i++)
199 print(t->
child[0], depth + 1);
200 print(t->
child[1], depth + 1);
205 static int cmp(
void *
a,
const void *
b)
210 int main(
int argc,
char **argv)
216 int log_level = argc <= 1 ?
AV_LOG_INFO : atoi(argv[1]);
222 for (i = 0; i < 10000; i++) {
225 if (
check(root) > 999) {