Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
4144fee9
Commit
4144fee9
authored
Aug 01, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Aug 01, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Cleanup: reusing clamp_mv function."
parents
555bbd68
422d38bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
22 deletions
+25
-22
vp9/common/vp9_findnearmv.h
vp9/common/vp9_findnearmv.h
+0
-6
vp9/common/vp9_mv.h
vp9/common/vp9_mv.h
+8
-0
vp9/common/vp9_mvref_common.c
vp9/common/vp9_mvref_common.c
+4
-4
vp9/common/vp9_reconinter.c
vp9/common/vp9_reconinter.c
+13
-12
No files found.
vp9/common/vp9_findnearmv.h
View file @
4144fee9
...
...
@@ -29,12 +29,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
int_mv
*
near
);
// TODO(jingning): this mv clamping function should be block size dependent.
static
void
clamp_mv
(
MV
*
mv
,
int
min_col
,
int
max_col
,
int
min_row
,
int
max_row
)
{
mv
->
col
=
clamp
(
mv
->
col
,
min_col
,
max_col
);
mv
->
row
=
clamp
(
mv
->
row
,
min_row
,
max_row
);
}
static
void
clamp_mv2
(
MV
*
mv
,
const
MACROBLOCKD
*
xd
)
{
clamp_mv
(
mv
,
xd
->
mb_to_left_edge
-
LEFT_TOP_MARGIN
,
xd
->
mb_to_right_edge
+
RIGHT_BOTTOM_MARGIN
,
...
...
vp9/common/vp9_mv.h
View file @
4144fee9
...
...
@@ -13,6 +13,8 @@
#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_common.h"
typedef
struct
{
int16_t
row
;
int16_t
col
;
...
...
@@ -28,4 +30,10 @@ typedef struct {
int32_t
col
;
}
MV32
;
static
void
clamp_mv
(
MV
*
mv
,
int
min_col
,
int
max_col
,
int
min_row
,
int
max_row
)
{
mv
->
col
=
clamp
(
mv
->
col
,
min_col
,
max_col
);
mv
->
row
=
clamp
(
mv
->
row
,
min_row
,
max_row
);
}
#endif // VP9_COMMON_VP9_MV_H_
vp9/common/vp9_mvref_common.c
View file @
4144fee9
...
...
@@ -43,10 +43,10 @@ static const int mv_ref_blocks[BLOCK_SIZE_TYPES][MVREF_NEIGHBOURS][2] = {
#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units
static
void
clamp_mv_ref
(
const
MACROBLOCKD
*
xd
,
int_mv
*
mv
)
{
mv
->
as_mv
.
col
=
clamp
(
mv
->
as_mv
.
col
,
xd
->
mb_to_left_edge
-
MV_BORDER
,
xd
->
mb_to_right_edge
+
MV_BORDER
);
mv
->
as_mv
.
row
=
clamp
(
mv
->
as_mv
.
row
,
xd
->
mb_to_top_edge
-
MV_BORDER
,
xd
->
mb_to_bottom_edge
+
MV_BORDER
);
clamp_mv
(
&
mv
->
as_mv
,
xd
->
mb_to_left_edge
-
MV_BORDER
,
xd
->
mb_to_right_edge
+
MV_BORDER
,
xd
->
mb_to_top_edge
-
MV_BORDER
,
xd
->
mb_to_bottom_edge
+
MV_BORDER
);
}
// Gets a candidate reference motion vector from the given mode info
...
...
vp9/common/vp9_reconinter.c
View file @
4144fee9
...
...
@@ -239,24 +239,25 @@ MV clamp_mv_to_umv_border_sb(const MV *src_mv,
int
bwl
,
int
bhl
,
int
ss_x
,
int
ss_y
,
int
mb_to_left_edge
,
int
mb_to_top_edge
,
int
mb_to_right_edge
,
int
mb_to_bottom_edge
)
{
/* If the MV points so far into the UMV border that no visible pixels
* are used for reconstruction, the subpel part of the MV can be
* discarded and the MV limited to 16 pixels with equivalent results.
*/
// If the MV points so far into the UMV border that no visible pixels
// are used for reconstruction, the subpel part of the MV can be
// discarded and the MV limited to 16 pixels with equivalent results.
const
int
spel_left
=
(
VP9_INTERP_EXTEND
+
(
4
<<
bwl
))
<<
4
;
const
int
spel_right
=
spel_left
-
(
1
<<
4
);
const
int
spel_top
=
(
VP9_INTERP_EXTEND
+
(
4
<<
bhl
))
<<
4
;
const
int
spel_bottom
=
spel_top
-
(
1
<<
4
);
MV
clamped_mv
;
MV
clamped_mv
=
{
src_mv
->
row
<<
(
1
-
ss_y
),
src_mv
->
col
<<
(
1
-
ss_x
)
};
assert
(
ss_x
<=
1
);
assert
(
ss_y
<=
1
);
clamped_mv
.
col
=
clamp
(
src_mv
->
col
<<
(
1
-
ss_x
),
(
mb_to_left_edge
<<
(
1
-
ss_x
))
-
spel_left
,
(
mb_to_right_edge
<<
(
1
-
ss_x
))
+
spel_right
);
clamped_mv
.
row
=
clamp
(
src_mv
->
row
<<
(
1
-
ss_y
)
,
(
mb_to_top_edge
<<
(
1
-
ss_y
))
-
spel_top
,
(
mb_to_bottom_edge
<<
(
1
-
ss_y
))
+
spel_bottom
);
clamp_mv
(
&
clamped_mv
,
(
mb_to_left_edge
<<
(
1
-
ss_x
))
-
spel_left
,
(
mb_to_right_edge
<<
(
1
-
ss_x
))
+
spel_right
,
(
mb_to_top_edge
<<
(
1
-
ss_y
))
-
spel_top
,
(
mb_to_bottom_edge
<<
(
1
-
ss_y
))
+
spel_bottom
);
return
clamped_mv
;
}
...
...
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