Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
bb5e2bf8
Commit
bb5e2bf8
authored
Sep 20, 2013
by
Dmitry Kovalev
Browse files
Adding best_mv[2] array instead of two variables.
Change-Id: I584fe50f73879f6a72fada45714ef80893b6d549
parent
24df77e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
vp9/common/vp9_blockd.h
View file @
bb5e2bf8
...
...
@@ -137,7 +137,7 @@ typedef struct {
TX_SIZE
tx_size
;
int_mv
mv
[
2
];
// for each reference frame used
int_mv
ref_mvs
[
MAX_REF_FRAMES
][
MAX_MV_REF_CANDIDATES
];
int_mv
best_mv
,
best_second_mv
;
int_mv
best_mv
[
2
]
;
uint8_t
mode_context
[
MAX_REF_FRAMES
];
...
...
vp9/encoder/vp9_bitstream.c
View file @
bb5e2bf8
...
...
@@ -484,17 +484,13 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
}
if
(
bsize
<
BLOCK_8X8
)
{
int
j
;
MB_PREDICTION_MODE
blockmode
;
int_mv
blockmv
;
const
int
num_4x4_blocks_wide
=
num_4x4_blocks_wide_lookup
[
bsize
];
const
int
num_4x4_blocks_high
=
num_4x4_blocks_high_lookup
[
bsize
];
int
idx
,
idy
;
for
(
idy
=
0
;
idy
<
2
;
idy
+=
num_4x4_blocks_high
)
{
for
(
idx
=
0
;
idx
<
2
;
idx
+=
num_4x4_blocks_wide
)
{
j
=
idy
*
2
+
idx
;
blockmode
=
x
->
partition_info
->
bmi
[
j
].
mode
;
blockmv
=
m
->
bmi
[
j
].
as_mv
[
0
];
const
int
j
=
idy
*
2
+
idx
;
const
MB_PREDICTION_MODE
blockmode
=
x
->
partition_info
->
bmi
[
j
].
mode
;
write_sb_mv_ref
(
bc
,
blockmode
,
mv_ref_p
);
++
cm
->
counts
.
inter_mode
[
mi
->
mode_context
[
rf
]]
[
inter_mode_offset
(
blockmode
)];
...
...
@@ -503,14 +499,12 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
#ifdef ENTROPY_STATS
active_section
=
11
;
#endif
vp9_encode_mv
(
cpi
,
bc
,
&
blockmv
.
as_mv
,
&
mi
->
best_mv
.
as_mv
,
nmvc
,
allow_hp
);
if
(
mi
->
ref_frame
[
1
]
>
INTRA_FRAME
)
vp9_encode_mv
(
cpi
,
bc
,
&
m
->
bmi
[
j
].
as_mv
[
1
].
as_mv
,
&
mi
->
best_second_mv
.
as_mv
,
nmvc
,
allow_hp
);
vp9_encode_mv
(
cpi
,
bc
,
&
m
->
bmi
[
j
].
as_mv
[
0
].
as_mv
,
&
mi
->
best_mv
[
0
].
as_mv
,
nmvc
,
allow_hp
);
if
(
has_second_ref
(
mi
))
vp9_encode_mv
(
cpi
,
bc
,
&
m
->
bmi
[
j
].
as_mv
[
1
].
as_mv
,
&
mi
->
best_mv
[
1
].
as_mv
,
nmvc
,
allow_hp
);
}
}
}
...
...
@@ -518,12 +512,12 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
#ifdef ENTROPY_STATS
active_section
=
5
;
#endif
vp9_encode_mv
(
cpi
,
bc
,
&
mi
->
mv
[
0
].
as_mv
,
&
mi
->
best_mv
.
as_mv
,
nmvc
,
allow_hp
);
vp9_encode_mv
(
cpi
,
bc
,
&
mi
->
mv
[
0
].
as_mv
,
&
mi
->
best_mv
[
0
].
as_mv
,
nmvc
,
allow_hp
);
if
(
mi
->
ref_frame
[
1
]
>
INTRA_FRAME
)
vp9_encode_mv
(
cpi
,
bc
,
&
mi
->
mv
[
1
].
as_mv
,
&
mi
->
best_second_mv
.
as_mv
,
nmvc
,
allow_hp
);
if
(
has_second_ref
(
mi
)
)
vp9_encode_mv
(
cpi
,
bc
,
&
mi
->
mv
[
1
].
as_mv
,
&
mi
->
best_mv
[
1
].
as_mv
,
nmvc
,
allow_hp
);
}
}
}
...
...
vp9/encoder/vp9_encodeframe.c
View file @
bb5e2bf8
...
...
@@ -438,8 +438,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
if
(
rf2
>
0
)
best_second_mv
.
as_int
=
mbmi
->
ref_mvs
[
rf2
][
0
].
as_int
;
}
mbmi
->
best_mv
.
as_int
=
best_mv
.
as_int
;
mbmi
->
best_
second_mv
.
as_int
=
best_second_mv
.
as_int
;
mbmi
->
best_mv
[
0
]
.
as_int
=
best_mv
.
as_int
;
mbmi
->
best_
mv
[
1
]
.
as_int
=
best_second_mv
.
as_int
;
vp9_update_nmv_count
(
cpi
,
x
,
&
best_mv
,
&
best_second_mv
);
}
...
...
Write
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!
Cancel
Please
register
or
sign in
to comment