Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
718feb0f
Commit
718feb0f
authored
Apr 02, 2015
by
Yaowu Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move ref_frame_cost computations into a function
Change-Id: Iebf2ad2b1db7e2874788fda8d55e67f4cb1149f1
parent
f26b8c84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_pickmode.c
+19
-12
No files found.
vp9/encoder/vp9_pickmode.c
View file @
718feb0f
...
...
@@ -965,6 +965,24 @@ void vp9_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost,
*
rd_cost
=
best_rdc
;
}
static
void
init_ref_frame_cost
(
VP9_COMMON
*
const
cm
,
MACROBLOCKD
*
const
xd
,
int
ref_frame_cost
[
MAX_REF_FRAMES
])
{
vp9_prob
intra_inter_p
=
vp9_get_intra_inter_prob
(
cm
,
xd
);
vp9_prob
ref_single_p1
=
vp9_get_pred_prob_single_ref_p1
(
cm
,
xd
);
vp9_prob
ref_single_p2
=
vp9_get_pred_prob_single_ref_p2
(
cm
,
xd
);
ref_frame_cost
[
INTRA_FRAME
]
=
vp9_cost_bit
(
intra_inter_p
,
0
);
ref_frame_cost
[
LAST_FRAME
]
=
ref_frame_cost
[
GOLDEN_FRAME
]
=
ref_frame_cost
[
ALTREF_FRAME
]
=
vp9_cost_bit
(
intra_inter_p
,
1
);
ref_frame_cost
[
LAST_FRAME
]
+=
vp9_cost_bit
(
ref_single_p1
,
0
);
ref_frame_cost
[
GOLDEN_FRAME
]
+=
vp9_cost_bit
(
ref_single_p1
,
1
);
ref_frame_cost
[
ALTREF_FRAME
]
+=
vp9_cost_bit
(
ref_single_p1
,
1
);
ref_frame_cost
[
GOLDEN_FRAME
]
+=
vp9_cost_bit
(
ref_single_p2
,
0
);
ref_frame_cost
[
ALTREF_FRAME
]
+=
vp9_cost_bit
(
ref_single_p2
,
1
);
}
typedef
struct
{
MV_REFERENCE_FRAME
ref_frame
;
PREDICTION_MODE
pred_mode
;
...
...
@@ -1043,19 +1061,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int
best_pred_sad
=
INT_MAX
;
int
best_early_term
=
0
;
int
ref_frame_cost
[
MAX_REF_FRAMES
];
vp9_prob
intra_inter_p
=
vp9_get_intra_inter_prob
(
cm
,
xd
);
vp9_prob
ref_single_p1
=
vp9_get_pred_prob_single_ref_p1
(
cm
,
xd
);
vp9_prob
ref_single_p2
=
vp9_get_pred_prob_single_ref_p2
(
cm
,
xd
);
ref_frame_cost
[
INTRA_FRAME
]
=
vp9_cost_bit
(
intra_inter_p
,
0
);
ref_frame_cost
[
LAST_FRAME
]
=
ref_frame_cost
[
GOLDEN_FRAME
]
=
ref_frame_cost
[
ALTREF_FRAME
]
=
vp9_cost_bit
(
intra_inter_p
,
1
);
ref_frame_cost
[
LAST_FRAME
]
+=
vp9_cost_bit
(
ref_single_p1
,
0
);
ref_frame_cost
[
GOLDEN_FRAME
]
+=
vp9_cost_bit
(
ref_single_p1
,
1
);
ref_frame_cost
[
ALTREF_FRAME
]
+=
vp9_cost_bit
(
ref_single_p1
,
1
);
ref_frame_cost
[
GOLDEN_FRAME
]
+=
vp9_cost_bit
(
ref_single_p2
,
0
);
ref_frame_cost
[
ALTREF_FRAME
]
+=
vp9_cost_bit
(
ref_single_p2
,
1
);
init_ref_frame_cost
(
cm
,
xd
,
ref_frame_cost
);
if
(
reuse_inter_pred
)
{
int
i
;
...
...
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