summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-01-18 18:47:59 +0100
committerDiego Biurrun <diego@biurrun.de>2012-01-25 13:14:49 +0100
commit33ad8c3cab30ebf8a08c891a5ec8cbcba15feabb (patch)
treeb88248e98610b1d32de1dca48bb156a1cafc0091 /libavcodec/motion_est.c
parentabe655a4723290497fd727df61fab2840d84b643 (diff)
cosmetics: Remove some unnecessary block braces.
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index c4512a91dd..2aa89786a1 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1290,28 +1290,26 @@ static int ff_estimate_motion_b(MpegEncContext * s,
break;
case ME_X1:
case ME_EPZS:
- {
- P_LEFT[0] = mv_table[mot_xy - 1][0];
- P_LEFT[1] = mv_table[mot_xy - 1][1];
-
- if(P_LEFT[0] > (c->xmax<<shift)) P_LEFT[0] = (c->xmax<<shift);
+ P_LEFT[0] = mv_table[mot_xy - 1][0];
+ P_LEFT[1] = mv_table[mot_xy - 1][1];
- /* special case for first line */
- if (!s->first_slice_line) {
- P_TOP[0] = mv_table[mot_xy - mot_stride ][0];
- P_TOP[1] = mv_table[mot_xy - mot_stride ][1];
- P_TOPRIGHT[0] = mv_table[mot_xy - mot_stride + 1 ][0];
- P_TOPRIGHT[1] = mv_table[mot_xy - mot_stride + 1 ][1];
- if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1]= (c->ymax<<shift);
- if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
- if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
+ if (P_LEFT[0] > (c->xmax << shift)) P_LEFT[0] = (c->xmax << shift);
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
- }
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
+ /* special case for first line */
+ if (!s->first_slice_line) {
+ P_TOP[0] = mv_table[mot_xy - mot_stride ][0];
+ P_TOP[1] = mv_table[mot_xy - mot_stride ][1];
+ P_TOPRIGHT[0] = mv_table[mot_xy - mot_stride + 1][0];
+ P_TOPRIGHT[1] = mv_table[mot_xy - mot_stride + 1][1];
+ if (P_TOP[1] > (c->ymax << shift)) P_TOP[1] = (c->ymax << shift);
+ if (P_TOPRIGHT[0] < (c->xmin << shift)) P_TOPRIGHT[0] = (c->xmin << shift);
+ if (P_TOPRIGHT[1] > (c->ymax << shift)) P_TOPRIGHT[1] = (c->ymax << shift);
+
+ P_MEDIAN[0] = mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
+ P_MEDIAN[1] = mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
}
+ c->pred_x = P_LEFT[0];
+ c->pred_y = P_LEFT[1];
if(mv_table == s->b_forw_mv_table){
mv_scale= (s->pb_time<<16) / (s->pp_time<<shift);