Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
6c2082db
Commit
6c2082db
authored
Oct 02, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Oct 02, 2013
Browse files
Merge "Adding read_intra_mode_{y, uv} functions for clarity."
parents
3c4e9e34
771f3ef5
Changes
1
Show whitespace changes
Inline
Side-by-side
vp9/decoder/vp9_decodemv.c
View file @
6c2082db
...
...
@@ -30,9 +30,25 @@ static MB_PREDICTION_MODE read_intra_mode(vp9_reader *r, const vp9_prob *p) {
return
(
MB_PREDICTION_MODE
)
treed_read
(
r
,
vp9_intra_mode_tree
,
p
);
}
static
MB_PREDICTION_MODE
read_intra_mode_y
(
VP9_COMMON
*
cm
,
vp9_reader
*
r
,
int
size_group
)
{
const
MB_PREDICTION_MODE
y_mode
=
read_intra_mode
(
r
,
cm
->
fc
.
y_mode_prob
[
size_group
]);
++
cm
->
counts
.
y_mode
[
size_group
][
y_mode
];
return
y_mode
;
}
static
MB_PREDICTION_MODE
read_intra_mode_uv
(
VP9_COMMON
*
cm
,
vp9_reader
*
r
,
MB_PREDICTION_MODE
y_mode
)
{
const
MB_PREDICTION_MODE
uv_mode
=
read_intra_mode
(
r
,
cm
->
fc
.
uv_mode_prob
[
y_mode
]);
++
cm
->
counts
.
uv_mode
[
y_mode
][
uv_mode
];
return
uv_mode
;
}
static
MB_PREDICTION_MODE
read_inter_mode
(
VP9_COMMON
*
cm
,
vp9_reader
*
r
,
uint8_t
context
)
{
MB_PREDICTION_MODE
mode
=
treed_read
(
r
,
vp9_inter_mode_tree
,
const
MB_PREDICTION_MODE
mode
=
treed_read
(
r
,
vp9_inter_mode_tree
,
cm
->
fc
.
inter_mode_probs
[
context
]);
++
cm
->
counts
.
inter_mode
[
context
][
inter_mode_offset
(
mode
)];
return
mode
;
...
...
@@ -363,9 +379,7 @@ static void read_intra_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
mbmi
->
ref_frame
[
1
]
=
NONE
;
if
(
bsize
>=
BLOCK_8X8
)
{
const
int
size_group
=
size_group_lookup
[
bsize
];
mbmi
->
mode
=
read_intra_mode
(
r
,
cm
->
fc
.
y_mode_prob
[
size_group
]);
cm
->
counts
.
y_mode
[
size_group
][
mbmi
->
mode
]
++
;
mbmi
->
mode
=
read_intra_mode_y
(
cm
,
r
,
size_group_lookup
[
bsize
]);
}
else
{
// Only 4x4, 4x8, 8x4 blocks
const
int
num_4x4_w
=
num_4x4_blocks_wide_lookup
[
bsize
];
// 1 or 2
...
...
@@ -375,10 +389,8 @@ static void read_intra_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
for
(
idy
=
0
;
idy
<
2
;
idy
+=
num_4x4_h
)
{
for
(
idx
=
0
;
idx
<
2
;
idx
+=
num_4x4_w
)
{
const
int
ib
=
idy
*
2
+
idx
;
const
int
b_mode
=
read_intra_mode
(
r
,
cm
->
fc
.
y_mode_prob
[
0
]
);
const
int
b_mode
=
read_intra_mode
_y
(
cm
,
r
,
0
);
mi
->
bmi
[
ib
].
as_mode
=
b_mode
;
cm
->
counts
.
y_mode
[
0
][
b_mode
]
++
;
if
(
num_4x4_h
==
2
)
mi
->
bmi
[
ib
+
2
].
as_mode
=
b_mode
;
if
(
num_4x4_w
==
2
)
...
...
@@ -388,8 +400,7 @@ static void read_intra_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
mbmi
->
mode
=
mi
->
bmi
[
3
].
as_mode
;
}
mbmi
->
uv_mode
=
read_intra_mode
(
r
,
cm
->
fc
.
uv_mode_prob
[
mbmi
->
mode
]);
cm
->
counts
.
uv_mode
[
mbmi
->
mode
][
mbmi
->
uv_mode
]
++
;
mbmi
->
uv_mode
=
read_intra_mode_uv
(
cm
,
r
,
mbmi
->
mode
);
}
static
int
read_is_inter_block
(
VP9D_COMP
*
pbi
,
int
segment_id
,
vp9_reader
*
r
)
{
...
...
Write
Preview
Supports
Markdown
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