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
a1123538
Commit
a1123538
authored
Dec 04, 2013
by
Dmitry Kovalev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving vp9_token from common to encoder.
Change-Id: I40a070c353663e82c59e174d7c92eb84f72ed808
parent
8363349b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
30 deletions
+31
-30
vp9/common/vp9_treecoder.c
vp9/common/vp9_treecoder.c
+0
-21
vp9/common/vp9_treecoder.h
vp9/common/vp9_treecoder.h
+0
-9
vp9/encoder/vp9_tokenize.h
vp9/encoder/vp9_tokenize.h
+2
-0
vp9/encoder/vp9_treewriter.c
vp9/encoder/vp9_treewriter.c
+21
-0
vp9/encoder/vp9_treewriter.h
vp9/encoder/vp9_treewriter.h
+8
-0
No files found.
vp9/common/vp9_treecoder.c
View file @
a1123538
...
...
@@ -14,27 +14,6 @@
#include "./vpx_config.h"
#include "vp9/common/vp9_treecoder.h"
static
void
tree2tok
(
struct
vp9_token
*
const
p
,
vp9_tree
t
,
int
i
,
int
v
,
int
l
)
{
v
+=
v
;
++
l
;
do
{
const
vp9_tree_index
j
=
t
[
i
++
];
if
(
j
<=
0
)
{
p
[
-
j
].
value
=
v
;
p
[
-
j
].
len
=
l
;
}
else
{
tree2tok
(
p
,
t
,
j
,
v
,
l
);
}
}
while
(
++
v
&
1
);
}
void
vp9_tokens_from_tree
(
struct
vp9_token
*
p
,
vp9_tree
t
)
{
tree2tok
(
p
,
t
,
0
,
0
,
0
);
}
static
unsigned
int
convert_distribution
(
unsigned
int
i
,
vp9_tree
tree
,
unsigned
int
branch_ct
[][
2
],
const
unsigned
int
num_events
[])
{
...
...
vp9/common/vp9_treecoder.h
View file @
a1123538
...
...
@@ -34,15 +34,6 @@ typedef int8_t vp9_tree_index;
typedef
const
vp9_tree_index
vp9_tree
[];
struct
vp9_token
{
int
value
;
int
len
;
};
/* Construct encoding array from tree. */
void
vp9_tokens_from_tree
(
struct
vp9_token
*
,
vp9_tree
);
/* Convert array of token occurrence counts into a table of probabilities
for the associated binary encoding tree. Also writes count of branches
taken for each node on the tree; this facilitiates decisions as to
...
...
vp9/encoder/vp9_tokenize.h
View file @
a1123538
...
...
@@ -12,7 +12,9 @@
#define VP9_ENCODER_VP9_TOKENIZE_H_
#include "vp9/common/vp9_entropy.h"
#include "vp9/encoder/vp9_block.h"
#include "vp9/encoder/vp9_treewriter.h"
void
vp9_tokenize_initialize
();
...
...
vp9/encoder/vp9_treewriter.c
View file @
a1123538
...
...
@@ -36,3 +36,24 @@ void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree) {
costs
[
-
tree
[
0
]]
=
vp9_cost_bit
(
probs
[
0
],
0
);
cost
(
costs
,
tree
,
probs
,
2
,
0
);
}
static
void
tree2tok
(
struct
vp9_token
*
tokens
,
const
vp9_tree_index
*
tree
,
int
i
,
int
v
,
int
l
)
{
v
+=
v
;
++
l
;
do
{
const
vp9_tree_index
j
=
tree
[
i
++
];
if
(
j
<=
0
)
{
tokens
[
-
j
].
value
=
v
;
tokens
[
-
j
].
len
=
l
;
}
else
{
tree2tok
(
tokens
,
tree
,
j
,
v
,
l
);
}
}
while
(
++
v
&
1
);
}
void
vp9_tokens_from_tree
(
struct
vp9_token
*
tokens
,
const
vp9_tree_index
*
tree
)
{
tree2tok
(
tokens
,
tree
,
0
,
0
,
0
);
}
vp9/encoder/vp9_treewriter.h
View file @
a1123538
...
...
@@ -44,6 +44,14 @@ static INLINE void treed_write(vp9_writer *w,
}
while
(
len
);
}
struct
vp9_token
{
int
value
;
int
len
;
};
void
vp9_tokens_from_tree
(
struct
vp9_token
*
,
const
vp9_tree_index
*
);
static
INLINE
void
write_token
(
vp9_writer
*
w
,
vp9_tree
tree
,
const
vp9_prob
*
probs
,
const
struct
vp9_token
*
token
)
{
...
...
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