summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2018-09-11 09:21:45 -0700
committerJingning Han <jingning@google.com>2018-09-11 09:24:27 -0700
commitb8b471103c5e5638a5c000d5feb9a008f6016abe (patch)
tree189a51fbb3a332cb402b4cf38e6cb8d88c9e7563 /vp9/encoder
parenta2192701b1ff5f79bc53f75199f2d9e3bc42df12 (diff)
downloadlibvpx-b8b471103c5e5638a5c000d5feb9a008f6016abe.tar
libvpx-b8b471103c5e5638a5c000d5feb9a008f6016abe.tar.gz
libvpx-b8b471103c5e5638a5c000d5feb9a008f6016abe.tar.bz2
libvpx-b8b471103c5e5638a5c000d5feb9a008f6016abe.zip
Localize variable definitions
Localize variable definitions in setup_frames() and two_pass_first_group_inter(). Change-Id: I66e842791d679be6d22cef50e0b395b5aa380eac
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encoder.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 226856e8a..07732bb4b 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -780,7 +780,6 @@ void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) {
static void setup_frame(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
- GF_GROUP *const gf_group = &cpi->twopass.gf_group;
// Set up entropy context depending on frame type. The decoder mandates
// the use of the default context, index 0, for keyframes and inter
// frames where the error_resilient_mode or intra_only flag is set. For
@@ -795,9 +794,11 @@ static void setup_frame(VP9_COMP *cpi) {
// TODO(jingning): Overwrite the frame_context_idx index in multi-layer ARF
// case. Need some further investigation on if we could apply this to single
// layer ARF case as well.
- if (cpi->multi_layer_arf && !cpi->use_svc)
+ if (cpi->multi_layer_arf && !cpi->use_svc) {
+ GF_GROUP *const gf_group = &cpi->twopass.gf_group;
cm->frame_context_idx = clamp(gf_group->layer_depth[gf_group->index] - 1, 0,
FRAME_CONTEXTS - 1);
+ }
if (cm->frame_type == KEY_FRAME) {
cpi->refresh_golden_frame = 1;
@@ -2919,11 +2920,11 @@ static int big_rate_miss(VP9_COMP *cpi) {
// test in two pass for the first
static int two_pass_first_group_inter(VP9_COMP *cpi) {
- TWO_PASS *const twopass = &cpi->twopass;
- GF_GROUP *const gf_group = &twopass->gf_group;
- const int gfg_index = gf_group->index;
-
if (cpi->oxcf.pass == 2) {
+ TWO_PASS *const twopass = &cpi->twopass;
+ GF_GROUP *const gf_group = &twopass->gf_group;
+ const int gfg_index = gf_group->index;
+
if (gfg_index == 0) return gf_group->update_type[gfg_index] == LF_UPDATE;
return gf_group->update_type[gfg_index - 1] != LF_UPDATE &&
gf_group->update_type[gfg_index] == LF_UPDATE;