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
e7910316
Commit
e7910316
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Renames for consistency in vp9_pred_common.{c, h} files."
parents
3897de60
3274fc30
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
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
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vp9/common/vp9_pred_common.c
+35
-38
vp9/common/vp9_pred_common.c
vp9/common/vp9_pred_common.h
+6
-8
vp9/common/vp9_pred_common.h
with
41 additions
and
46 deletions
vp9/common/vp9_pred_common.c
+
35
−
38
View file @
e7910316
...
...
@@ -52,10 +52,10 @@ int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
int
vp9_get_intra_inter_context
(
const
MACROBLOCKD
*
xd
)
{
const
MB_MODE_INFO
*
const
above_mbmi
=
get_above_mbmi
(
get_above_mi
(
xd
));
const
MB_MODE_INFO
*
const
left_mbmi
=
get_left_mbmi
(
get_left_mi
(
xd
));
const
int
abov
e_in_imag
e
=
above_mbmi
!=
NULL
;
const
int
left
_in_image
=
left_mbmi
!=
NULL
;
const
int
above_intra
=
abov
e_in_imag
e
?
!
is_inter_block
(
above_mbmi
)
:
1
;
const
int
left_intra
=
left
_in_image
?
!
is_inter_block
(
left_mbmi
)
:
1
;
const
int
has_
above
=
above_mbmi
!=
NULL
;
const
int
has_
left
=
left_mbmi
!=
NULL
;
const
int
above_intra
=
has_
above
?
!
is_inter_block
(
above_mbmi
)
:
1
;
const
int
left_intra
=
has_
left
?
!
is_inter_block
(
left_mbmi
)
:
1
;
// The mode info data structure has a one element border above and to the
// left of the entries corresponding to real macroblocks.
...
...
@@ -64,11 +64,11 @@ int vp9_get_intra_inter_context(const MACROBLOCKD *xd) {
// 1 - intra/inter, inter/intra
// 2 - intra/--, --/intra
// 3 - intra/intra
if
(
above_in_image
&&
left_in_image
)
// both edges available
if
(
has_above
&&
has_left
)
// both edges available
return
left_intra
&&
above_intra
?
3
:
left_intra
||
above_intra
;
else
if
(
above_in_image
||
left_in_image
)
// one edge available
return
2
*
(
abov
e_in_imag
e
?
above_intra
:
left_intra
);
else
if
(
has_above
||
has_left
)
// one edge available
return
2
*
(
has_
above
?
above_intra
:
left_intra
);
else
return
0
;
}
...
...
@@ -78,13 +78,13 @@ int vp9_get_reference_mode_context(const VP9_COMMON *cm,
int
ctx
;
const
MB_MODE_INFO
*
const
above_mbmi
=
get_above_mbmi
(
get_above_mi
(
xd
));
const
MB_MODE_INFO
*
const
left_mbmi
=
get_left_mbmi
(
get_left_mi
(
xd
));
const
int
abov
e_in_imag
e
=
above_mbmi
!=
NULL
;
const
int
left
_in_image
=
left_mbmi
!=
NULL
;
const
int
has_
above
=
above_mbmi
!=
NULL
;
const
int
has_
left
=
left_mbmi
!=
NULL
;
// 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.
if
(
above_in_image
&&
left_in_image
)
{
// both edges available
if
(
has_above
&&
has_left
)
{
// both edges available
if
(
!
has_second_ref
(
above_mbmi
)
&&
!
has_second_ref
(
left_mbmi
))
// neither edge uses comp pred (0/1)
ctx
=
(
above_mbmi
->
ref_frame
[
0
]
==
cm
->
comp_fixed_ref
)
^
...
...
@@ -99,8 +99,8 @@ int vp9_get_reference_mode_context(const VP9_COMMON *cm,
!
is_inter_block
(
left_mbmi
));
else
// both edges use comp pred (4)
ctx
=
4
;
}
else
if
(
above_in_image
||
left_in_image
)
{
// one edge available
const
MB_MODE_INFO
*
edge_mbmi
=
abov
e_in_imag
e
?
above_mbmi
:
left_mbmi
;
}
else
if
(
has_above
||
has_left
)
{
// one edge available
const
MB_MODE_INFO
*
edge_mbmi
=
has_
above
?
above_mbmi
:
left_mbmi
;
if
(
!
has_second_ref
(
edge_mbmi
))
// edge does not use comp pred (0/1)
...
...
@@ -116,8 +116,8 @@ int vp9_get_reference_mode_context(const VP9_COMMON *cm,
}
// Returns a context number for the given MB prediction signal
unsigned
char
vp9_get_pred_context_comp_ref_p
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
int
vp9_get_pred_context_comp_ref_p
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
int
pred_context
;
const
MODE_INFO
*
const
above_mi
=
get_above_mi
(
xd
);
const
MODE_INFO
*
const
left_mi
=
get_left_mi
(
xd
);
...
...
@@ -197,21 +197,20 @@ unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
return
pred_context
;
}
unsigned
char
vp9_get_pred_context_single_ref_p1
(
const
MACROBLOCKD
*
xd
)
{
int
vp9_get_pred_context_single_ref_p1
(
const
MACROBLOCKD
*
xd
)
{
int
pred_context
;
const
MODE_INFO
*
const
above_mi
=
get_above_mi
(
xd
);
const
MODE_INFO
*
const
left_mi
=
get_left_mi
(
xd
);
const
MB_MODE_INFO
*
const
above_mbmi
=
get_above_mbmi
(
above_mi
);
const
MB_MODE_INFO
*
const
left_mbmi
=
get_left_mbmi
(
left_mi
);
const
int
above_in_image
=
above_mi
!=
NULL
;
const
int
left_in_image
=
left_mi
!=
NULL
;
const
int
above_intra
=
above_in_image
?
!
is_inter_block
(
above_mbmi
)
:
1
;
const
int
left_intra
=
left_in_image
?
!
is_inter_block
(
left_mbmi
)
:
1
;
const
MB_MODE_INFO
*
const
above_mbmi
=
get_above_mbmi
(
get_above_mi
(
xd
));
const
MB_MODE_INFO
*
const
left_mbmi
=
get_left_mbmi
(
get_left_mi
(
xd
));
const
int
has_above
=
above_mbmi
!=
NULL
;
const
int
has_left
=
left_mbmi
!=
NULL
;
const
int
above_intra
=
has_above
?
!
is_inter_block
(
above_mbmi
)
:
1
;
const
int
left_intra
=
has_left
?
!
is_inter_block
(
left_mbmi
)
:
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.
if
(
above_in_image
&&
left_in_image
)
{
// both edges available
if
(
has_above
&&
has_left
)
{
// both edges available
if
(
above_intra
&&
left_intra
)
{
// intra/intra
pred_context
=
2
;
}
else
if
(
above_intra
||
left_intra
)
{
// intra/inter or inter/intra
...
...
@@ -244,8 +243,8 @@ unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
pred_context
=
crf1
==
LAST_FRAME
||
crf2
==
LAST_FRAME
;
}
}
}
else
if
(
above_in_image
||
left_in_image
)
{
// one edge available
const
MB_MODE_INFO
*
edge_mbmi
=
abov
e_in_imag
e
?
above_mbmi
:
left_mbmi
;
}
else
if
(
has_above
||
has_left
)
{
// one edge available
const
MB_MODE_INFO
*
edge_mbmi
=
has_
above
?
above_mbmi
:
left_mbmi
;
if
(
!
is_inter_block
(
edge_mbmi
))
{
// intra
pred_context
=
2
;
}
else
{
// inter
...
...
@@ -263,22 +262,20 @@ unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
return
pred_context
;
}
unsigned
char
vp9_get_pred_context_single_ref_p2
(
const
MACROBLOCKD
*
xd
)
{
int
vp9_get_pred_context_single_ref_p2
(
const
MACROBLOCKD
*
xd
)
{
int
pred_context
;
const
MODE_INFO
*
const
above_mi
=
get_above_mi
(
xd
);
const
MODE_INFO
*
const
left_mi
=
get_left_mi
(
xd
);
const
MB_MODE_INFO
*
const
above_mbmi
=
get_above_mbmi
(
above_mi
);
const
MB_MODE_INFO
*
const
left_mbmi
=
get_left_mbmi
(
left_mi
);
const
int
above_in_image
=
above_mi
!=
NULL
;
const
int
left_in_image
=
left_mi
!=
NULL
;
const
int
above_intra
=
above_in_image
?
!
is_inter_block
(
above_mbmi
)
:
1
;
const
int
left_intra
=
left_in_image
?
!
is_inter_block
(
left_mbmi
)
:
1
;
const
MB_MODE_INFO
*
const
above_mbmi
=
get_above_mbmi
(
get_above_mi
(
xd
));
const
MB_MODE_INFO
*
const
left_mbmi
=
get_left_mbmi
(
get_left_mi
(
xd
));
const
int
has_above
=
above_mbmi
!=
NULL
;
const
int
has_left
=
left_mbmi
!=
NULL
;
const
int
above_intra
=
has_above
?
!
is_inter_block
(
above_mbmi
)
:
1
;
const
int
left_intra
=
has_left
?
!
is_inter_block
(
left_mbmi
)
:
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.
if
(
above_in_image
&&
left_in_image
)
{
// both edges available
if
(
has_above
&&
has_left
)
{
// both edges available
if
(
above_intra
&&
left_intra
)
{
// intra/intra
pred_context
=
2
;
}
else
if
(
above_intra
||
left_intra
)
{
// intra/inter or inter/intra
...
...
@@ -332,8 +329,8 @@ unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
pred_context
=
1
+
2
*
(
crf1
==
GOLDEN_FRAME
||
crf2
==
GOLDEN_FRAME
);
}
}
}
else
if
(
above_in_image
||
left_in_image
)
{
// one edge available
const
MB_MODE_INFO
*
edge_mbmi
=
abov
e_in_imag
e
?
above_mbmi
:
left_mbmi
;
}
else
if
(
has_above
||
has_left
)
{
// one edge available
const
MB_MODE_INFO
*
edge_mbmi
=
has_
above
?
above_mbmi
:
left_mbmi
;
if
(
!
is_inter_block
(
edge_mbmi
)
||
(
edge_mbmi
->
ref_frame
[
0
]
==
LAST_FRAME
&&
!
has_second_ref
(
edge_mbmi
)))
...
...
This diff is collapsed.
Click to expand it.
vp9/common/vp9_pred_common.h
+
6
−
8
View file @
e7910316
...
...
@@ -69,8 +69,8 @@ static INLINE vp9_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm,
return
cm
->
fc
.
comp_inter_prob
[
vp9_get_reference_mode_context
(
cm
,
xd
)];
}
unsigned
char
vp9_get_pred_context_comp_ref_p
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
);
int
vp9_get_pred_context_comp_ref_p
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
);
static
INLINE
vp9_prob
vp9_get_pred_prob_comp_ref_p
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
...
...
@@ -78,20 +78,18 @@ static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
return
cm
->
fc
.
comp_ref_prob
[
pred_context
];
}
unsigned
char
vp9_get_pred_context_single_ref_p1
(
const
MACROBLOCKD
*
xd
);
int
vp9_get_pred_context_single_ref_p1
(
const
MACROBLOCKD
*
xd
);
static
INLINE
vp9_prob
vp9_get_pred_prob_single_ref_p1
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
const
int
pred_context
=
vp9_get_pred_context_single_ref_p1
(
xd
);
return
cm
->
fc
.
single_ref_prob
[
pred_context
][
0
];
return
cm
->
fc
.
single_ref_prob
[
vp9_get_pred_context_single_ref_p1
(
xd
)][
0
];
}
unsigned
char
vp9_get_pred_context_single_ref_p2
(
const
MACROBLOCKD
*
xd
);
int
vp9_get_pred_context_single_ref_p2
(
const
MACROBLOCKD
*
xd
);
static
INLINE
vp9_prob
vp9_get_pred_prob_single_ref_p2
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
const
int
pred_context
=
vp9_get_pred_context_single_ref_p2
(
xd
);
return
cm
->
fc
.
single_ref_prob
[
pred_context
][
1
];
return
cm
->
fc
.
single_ref_prob
[
vp9_get_pred_context_single_ref_p2
(
xd
)][
1
];
}
int
vp9_get_tx_size_context
(
const
MACROBLOCKD
*
xd
);
...
...
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