Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
dea6f521
Commit
dea6f521
authored
Jan 15, 2016
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deduplicate sign cost for ONE/TWO/THREE/FOUR tokens
Change-Id: I9c383d604dfd240e38b198ac5bf86ddd3456f442
parent
dcc0c894
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
38 deletions
+32
-38
vp10/encoder/tokenize.c
vp10/encoder/tokenize.c
+19
-22
vp9/encoder/vp9_tokenize.c
vp9/encoder/vp9_tokenize.c
+13
-16
No files found.
vp10/encoder/tokenize.c
View file @
dea6f521
...
...
@@ -75,10 +75,7 @@ static const vpx_tree_index cat6[28] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12,
14
,
14
,
16
,
16
,
18
,
18
,
20
,
20
,
22
,
22
,
24
,
24
,
26
,
26
,
0
,
0
};
static
const
int16_t
zero_cost
[]
=
{
0
};
static
const
int16_t
one_cost
[]
=
{
255
,
257
};
static
const
int16_t
two_cost
[]
=
{
255
,
257
};
static
const
int16_t
three_cost
[]
=
{
255
,
257
};
static
const
int16_t
four_cost
[]
=
{
255
,
257
};
static
const
int16_t
sign_cost
[]
=
{
255
,
257
};
static
const
int16_t
cat1_cost
[]
=
{
429
,
431
,
616
,
618
};
static
const
int16_t
cat2_cost
[]
=
{
624
,
626
,
727
,
729
,
848
,
850
,
951
,
953
};
static
const
int16_t
cat3_cost
[]
=
{
...
...
@@ -386,48 +383,48 @@ static const vpx_tree_index cat6_high12[36] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10,
#endif
const
vp10_extra_bit
vp10_extra_bits
[
ENTROPY_TOKENS
]
=
{
{
0
,
0
,
0
,
0
,
zero_cost
},
// ZERO_TOKEN
{
0
,
0
,
0
,
1
,
one
_cost
},
// ONE_TOKEN
{
0
,
0
,
0
,
2
,
two
_cost
},
// TWO_TOKEN
{
0
,
0
,
0
,
3
,
three
_cost
},
// THREE_TOKEN
{
0
,
0
,
0
,
4
,
four
_cost
},
// FOUR_TOKEN
{
0
,
0
,
0
,
0
,
zero_cost
},
// ZERO_TOKEN
{
0
,
0
,
0
,
1
,
sign
_cost
},
// ONE_TOKEN
{
0
,
0
,
0
,
2
,
sign
_cost
},
// TWO_TOKEN
{
0
,
0
,
0
,
3
,
sign
_cost
},
// THREE_TOKEN
{
0
,
0
,
0
,
4
,
sign
_cost
},
// FOUR_TOKEN
{
cat1
,
vp10_cat1_prob
,
1
,
CAT1_MIN_VAL
,
cat1_cost
},
// CATEGORY1_TOKEN
{
cat2
,
vp10_cat2_prob
,
2
,
CAT2_MIN_VAL
,
cat2_cost
},
// CATEGORY2_TOKEN
{
cat3
,
vp10_cat3_prob
,
3
,
CAT3_MIN_VAL
,
cat3_cost
},
// CATEGORY3_TOKEN
{
cat4
,
vp10_cat4_prob
,
4
,
CAT4_MIN_VAL
,
cat4_cost
},
// CATEGORY4_TOKEN
{
cat5
,
vp10_cat5_prob
,
5
,
CAT5_MIN_VAL
,
cat5_cost
},
// CATEGORY5_TOKEN
{
cat6
,
vp10_cat6_prob
,
14
,
CAT6_MIN_VAL
,
0
},
// CATEGORY6_TOKEN
{
0
,
0
,
0
,
0
,
zero_cost
}
// EOB_TOKEN
{
0
,
0
,
0
,
0
,
zero_cost
}
// EOB_TOKEN
};
#if CONFIG_VP9_HIGHBITDEPTH
const
vp10_extra_bit
vp10_extra_bits_high10
[
ENTROPY_TOKENS
]
=
{
{
0
,
0
,
0
,
0
,
zero_cost
},
// ZERO
{
0
,
0
,
0
,
1
,
one
_cost
},
// ONE
{
0
,
0
,
0
,
2
,
two
_cost
},
// TWO
{
0
,
0
,
0
,
3
,
three
_cost
},
// THREE
{
0
,
0
,
0
,
4
,
four
_cost
},
// FOUR
{
0
,
0
,
0
,
0
,
zero_cost
},
// ZERO
{
0
,
0
,
0
,
1
,
sign
_cost
},
// ONE
{
0
,
0
,
0
,
2
,
sign
_cost
},
// TWO
{
0
,
0
,
0
,
3
,
sign
_cost
},
// THREE
{
0
,
0
,
0
,
4
,
sign
_cost
},
// FOUR
{
cat1_high10
,
vp10_cat1_prob_high10
,
1
,
CAT1_MIN_VAL
,
cat1_cost
},
// CAT1
{
cat2_high10
,
vp10_cat2_prob_high10
,
2
,
CAT2_MIN_VAL
,
cat2_cost
},
// CAT2
{
cat3_high10
,
vp10_cat3_prob_high10
,
3
,
CAT3_MIN_VAL
,
cat3_cost
},
// CAT3
{
cat4_high10
,
vp10_cat4_prob_high10
,
4
,
CAT4_MIN_VAL
,
cat4_cost
},
// CAT4
{
cat5_high10
,
vp10_cat5_prob_high10
,
5
,
CAT5_MIN_VAL
,
cat5_cost
},
// CAT5
{
cat6_high10
,
vp10_cat6_prob_high10
,
16
,
CAT6_MIN_VAL
,
0
},
// CAT6
{
0
,
0
,
0
,
0
,
zero_cost
}
// EOB
{
0
,
0
,
0
,
0
,
zero_cost
}
// EOB
};
const
vp10_extra_bit
vp10_extra_bits_high12
[
ENTROPY_TOKENS
]
=
{
{
0
,
0
,
0
,
0
,
zero_cost
},
// ZERO
{
0
,
0
,
0
,
1
,
one
_cost
},
// ONE
{
0
,
0
,
0
,
2
,
two
_cost
},
// TWO
{
0
,
0
,
0
,
3
,
three
_cost
},
// THREE
{
0
,
0
,
0
,
4
,
four
_cost
},
// FOUR
{
0
,
0
,
0
,
0
,
zero_cost
},
// ZERO
{
0
,
0
,
0
,
1
,
sign
_cost
},
// ONE
{
0
,
0
,
0
,
2
,
sign
_cost
},
// TWO
{
0
,
0
,
0
,
3
,
sign
_cost
},
// THREE
{
0
,
0
,
0
,
4
,
sign
_cost
},
// FOUR
{
cat1_high12
,
vp10_cat1_prob_high12
,
1
,
CAT1_MIN_VAL
,
cat1_cost
},
// CAT1
{
cat2_high12
,
vp10_cat2_prob_high12
,
2
,
CAT2_MIN_VAL
,
cat2_cost
},
// CAT2
{
cat3_high12
,
vp10_cat3_prob_high12
,
3
,
CAT3_MIN_VAL
,
cat3_cost
},
// CAT3
{
cat4_high12
,
vp10_cat4_prob_high12
,
4
,
CAT4_MIN_VAL
,
cat4_cost
},
// CAT4
{
cat5_high12
,
vp10_cat5_prob_high12
,
5
,
CAT5_MIN_VAL
,
cat5_cost
},
// CAT5
{
cat6_high12
,
vp10_cat6_prob_high12
,
18
,
CAT6_MIN_VAL
,
0
},
// CAT6
{
0
,
0
,
0
,
0
,
zero_cost
}
// EOB
{
0
,
0
,
0
,
0
,
zero_cost
}
// EOB
};
#endif
...
...
vp9/encoder/vp9_tokenize.c
View file @
dea6f521
...
...
@@ -67,10 +67,7 @@ const vpx_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
};
static
const
int16_t
zero_cost
[]
=
{
0
};
static
const
int16_t
one_cost
[]
=
{
255
,
257
};
static
const
int16_t
two_cost
[]
=
{
255
,
257
};
static
const
int16_t
three_cost
[]
=
{
255
,
257
};
static
const
int16_t
four_cost
[]
=
{
255
,
257
};
static
const
int16_t
sign_cost
[]
=
{
255
,
257
};
static
const
int16_t
cat1_cost
[]
=
{
429
,
431
,
616
,
618
};
static
const
int16_t
cat2_cost
[]
=
{
624
,
626
,
727
,
729
,
848
,
850
,
951
,
953
};
static
const
int16_t
cat3_cost
[]
=
{
...
...
@@ -360,10 +357,10 @@ const int16_t vp9_cat6_high12_high_cost[2048] = {
const
vp9_extra_bit
vp9_extra_bits
[
ENTROPY_TOKENS
]
=
{
{
0
,
0
,
0
,
zero_cost
},
// ZERO_TOKEN
{
0
,
0
,
1
,
one
_cost
},
// ONE_TOKEN
{
0
,
0
,
2
,
two
_cost
},
// TWO_TOKEN
{
0
,
0
,
3
,
three
_cost
},
// THREE_TOKEN
{
0
,
0
,
4
,
four
_cost
},
// FOUR_TOKEN
{
0
,
0
,
1
,
sign
_cost
},
// ONE_TOKEN
{
0
,
0
,
2
,
sign
_cost
},
// TWO_TOKEN
{
0
,
0
,
3
,
sign
_cost
},
// THREE_TOKEN
{
0
,
0
,
4
,
sign
_cost
},
// FOUR_TOKEN
{
vp9_cat1_prob
,
1
,
CAT1_MIN_VAL
,
cat1_cost
},
// CATEGORY1_TOKEN
{
vp9_cat2_prob
,
2
,
CAT2_MIN_VAL
,
cat2_cost
},
// CATEGORY2_TOKEN
{
vp9_cat3_prob
,
3
,
CAT3_MIN_VAL
,
cat3_cost
},
// CATEGORY3_TOKEN
...
...
@@ -376,10 +373,10 @@ const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS] = {
#if CONFIG_VP9_HIGHBITDEPTH
const
vp9_extra_bit
vp9_extra_bits_high10
[
ENTROPY_TOKENS
]
=
{
{
0
,
0
,
0
,
zero_cost
},
// ZERO
{
0
,
0
,
1
,
one
_cost
},
// ONE
{
0
,
0
,
2
,
two
_cost
},
// TWO
{
0
,
0
,
3
,
three
_cost
},
// THREE
{
0
,
0
,
4
,
four
_cost
},
// FOUR
{
0
,
0
,
1
,
sign
_cost
},
// ONE
{
0
,
0
,
2
,
sign
_cost
},
// TWO
{
0
,
0
,
3
,
sign
_cost
},
// THREE
{
0
,
0
,
4
,
sign
_cost
},
// FOUR
{
vp9_cat1_prob
,
1
,
CAT1_MIN_VAL
,
cat1_cost
},
// CAT1
{
vp9_cat2_prob
,
2
,
CAT2_MIN_VAL
,
cat2_cost
},
// CAT2
{
vp9_cat3_prob
,
3
,
CAT3_MIN_VAL
,
cat3_cost
},
// CAT3
...
...
@@ -390,10 +387,10 @@ const vp9_extra_bit vp9_extra_bits_high10[ENTROPY_TOKENS] = {
};
const
vp9_extra_bit
vp9_extra_bits_high12
[
ENTROPY_TOKENS
]
=
{
{
0
,
0
,
0
,
zero_cost
},
// ZERO
{
0
,
0
,
1
,
one
_cost
},
// ONE
{
0
,
0
,
2
,
two
_cost
},
// TWO
{
0
,
0
,
3
,
three
_cost
},
// THREE
{
0
,
0
,
4
,
four
_cost
},
// FOUR
{
0
,
0
,
1
,
sign
_cost
},
// ONE
{
0
,
0
,
2
,
sign
_cost
},
// TWO
{
0
,
0
,
3
,
sign
_cost
},
// THREE
{
0
,
0
,
4
,
sign
_cost
},
// FOUR
{
vp9_cat1_prob
,
1
,
CAT1_MIN_VAL
,
cat1_cost
},
// CAT1
{
vp9_cat2_prob
,
2
,
CAT2_MIN_VAL
,
cat2_cost
},
// CAT2
{
vp9_cat3_prob
,
3
,
CAT3_MIN_VAL
,
cat3_cost
},
// CAT3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment