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
d4bc17d6
Commit
d4bc17d6
authored
Jan 14, 2016
by
Scott LaVarnway
Committed by
Gerrit Code Review
Jan 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge "VP9: inline vp9_use_mv_hp()"
parents
13177d7e
de993a84
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
22 deletions
+14
-22
vp9/common/vp9_entropymv.c
vp9/common/vp9_entropymv.c
+0
-8
vp9/common/vp9_entropymv.h
vp9/common/vp9_entropymv.h
+8
-1
vp9/common/vp9_mvref_common.h
vp9/common/vp9_mvref_common.h
+1
-1
vp9/decoder/vp9_decodemv.c
vp9/decoder/vp9_decodemv.c
+0
-7
vp9/encoder/vp9_encodemv.c
vp9/encoder/vp9_encodemv.c
+1
-1
vp9/encoder/vp9_mcomp.c
vp9/encoder/vp9_mcomp.c
+4
-4
No files found.
vp9/common/vp9_entropymv.c
View file @
d4bc17d6
...
...
@@ -11,9 +11,6 @@
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_entropymv.h"
// Integer pel reference mv threshold for use of high-precision 1/8 mv
#define COMPANDED_MVREF_THRESH 8
const
vpx_tree_index
vp9_mv_joint_tree
[
TREE_SIZE
(
MV_JOINTS
)]
=
{
-
MV_JOINT_ZERO
,
2
,
-
MV_JOINT_HNZVZ
,
4
,
...
...
@@ -127,11 +124,6 @@ MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset) {
return
c
;
}
int
vp9_use_mv_hp
(
const
MV
*
ref
)
{
return
(
abs
(
ref
->
row
)
>>
3
)
<
COMPANDED_MVREF_THRESH
&&
(
abs
(
ref
->
col
)
>>
3
)
<
COMPANDED_MVREF_THRESH
;
}
static
void
inc_mv_component
(
int
v
,
nmv_component_counts
*
comp_counts
,
int
incr
,
int
usehp
)
{
int
s
,
z
,
c
,
o
,
d
,
e
,
f
;
...
...
vp9/common/vp9_entropymv.h
View file @
d4bc17d6
...
...
@@ -27,7 +27,14 @@ struct VP9Common;
void
vp9_init_mv_probs
(
struct
VP9Common
*
cm
);
void
vp9_adapt_mv_probs
(
struct
VP9Common
*
cm
,
int
usehp
);
int
vp9_use_mv_hp
(
const
MV
*
ref
);
// Integer pel reference mv threshold for use of high-precision 1/8 mv
#define COMPANDED_MVREF_THRESH 8
static
INLINE
int
use_mv_hp
(
const
MV
*
ref
)
{
return
(
abs
(
ref
->
row
)
>>
3
)
<
COMPANDED_MVREF_THRESH
&&
(
abs
(
ref
->
col
)
>>
3
)
<
COMPANDED_MVREF_THRESH
;
}
#define MV_UPDATE_PROB 252
...
...
vp9/common/vp9_mvref_common.h
View file @
d4bc17d6
...
...
@@ -208,7 +208,7 @@ static INLINE void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
}
static
INLINE
void
lower_mv_precision
(
MV
*
mv
,
int
allow_hp
)
{
const
int
use_hp
=
allow_hp
&&
vp9_
use_mv_hp
(
mv
);
const
int
use_hp
=
allow_hp
&&
use_mv_hp
(
mv
);
if
(
!
use_hp
)
{
if
(
mv
->
row
&
1
)
mv
->
row
+=
(
mv
->
row
>
0
?
-
1
:
1
);
...
...
vp9/decoder/vp9_decodemv.c
View file @
d4bc17d6
...
...
@@ -284,13 +284,6 @@ static int read_mv_component(vpx_reader *r,
return
sign
?
-
mag
:
mag
;
}
// TODO(slavarnway): move to vp9_entropymv.h and replace vp9_use_mv_hp
#define COMPANDED_MVREF_THRESH 8
static
int
use_mv_hp
(
const
MV
*
ref
)
{
return
(
abs
(
ref
->
row
)
>>
3
)
<
COMPANDED_MVREF_THRESH
&&
(
abs
(
ref
->
col
)
>>
3
)
<
COMPANDED_MVREF_THRESH
;
}
static
INLINE
void
read_mv
(
vpx_reader
*
r
,
MV
*
mv
,
const
MV
*
ref
,
const
nmv_context
*
ctx
,
nmv_context_counts
*
counts
,
int
allow_hp
)
{
...
...
vp9/encoder/vp9_encodemv.c
View file @
d4bc17d6
...
...
@@ -206,7 +206,7 @@ void vp9_encode_mv(VP9_COMP* cpi, vpx_writer* w,
const
MV
diff
=
{
mv
->
row
-
ref
->
row
,
mv
->
col
-
ref
->
col
};
const
MV_JOINT_TYPE
j
=
vp9_get_mv_joint
(
&
diff
);
usehp
=
usehp
&&
vp9_
use_mv_hp
(
ref
);
usehp
=
usehp
&&
use_mv_hp
(
ref
);
vp9_write_token
(
w
,
vp9_mv_joint_tree
,
mvctx
->
joints
,
&
mv_joint_encodings
[
j
]);
if
(
mv_joint_vertical
(
j
))
...
...
vp9/encoder/vp9_mcomp.c
View file @
d4bc17d6
...
...
@@ -439,7 +439,7 @@ int vp9_find_best_sub_pixel_tree_pruned_evenmore(
tr
=
br
;
tc
=
bc
;
if
(
allow_hp
&&
vp9_
use_mv_hp
(
ref_mv
)
&&
forced_stop
==
0
)
{
if
(
allow_hp
&&
use_mv_hp
(
ref_mv
)
&&
forced_stop
==
0
)
{
hstep
>>=
1
;
FIRST_LEVEL_CHECKS
;
if
(
eighthiters
>
1
)
{
...
...
@@ -507,7 +507,7 @@ int vp9_find_best_sub_pixel_tree_pruned_more(const MACROBLOCK *x,
}
}
if
(
allow_hp
&&
vp9_
use_mv_hp
(
ref_mv
)
&&
forced_stop
==
0
)
{
if
(
allow_hp
&&
use_mv_hp
(
ref_mv
)
&&
forced_stop
==
0
)
{
tr
=
br
;
tc
=
bc
;
hstep
>>=
1
;
...
...
@@ -602,7 +602,7 @@ int vp9_find_best_sub_pixel_tree_pruned(const MACROBLOCK *x,
tc
=
bc
;
}
if
(
allow_hp
&&
vp9_
use_mv_hp
(
ref_mv
)
&&
forced_stop
==
0
)
{
if
(
allow_hp
&&
use_mv_hp
(
ref_mv
)
&&
forced_stop
==
0
)
{
hstep
>>=
1
;
FIRST_LEVEL_CHECKS
;
if
(
eighthiters
>
1
)
{
...
...
@@ -674,7 +674,7 @@ int vp9_find_best_sub_pixel_tree(const MACROBLOCK *x,
unsigned
int
cost_array
[
5
];
int
kr
,
kc
;
if
(
!
(
allow_hp
&&
vp9_
use_mv_hp
(
ref_mv
)))
if
(
!
(
allow_hp
&&
use_mv_hp
(
ref_mv
)))
if
(
round
==
3
)
round
=
2
;
...
...
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