Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
e8346f8c
Commit
e8346f8c
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Cleaning up probability/cost functions."
parents
dd04ff50
e55d3e6d
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
vp9/encoder/vp9_encodemv.c
+8
-13
vp9/encoder/vp9_encodemv.c
vp9/encoder/vp9_subexp.c
+0
-1
vp9/encoder/vp9_subexp.c
vp9/encoder/vp9_treewriter.h
+4
-15
vp9/encoder/vp9_treewriter.h
with
12 additions
and
29 deletions
vp9/encoder/vp9_encodemv.c
+
8
−
13
View file @
e8346f8c
...
...
@@ -126,20 +126,15 @@ static void build_nmv_component_cost_table(int *mvcost,
static
int
update_mv
(
vp9_writer
*
w
,
const
unsigned
int
ct
[
2
],
vp9_prob
*
cur_p
,
vp9_prob
upd_p
)
{
const
vp9_prob
new_p
=
get_binary_prob
(
ct
[
0
],
ct
[
1
]);
vp9_prob
mod_p
=
new_p
|
1
;
const
int
cur_b
=
cost_branch256
(
ct
,
*
cur_p
);
const
int
mod_b
=
cost_branch256
(
ct
,
mod_p
);
const
int
cost
=
7
*
256
+
(
vp9_cost_one
(
upd_p
)
-
vp9_cost_zero
(
upd_p
));
if
(
cur_b
-
mod_b
>
cost
)
{
*
cur_p
=
mod_p
;
vp9_write
(
w
,
1
,
upd_p
);
vp9_write_literal
(
w
,
mod_p
>>
1
,
7
);
return
1
;
}
else
{
vp9_write
(
w
,
0
,
upd_p
);
return
0
;
const
vp9_prob
new_p
=
get_binary_prob
(
ct
[
0
],
ct
[
1
])
|
1
;
const
int
update
=
cost_branch256
(
ct
,
*
cur_p
)
+
vp9_cost_zero
(
upd_p
)
>
cost_branch256
(
ct
,
new_p
)
+
vp9_cost_one
(
upd_p
)
+
7
*
256
;
vp9_write
(
w
,
update
,
upd_p
);
if
(
update
)
{
*
cur_p
=
new_p
;
vp9_write_literal
(
w
,
new_p
>>
1
,
7
);
}
return
update
;
}
static
void
counts_to_nmv_context
(
...
...
This diff is collapsed.
Click to expand it.
vp9/encoder/vp9_subexp.c
+
0
−
1
View file @
e8346f8c
...
...
@@ -14,7 +14,6 @@
#include
"vp9/encoder/vp9_boolhuff.h"
#include
"vp9/encoder/vp9_treewriter.h"
#define vp9_cost_upd ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd)) >> 8)
#define vp9_cost_upd256 ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd)))
static
int
update_bits
[
255
];
...
...
This diff is collapsed.
Click to expand it.
vp9/encoder/vp9_treewriter.h
+
4
−
15
View file @
e8346f8c
...
...
@@ -19,31 +19,20 @@
#include
"vp9/encoder/vp9_boolhuff.h"
/* for now */
#define vp9_write_prob(w, v) vp9_write_literal((w), (v), 8)
/* Approximate length of an encoded bool in 256ths of a bit at given prob */
#define vp9_cost_zero(x) (vp9_prob_cost[x])
#define vp9_cost_one(x) vp9_cost_zero(vp9_complement(x))
#define vp9_cost_bit(x, b) vp9_cost_zero((b) ? vp9_complement(x) : (x))
#define vp9_cost_zero(prob) (vp9_prob_cost[prob])
/* VP8BC version is scaled by 2^20 rather than 2^8; see bool_coder.h */
#define vp9_cost_one(prob) vp9_cost_zero(vp9_complement(prob))
#define vp9_cost_bit(prob, bit) vp9_cost_zero((bit) ? vp9_complement(prob) \
: (prob))
/* Both of these return bits, not scaled bits. */
static
INLINE
unsigned
int
cost_branch256
(
const
unsigned
int
ct
[
2
],
vp9_prob
p
)
{
return
ct
[
0
]
*
vp9_cost_zero
(
p
)
+
ct
[
1
]
*
vp9_cost_one
(
p
);
}
static
INLINE
unsigned
int
cost_branch
(
const
unsigned
int
ct
[
2
],
vp9_prob
p
)
{
return
cost_branch256
(
ct
,
p
)
>>
8
;
}
static
INLINE
void
treed_write
(
vp9_writer
*
w
,
vp9_tree
tree
,
const
vp9_prob
*
probs
,
int
bits
,
int
len
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets