summaryrefslogtreecommitdiff
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-11-16 08:13:46 +0100
committerAnton Khirnov <anton@khirnov.net>2014-11-17 09:26:45 +0100
commiteb335f3c5ce37f2b93c993e28404d113bee843bc (patch)
tree03570b8356766d6bf5d902893a37c465170f7849 /libavcodec/hevc.c
parent84c0ece5fd9569c0f31804f02a199ecd0e7d13d8 (diff)
hevc: reduce variable scope
Also, collapse the array into a scalar, since only one value is needed at a time.
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 2cbb35f07f..61ba0f013f 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1648,7 +1648,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
int x_cb = x0 >> log2_min_cb_size;
int y_cb = y0 >> log2_min_cb_size;
int ref_idx[2];
- int mvp_flag[2];
int x_pu, y_pu;
int i, j;
@@ -1667,6 +1666,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
partIdx, merge_idx, &current_mv);
} else {
enum InterPredIdc inter_pred_idc = PRED_L0;
+ int mvp_flag;
+
ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
if (s->sh.slice_type == B_SLICE)
inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH);
@@ -1678,10 +1679,10 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
}
current_mv.pred_flag[0] = 1;
hls_mvd_coding(s, x0, y0, 0);
- mvp_flag[0] = ff_hevc_mvp_lx_flag_decode(s);
+ mvp_flag = ff_hevc_mvp_lx_flag_decode(s);
ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
partIdx, merge_idx, &current_mv,
- mvp_flag[0], 0);
+ mvp_flag, 0);
current_mv.mv[0].x += lc->pu.mvd.x;
current_mv.mv[0].y += lc->pu.mvd.y;
}
@@ -1699,10 +1700,10 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
}
current_mv.pred_flag[1] = 1;
- mvp_flag[1] = ff_hevc_mvp_lx_flag_decode(s);
+ mvp_flag = ff_hevc_mvp_lx_flag_decode(s);
ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
partIdx, merge_idx, &current_mv,
- mvp_flag[1], 1);
+ mvp_flag, 1);
current_mv.mv[1].x += lc->pu.mvd.x;
current_mv.mv[1].y += lc->pu.mvd.y;
}