From 63a46c6101ffe0ba6a5f6e90d595583ecf943d0d Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 10 Oct 2012 14:08:21 +0200 Subject: svq1: Drop a bunch of useless parentheses --- libavcodec/svq1dec.c | 70 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'libavcodec/svq1dec.c') diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 1ca9b1d06d..6e096f3f43 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -105,56 +105,56 @@ static const uint8_t string_table[256] = { /* add child nodes */ \ list[n++] = list[i]; \ list[n++] = list[i] + \ - (((level & 1) ? pitch : 1) << ((level / 2) + 1)); \ + (((level & 1) ? pitch : 1) << (level / 2 + 1)); \ } #define SVQ1_ADD_CODEBOOK() \ /* add codebook entries to vector */ \ for (j = 0; j < stages; j++) { \ n3 = codebook[entries[j]] ^ 0x80808080; \ - n1 += ((n3 & 0xFF00FF00) >> 8); \ - n2 += (n3 & 0x00FF00FF); \ + n1 += (n3 & 0xFF00FF00) >> 8; \ + n2 += n3 & 0x00FF00FF; \ } \ \ /* clip to [0..255] */ \ if (n1 & 0xFF00FF00) { \ - n3 = (((n1 >> 15) & 0x00010001) | 0x01000100) - 0x00010001; \ + n3 = (n1 >> 15 & 0x00010001 | 0x01000100) - 0x00010001; \ n1 += 0x7F007F00; \ - n1 |= (((~n1 >> 15) & 0x00010001) | 0x01000100) - 0x00010001; \ - n1 &= (n3 & 0x00FF00FF); \ + n1 |= (~n1 >> 15 & 0x00010001 | 0x01000100) - 0x00010001; \ + n1 &= n3 & 0x00FF00FF; \ } \ \ if (n2 & 0xFF00FF00) { \ - n3 = (((n2 >> 15) & 0x00010001) | 0x01000100) - 0x00010001; \ + n3 = (n2 >> 15 & 0x00010001 | 0x01000100) - 0x00010001; \ n2 += 0x7F007F00; \ - n2 |= (((~n2 >> 15) & 0x00010001) | 0x01000100) - 0x00010001; \ - n2 &= (n3 & 0x00FF00FF); \ + n2 |= (~n2 >> 15 & 0x00010001 | 0x01000100) - 0x00010001; \ + n2 &= n3 & 0x00FF00FF; \ } #define SVQ1_DO_CODEBOOK_INTRA() \ for (y = 0; y < height; y++) { \ - for (x = 0; x < (width / 4); x++, codebook++) { \ + for (x = 0; x < width / 4; x++, codebook++) { \ n1 = n4; \ n2 = n4; \ SVQ1_ADD_CODEBOOK() \ /* store result */ \ - dst[x] = (n1 << 8) | n2; \ + dst[x] = n1 << 8 | n2; \ } \ - dst += (pitch / 4); \ + dst += pitch / 4; \ } #define SVQ1_DO_CODEBOOK_NONINTRA() \ for (y = 0; y < height; y++) { \ - for (x = 0; x < (width / 4); x++, codebook++) { \ + for (x = 0; x < width / 4; x++, codebook++) { \ n3 = dst[x]; \ /* add mean value to vector */ \ n1 = n4 + ((n3 & 0xFF00FF00) >> 8); \ n2 = n4 + (n3 & 0x00FF00FF); \ SVQ1_ADD_CODEBOOK() \ /* store result */ \ - dst[x] = (n1 << 8) | n2; \ + dst[x] = n1 << 8 | n2; \ } \ - dst += (pitch / 4); \ + dst += pitch / 4; \ } #define SVQ1_CALC_CODEBOOK_ENTRIES(cbook) \ @@ -166,8 +166,8 @@ static const uint8_t string_table[256] = { entries[j] = (((bit_cache >> (4 * (stages - j - 1))) & 0xF) + \ 16 * j) << (level + 1); \ } \ - mean -= (stages * 128); \ - n4 = ((mean + (mean >> 31)) << 16) | (mean & 0xFFFF); + mean -= stages * 128; \ + n4 = mean + (mean >> 31) << 16 | (mean & 0xFFFF); static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels, int pitch) @@ -203,7 +203,7 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels, continue; /* skip vector */ } - if ((stages > 0) && (level >= 4)) { + if (stages > 0 && level >= 4) { av_dlog(NULL, "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n", stages, level); @@ -329,8 +329,8 @@ static int svq1_motion_inter_block(MpegEncContext *s, GetBitContext *bitbuf, pmv[1] = pmv[2] = pmv[0]; } else { - pmv[1] = &motion[(x / 8) + 2]; - pmv[2] = &motion[(x / 8) + 4]; + pmv[1] = &motion[x / 8 + 2]; + pmv[2] = &motion[x / 8 + 4]; } result = svq1_decode_motion_vector(bitbuf, &mv, pmv); @@ -338,12 +338,12 @@ static int svq1_motion_inter_block(MpegEncContext *s, GetBitContext *bitbuf, if (result != 0) return result; - motion[0].x = - motion[(x / 8) + 2].x = - motion[(x / 8) + 3].x = mv.x; - motion[0].y = - motion[(x / 8) + 2].y = - motion[(x / 8) + 3].y = mv.y; + motion[0].x = + motion[x / 8 + 2].x = + motion[x / 8 + 3].x = mv.x; + motion[0].y = + motion[x / 8 + 2].y = + motion[x / 8 + 3].y = mv.y; if (y + (mv.y >> 1) < 0) mv.y = 0; @@ -353,7 +353,7 @@ static int svq1_motion_inter_block(MpegEncContext *s, GetBitContext *bitbuf, src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1)) * pitch]; dst = current; - s->dsp.put_pixels_tab[0][((mv.y & 1) << 1) | (mv.x & 1)](dst, src, pitch, 16); + s->dsp.put_pixels_tab[0][(mv.y & 1) << 1 | (mv.x & 1)](dst, src, pitch, 16); return 0; } @@ -452,12 +452,12 @@ static int svq1_decode_delta_block(MpegEncContext *s, GetBitContext *bitbuf, /* reset motion vectors */ if (block_type == SVQ1_BLOCK_SKIP || block_type == SVQ1_BLOCK_INTRA) { - motion[0].x = - motion[0].y = - motion[(x / 8) + 2].x = - motion[(x / 8) + 2].y = - motion[(x / 8) + 3].x = - motion[(x / 8) + 3].y = 0; + motion[0].x = + motion[0].y = + motion[x / 8 + 2].x = + motion[x / 8 + 2].y = + motion[x / 8 + 3].x = + motion[x / 8 + 3].y = 0; } switch (block_type) { @@ -725,8 +725,8 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx) ff_MPV_decode_defaults(s); s->avctx = avctx; - s->width = (avctx->width + 3) & ~3; - s->height = (avctx->height + 3) & ~3; + s->width = avctx->width + 3 & ~3; + s->height = avctx->height + 3 & ~3; s->codec_id = avctx->codec->id; avctx->pix_fmt = AV_PIX_FMT_YUV410P; /* Not true, but DP frames and these behave like unidirectional B-frames. */ -- cgit v1.2.3