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
Open sidebar
Xiph.Org
aom-rav1e
Commits
ef98a8f6
Commit
ef98a8f6
authored
Apr 15, 2016
by
Scott LaVarnway
Browse files
VP9: inline vp9_get_intra_inter_context()
Change-Id: I71366140799b9b39474b9b459082cdb250bd1905
parent
9c2ed00c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
29 deletions
+25
-29
vp9/common/vp9_pred_common.c
vp9/common/vp9_pred_common.c
+0
-25
vp9/common/vp9_pred_common.h
vp9/common/vp9_pred_common.h
+23
-2
vp9/decoder/vp9_decodemv.c
vp9/decoder/vp9_decodemv.c
+1
-1
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodeframe.c
+1
-1
No files found.
vp9/common/vp9_pred_common.c
View file @
ef98a8f6
...
...
@@ -36,31 +36,6 @@ int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
return
SWITCHABLE_FILTERS
;
}
// The mode info data structure has a one element border above and to the
// left of the entries corresponding to real macroblocks.
// The prediction flags in these dummy entries are initialized to 0.
// 0 - inter/inter, inter/--, --/inter, --/--
// 1 - intra/inter, inter/intra
// 2 - intra/--, --/intra
// 3 - intra/intra
int
vp9_get_intra_inter_context
(
const
MACROBLOCKD
*
xd
)
{
const
MODE_INFO
*
const
above_mi
=
xd
->
above_mi
;
const
MODE_INFO
*
const
left_mi
=
xd
->
left_mi
;
const
int
has_above
=
!!
above_mi
;
const
int
has_left
=
!!
left_mi
;
if
(
has_above
&&
has_left
)
{
// both edges available
const
int
above_intra
=
!
is_inter_block
(
above_mi
);
const
int
left_intra
=
!
is_inter_block
(
left_mi
);
return
left_intra
&&
above_intra
?
3
:
left_intra
||
above_intra
;
}
else
if
(
has_above
||
has_left
)
{
// one edge available
return
2
*
!
is_inter_block
(
has_above
?
above_mi
:
left_mi
);
}
else
{
return
0
;
}
}
int
vp9_get_reference_mode_context
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
int
ctx
;
...
...
vp9/common/vp9_pred_common.h
View file @
ef98a8f6
...
...
@@ -68,11 +68,32 @@ static INLINE vpx_prob vp9_get_skip_prob(const VP9_COMMON *cm,
int
vp9_get_pred_context_switchable_interp
(
const
MACROBLOCKD
*
xd
);
int
vp9_get_intra_inter_context
(
const
MACROBLOCKD
*
xd
);
// The mode info data structure has a one element border above and to the
// left of the entries corresponding to real macroblocks.
// The prediction flags in these dummy entries are initialized to 0.
// 0 - inter/inter, inter/--, --/inter, --/--
// 1 - intra/inter, inter/intra
// 2 - intra/--, --/intra
// 3 - intra/intra
static
INLINE
int
get_intra_inter_context
(
const
MACROBLOCKD
*
xd
)
{
const
MODE_INFO
*
const
above_mi
=
xd
->
above_mi
;
const
MODE_INFO
*
const
left_mi
=
xd
->
left_mi
;
const
int
has_above
=
!!
above_mi
;
const
int
has_left
=
!!
left_mi
;
if
(
has_above
&&
has_left
)
{
// both edges available
const
int
above_intra
=
!
is_inter_block
(
above_mi
);
const
int
left_intra
=
!
is_inter_block
(
left_mi
);
return
left_intra
&&
above_intra
?
3
:
left_intra
||
above_intra
;
}
else
if
(
has_above
||
has_left
)
{
// one edge available
return
2
*
!
is_inter_block
(
has_above
?
above_mi
:
left_mi
);
}
return
0
;
}
static
INLINE
vpx_prob
vp9_get_intra_inter_prob
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
->
intra_inter_prob
[
vp9_
get_intra_inter_context
(
xd
)];
return
cm
->
fc
->
intra_inter_prob
[
get_intra_inter_context
(
xd
)];
}
int
vp9_get_reference_mode_context
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
);
...
...
vp9/decoder/vp9_decodemv.c
View file @
ef98a8f6
...
...
@@ -483,7 +483,7 @@ static int read_is_inter_block(VP9_COMMON *const cm, MACROBLOCKD *const xd,
if
(
segfeature_active
(
&
cm
->
seg
,
segment_id
,
SEG_LVL_REF_FRAME
))
{
return
get_segdata
(
&
cm
->
seg
,
segment_id
,
SEG_LVL_REF_FRAME
)
!=
INTRA_FRAME
;
}
else
{
const
int
ctx
=
vp9_
get_intra_inter_context
(
xd
);
const
int
ctx
=
get_intra_inter_context
(
xd
);
const
int
is_inter
=
vpx_read
(
r
,
cm
->
fc
->
intra_inter_prob
[
ctx
]);
FRAME_COUNTS
*
counts
=
xd
->
counts
;
if
(
counts
)
...
...
vp9/encoder/vp9_encodeframe.c
View file @
ef98a8f6
...
...
@@ -1404,7 +1404,7 @@ static void update_stats(VP9_COMMON *cm, ThreadData *td) {
const
int
seg_ref_active
=
segfeature_active
(
&
cm
->
seg
,
mi
->
segment_id
,
SEG_LVL_REF_FRAME
);
if
(
!
seg_ref_active
)
{
counts
->
intra_inter
[
vp9_
get_intra_inter_context
(
xd
)][
inter_block
]
++
;
counts
->
intra_inter
[
get_intra_inter_context
(
xd
)][
inter_block
]
++
;
// If the segment reference feature is enabled we have only a single
// reference frame allowed for the segment so exclude it from
// the reference frame counts used to work out probabilities.
...
...
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