Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
aom-rav1e
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
aom-rav1e
Commits
974a2713
Commit
974a2713
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Adding read_reference_mode() function."
parents
68a0f40c
6c217d97
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/decoder/vp9_decodemv.c
+24
-19
24 additions, 19 deletions
vp9/decoder/vp9_decodemv.c
with
24 additions
and
19 deletions
vp9/decoder/vp9_decodemv.c
+
24
−
19
View file @
974a2713
...
...
@@ -260,6 +260,16 @@ static INLINE void read_mv(vp9_reader *r, MV *mv, const MV *ref,
mv
->
col
=
ref
->
col
+
diff
.
col
;
}
static
COMPPREDMODE_TYPE
read_reference_mode
(
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
vp9_reader
*
r
)
{
const
int
ctx
=
vp9_get_pred_context_comp_inter_inter
(
cm
,
xd
);
const
int
mode
=
vp9_read
(
r
,
cm
->
fc
.
comp_inter_prob
[
ctx
]);
if
(
!
cm
->
frame_parallel_decoding_mode
)
++
cm
->
counts
.
comp_inter
[
ctx
][
mode
];
return
mode
;
// SINGLE_PREDICTION_ONLY or COMP_PREDICTION_ONLY
}
// Read the referncence frame
static
void
read_ref_frames
(
VP9_COMMON
*
const
cm
,
MACROBLOCKD
*
const
xd
,
vp9_reader
*
r
,
...
...
@@ -271,27 +281,20 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd,
ref_frame
[
0
]
=
vp9_get_segdata
(
&
cm
->
seg
,
segment_id
,
SEG_LVL_REF_FRAME
);
ref_frame
[
1
]
=
NONE
;
}
else
{
const
int
comp_ctx
=
vp9_get_pred_context_comp_inter_inter
(
cm
,
xd
);
int
is_comp
;
if
(
cm
->
comp_pred_mode
==
HYBRID_PREDICTION
)
{
is_comp
=
vp9_read
(
r
,
fc
->
comp_inter_prob
[
comp_ctx
]);
if
(
!
cm
->
frame_parallel_decoding_mode
)
++
counts
->
comp_inter
[
comp_ctx
][
is_comp
];
}
else
{
is_comp
=
cm
->
comp_pred_mode
==
COMP_PREDICTION_ONLY
;
}
const
COMPPREDMODE_TYPE
mode
=
(
cm
->
comp_pred_mode
==
HYBRID_PREDICTION
)
?
read_reference_mode
(
cm
,
xd
,
r
)
:
cm
->
comp_pred_mode
;
// FIXME(rbultje) I'm pretty sure this breaks segmentation ref frame coding
if
(
is_comp
)
{
const
int
fix_ref_
idx
=
cm
->
ref_frame_sign_bias
[
cm
->
comp_fixed_ref
];
const
int
ref_
ctx
=
vp9_get_pred_context_comp_ref_p
(
cm
,
xd
);
const
int
b
=
vp9_read
(
r
,
fc
->
comp_ref_prob
[
ref_
ctx
]);
if
(
mode
==
COMP_PREDICTION_ONLY
)
{
const
int
idx
=
cm
->
ref_frame_sign_bias
[
cm
->
comp_fixed_ref
];
const
int
ctx
=
vp9_get_pred_context_comp_ref_p
(
cm
,
xd
);
const
int
b
it
=
vp9_read
(
r
,
fc
->
comp_ref_prob
[
ctx
]);
if
(
!
cm
->
frame_parallel_decoding_mode
)
++
counts
->
comp_ref
[
ref_
ctx
][
b
];
ref_frame
[
fix_ref_
idx
]
=
cm
->
comp_fixed_ref
;
ref_frame
[
!
fix_ref_
idx
]
=
cm
->
comp_var_ref
[
b
];
}
else
{
++
counts
->
comp_ref
[
ctx
][
b
it
];
ref_frame
[
idx
]
=
cm
->
comp_fixed_ref
;
ref_frame
[
!
idx
]
=
cm
->
comp_var_ref
[
b
it
];
}
else
if
(
mode
==
SINGLE_PREDICTION_ONLY
)
{
const
int
ctx0
=
vp9_get_pred_context_single_ref_p1
(
xd
);
const
int
bit0
=
vp9_read
(
r
,
fc
->
single_ref_prob
[
ctx0
][
0
]);
if
(
!
cm
->
frame_parallel_decoding_mode
)
...
...
@@ -299,14 +302,16 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd,
if
(
bit0
)
{
const
int
ctx1
=
vp9_get_pred_context_single_ref_p2
(
xd
);
const
int
bit1
=
vp9_read
(
r
,
fc
->
single_ref_prob
[
ctx1
][
1
]);
ref_frame
[
0
]
=
bit1
?
ALTREF_FRAME
:
GOLDEN_FRAME
;
if
(
!
cm
->
frame_parallel_decoding_mode
)
++
counts
->
single_ref
[
ctx1
][
1
][
bit1
];
ref_frame
[
0
]
=
bit1
?
ALTREF_FRAME
:
GOLDEN_FRAME
;
}
else
{
ref_frame
[
0
]
=
LAST_FRAME
;
}
ref_frame
[
1
]
=
NONE
;
}
else
{
assert
(
!
"Invalid prediction mode."
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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