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
5c0b1086
Commit
5c0b1086
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Adding assign_mv() function to reduce code duplication."
parents
9dba044b
bde3ae0c
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
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
v1.3.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/decoder/vp9_decodemv.c
+48
-72
vp9/decoder/vp9_decodemv.c
with
48 additions
and
72 deletions
vp9/decoder/vp9_decodemv.c
+
48
−
72
View file @
5c0b1086
...
...
@@ -426,6 +426,45 @@ static void read_intra_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
mbmi
->
uv_mode
=
read_intra_mode_uv
(
cm
,
r
,
mbmi
->
mode
);
}
static
INLINE
void
assign_mv
(
VP9_COMMON
*
cm
,
MB_PREDICTION_MODE
mode
,
int_mv
mv
[
2
],
int_mv
best_mv
[
2
],
int_mv
nearest_mv
[
2
],
int_mv
near_mv
[
2
],
int
is_compound
,
int
allow_hp
,
vp9_reader
*
r
)
{
int
i
;
switch
(
mode
)
{
case
NEWMV
:
read_mv
(
r
,
&
mv
[
0
].
as_mv
,
&
best_mv
[
0
].
as_mv
,
&
cm
->
fc
.
nmvc
,
&
cm
->
counts
.
mv
,
allow_hp
);
if
(
is_compound
)
read_mv
(
r
,
&
mv
[
1
].
as_mv
,
&
best_mv
[
1
].
as_mv
,
&
cm
->
fc
.
nmvc
,
&
cm
->
counts
.
mv
,
allow_hp
);
break
;
case
NEARESTMV
:
mv
[
0
].
as_int
=
nearest_mv
[
0
].
as_int
;
if
(
is_compound
)
mv
[
1
].
as_int
=
nearest_mv
[
1
].
as_int
;
break
;
case
NEARMV
:
mv
[
0
].
as_int
=
near_mv
[
0
].
as_int
;
if
(
is_compound
)
mv
[
1
].
as_int
=
near_mv
[
1
].
as_int
;
break
;
case
ZEROMV
:
mv
[
0
].
as_int
=
0
;
if
(
is_compound
)
mv
[
1
].
as_int
=
0
;
break
;
default:
assert
(
!
"Invalid inter mode value."
);
}
for
(
i
=
0
;
i
<
1
+
is_compound
;
++
i
)
{
assert
(
mv
[
i
].
as_mv
.
row
<
MV_UPP
&&
mv
[
i
].
as_mv
.
row
>
MV_LOW
);
assert
(
mv
[
i
].
as_mv
.
col
<
MV_UPP
&&
mv
[
i
].
as_mv
.
col
>
MV_LOW
);
}
}
static
int
read_is_inter_block
(
VP9D_COMP
*
pbi
,
int
segment_id
,
vp9_reader
*
r
)
{
VP9_COMMON
*
const
cm
=
&
pbi
->
common
;
MACROBLOCKD
*
const
xd
=
&
pbi
->
mb
;
...
...
@@ -445,10 +484,7 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
int
mi_row
,
int
mi_col
,
vp9_reader
*
r
)
{
VP9_COMMON
*
const
cm
=
&
pbi
->
common
;
MACROBLOCKD
*
const
xd
=
&
pbi
->
mb
;
nmv_context
*
const
nmvc
=
&
cm
->
fc
.
nmvc
;
MB_MODE_INFO
*
const
mbmi
=
&
mi
->
mbmi
;
int_mv
*
const
mv0
=
&
mbmi
->
mv
[
0
];
int_mv
*
const
mv1
=
&
mbmi
->
mv
[
1
];
const
BLOCK_SIZE
bsize
=
mbmi
->
sb_type
;
const
int
allow_hp
=
xd
->
allow_high_precision_mv
;
...
...
@@ -518,41 +554,12 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
mi_row
,
mi_col
);
}
switch
(
b_mode
)
{
case
NEWMV
:
read_mv
(
r
,
&
block
[
0
].
as_mv
,
&
best
[
0
].
as_mv
,
nmvc
,
&
cm
->
counts
.
mv
,
allow_hp
);
if
(
is_compound
)
read_mv
(
r
,
&
block
[
1
].
as_mv
,
&
best
[
1
].
as_mv
,
nmvc
,
&
cm
->
counts
.
mv
,
allow_hp
);
break
;
case
NEARESTMV
:
block
[
0
].
as_int
=
nearest
[
0
].
as_int
;
if
(
is_compound
)
block
[
1
].
as_int
=
nearest
[
1
].
as_int
;
break
;
case
NEARMV
:
block
[
0
].
as_int
=
nearmv
[
0
].
as_int
;
if
(
is_compound
)
block
[
1
].
as_int
=
nearmv
[
1
].
as_int
;
break
;
case
ZEROMV
:
block
[
0
].
as_int
=
0
;
if
(
is_compound
)
block
[
1
].
as_int
=
0
;
break
;
default:
assert
(
!
"Invalid inter mode value"
);
}
mi
->
bmi
[
j
].
as_mv
[
0
].
as_int
=
block
[
0
].
as_int
;
assert
(
block
[
0
].
as_mv
.
row
<
MV_UPP
&&
block
[
0
].
as_mv
.
row
>
MV_LOW
);
assert
(
block
[
0
].
as_mv
.
col
<
MV_UPP
&&
block
[
0
].
as_mv
.
col
>
MV_LOW
);
assign_mv
(
cm
,
b_mode
,
block
,
best
,
nearest
,
nearmv
,
is_compound
,
allow_hp
,
r
);
if
(
is_compound
)
{
mi
->
bmi
[
j
].
as_mv
[
0
].
as_int
=
block
[
0
].
as_int
;
if
(
is_compound
)
mi
->
bmi
[
j
].
as_mv
[
1
].
as_int
=
block
[
1
].
as_int
;
assert
(
block
[
1
].
as_mv
.
row
<
MV_UPP
&&
block
[
1
].
as_mv
.
row
>
MV_LOW
);
assert
(
block
[
1
].
as_mv
.
col
<
MV_UPP
&&
block
[
1
].
as_mv
.
col
>
MV_LOW
);
}
if
(
num_4x4_h
==
2
)
mi
->
bmi
[
j
+
2
]
=
mi
->
bmi
[
j
];
...
...
@@ -562,43 +569,12 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
}
mi
->
mbmi
.
mode
=
b_mode
;
mv0
->
as_int
=
mi
->
bmi
[
3
].
as_mv
[
0
].
as_int
;
mv1
->
as_int
=
mi
->
bmi
[
3
].
as_mv
[
1
].
as_int
;
}
else
{
switch
(
mbmi
->
mode
)
{
case
NEARMV
:
mv0
->
as_int
=
nearmv
[
0
].
as_int
;
if
(
is_compound
)
mv1
->
as_int
=
nearmv
[
1
].
as_int
;
break
;
case
NEARESTMV
:
mv0
->
as_int
=
nearest
[
0
].
as_int
;
if
(
is_compound
)
mv1
->
as_int
=
nearest
[
1
].
as_int
;
break
;
case
ZEROMV
:
mv0
->
as_int
=
0
;
if
(
is_compound
)
mv1
->
as_int
=
0
;
break
;
case
NEWMV
:
read_mv
(
r
,
&
mv0
->
as_mv
,
&
best
[
0
].
as_mv
,
nmvc
,
&
cm
->
counts
.
mv
,
allow_hp
);
if
(
is_compound
)
read_mv
(
r
,
&
mv1
->
as_mv
,
&
best
[
1
].
as_mv
,
nmvc
,
&
cm
->
counts
.
mv
,
allow_hp
);
break
;
default:
assert
(
!
"Invalid inter mode value"
);
}
assert
(
mv0
->
as_mv
.
row
<
MV_UPP
&&
mv0
->
as_mv
.
row
>
MV_LOW
);
assert
(
mv0
->
as_mv
.
col
<
MV_UPP
&&
mv0
->
as_mv
.
col
>
MV_LOW
);
if
(
is_compound
)
{
assert
(
mv1
->
as_mv
.
row
<
MV_UPP
&&
mv1
->
as_mv
.
row
>
MV_LOW
);
assert
(
mv1
->
as_mv
.
col
<
MV_UPP
&&
mv1
->
as_mv
.
col
>
MV_LOW
);
}
mbmi
->
mv
[
0
].
as_int
=
mi
->
bmi
[
3
].
as_mv
[
0
].
as_int
;
mbmi
->
mv
[
1
].
as_int
=
mi
->
bmi
[
3
].
as_mv
[
1
].
as_int
;
}
else
{
assign_mv
(
cm
,
mbmi
->
mode
,
mbmi
->
mv
,
best
,
nearest
,
nearmv
,
is_compound
,
allow_hp
,
r
);
}
}
...
...
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