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
156d9120
Commit
156d9120
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Code cleanup inside vp9_get_pred_context function." into experimental
parents
97ac785e
de7c25c9
v1.14.0-linphone
1.4.X
experimental
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m29-baseline
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
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
stable-vp9-decoder
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/common/vp9_pred_common.c
+42
-53
vp9/common/vp9_pred_common.c
with
42 additions
and
53 deletions
vp9/common/vp9_pred_common.c
+
42
−
53
View file @
156d9120
...
...
@@ -23,83 +23,72 @@ unsigned char vp9_get_pred_context(const VP9_COMMON *const cm,
const
MACROBLOCKD
*
const
xd
,
PRED_ID
pred_id
)
{
int
pred_context
;
MODE_INFO
*
m
=
xd
->
mode_info_context
;
const
MODE_INFO
*
const
mi
=
xd
->
mode_info_context
;
const
MODE_INFO
*
const
above_mi
=
mi
-
cm
->
mode_info_stride
;
const
MODE_INFO
*
const
left_mi
=
mi
-
1
;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
switch
(
pred_id
)
{
case
PRED_SEG_ID
:
pred_context
=
(
m
-
cm
->
mode_info_stride
)
->
mbmi
.
seg_id_predicted
;
pred_context
=
above_mi
->
mbmi
.
seg_id_predicted
;
if
(
xd
->
left_available
)
pred_context
+=
(
m
-
1
)
->
mbmi
.
seg_id_predicted
;
pred_context
+=
left_mi
->
mbmi
.
seg_id_predicted
;
break
;
case
PRED_REF
:
pred_context
=
(
m
-
cm
->
mode_info_stride
)
->
mbmi
.
ref_predicted
;
pred_context
=
above_mi
->
mbmi
.
ref_predicted
;
if
(
xd
->
left_available
)
pred_context
+=
(
m
-
1
)
->
mbmi
.
ref_predicted
;
pred_context
+=
left_mi
->
mbmi
.
ref_predicted
;
break
;
case
PRED_COMP
:
// Context based on use of comp pred flag by neighbours
// pred_context =
// ((m - 1)->mbmi.second_ref_frame > INTRA_FRAME) +
// ((m - cm->mode_info_stride)->mbmi.second_ref_frame > INTRA_FRAME);
// Context based on mode and reference frame
// if ( m->mbmi.ref_frame == LAST_FRAME )
// pred_context = 0 + (m->mbmi.mode != ZEROMV);
// else if ( m->mbmi.ref_frame == GOLDEN_FRAME )
// pred_context = 2 + (m->mbmi.mode != ZEROMV);
// else
// pred_context = 4 + (m->mbmi.mode != ZEROMV);
if
(
m
->
mbmi
.
ref_frame
==
LAST_FRAME
)
if
(
mi
->
mbmi
.
ref_frame
==
LAST_FRAME
)
pred_context
=
0
;
else
pred_context
=
1
;
break
;
case
PRED_MBSKIP
:
pred_context
=
(
m
-
cm
->
mode_info_stride
)
->
mbmi
.
mb_skip_coeff
;
pred_context
=
above_mi
->
mbmi
.
mb_skip_coeff
;
if
(
xd
->
left_available
)
pred_context
+=
(
m
-
1
)
->
mbmi
.
mb_skip_coeff
;
pred_context
+=
left_mi
->
mbmi
.
mb_skip_coeff
;
break
;
case
PRED_SWITCHABLE_INTERP
:
{
int
left_in_image
=
xd
->
left_available
&&
(
m
-
1
)
->
mbmi
.
mb_in_image
;
int
above_in_image
=
(
m
-
cm
->
mode_info_stride
)
->
mbmi
.
mb_in_image
;
int
left_mode
=
(
m
-
1
)
->
mbmi
.
mode
;
int
above_mode
=
(
m
-
cm
->
mode_info_stride
)
->
mbmi
.
mode
;
int
left_interp
,
above_interp
;
if
(
left_in_image
&&
left_mode
>=
NEARESTMV
&&
left_mode
<=
SPLITMV
)
left_interp
=
vp9_switchable_interp_map
[(
m
-
1
)
->
mbmi
.
interp_filter
];
else
left_interp
=
VP9_SWITCHABLE_FILTERS
;
assert
(
left_interp
!=
-
1
);
if
(
above_in_image
&&
above_mode
>=
NEARESTMV
&&
above_mode
<=
SPLITMV
)
above_interp
=
vp9_switchable_interp_map
[
(
m
-
cm
->
mode_info_stride
)
->
mbmi
.
interp_filter
];
else
above_interp
=
VP9_SWITCHABLE_FILTERS
;
assert
(
above_interp
!=
-
1
);
if
(
left_interp
==
above_interp
)
pred_context
=
left_interp
;
else
if
(
left_interp
==
VP9_SWITCHABLE_FILTERS
&&
above_interp
!=
VP9_SWITCHABLE_FILTERS
)
pred_context
=
above_interp
;
else
if
(
left_interp
!=
VP9_SWITCHABLE_FILTERS
&&
above_interp
==
VP9_SWITCHABLE_FILTERS
)
pred_context
=
left_interp
;
else
pred_context
=
VP9_SWITCHABLE_FILTERS
;
}
case
PRED_SWITCHABLE_INTERP
:
{
// left
const
int
left_in_image
=
xd
->
left_available
&&
left_mi
->
mbmi
.
mb_in_image
;
const
int
left_mv_pred
=
left_mi
->
mbmi
.
mode
>=
NEARESTMV
&&
left_mi
->
mbmi
.
mode
<=
SPLITMV
;
const
int
left_interp
=
left_in_image
&&
left_mv_pred
?
vp9_switchable_interp_map
[
left_mi
->
mbmi
.
interp_filter
]
:
VP9_SWITCHABLE_FILTERS
;
// above
const
int
above_in_image
=
above_mi
->
mbmi
.
mb_in_image
;
const
int
above_mv_pred
=
above_mi
->
mbmi
.
mode
>=
NEARESTMV
&&
above_mi
->
mbmi
.
mode
<=
SPLITMV
;
const
int
above_interp
=
above_in_image
&&
above_mv_pred
?
vp9_switchable_interp_map
[
above_mi
->
mbmi
.
interp_filter
]
:
VP9_SWITCHABLE_FILTERS
;
assert
(
left_interp
!=
-
1
);
assert
(
above_interp
!=
-
1
);
if
(
left_interp
==
above_interp
)
pred_context
=
left_interp
;
else
if
(
left_interp
==
VP9_SWITCHABLE_FILTERS
&&
above_interp
!=
VP9_SWITCHABLE_FILTERS
)
pred_context
=
above_interp
;
else
if
(
left_interp
!=
VP9_SWITCHABLE_FILTERS
&&
above_interp
==
VP9_SWITCHABLE_FILTERS
)
pred_context
=
left_interp
;
else
pred_context
=
VP9_SWITCHABLE_FILTERS
;
break
;
}
default:
pred_context
=
0
;
// *** add error trap code.
...
...
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