From 3dc99a18d4ae2b9bcc96e00b7f589128717aec64 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sat, 7 Jan 2012 19:07:42 +0100 Subject: [PATCH] cosmetics: drop some pointless parentheses --- libavcodec/ac3dec.c | 4 ++-- libavcodec/cavs.c | 4 ++-- libavcodec/cavsdec.c | 2 +- libavcodec/error_resilience.c | 8 ++++---- libavcodec/libdiracenc.c | 6 +++--- libavcodec/libschroedingerenc.c | 2 +- libavcodec/libxvidff.c | 6 +++--- libavcodec/mpeg12.c | 2 +- libavcodec/mpegvideo.c | 10 +++++----- libavcodec/ppc/mpegvideo_altivec.c | 8 ++++---- libavcodec/pthread.c | 2 +- libavcodec/tscc.c | 10 +++++----- libavcodec/vc1dec.c | 2 +- libavcodec/vorbisdec.c | 7 +++---- libavcodec/zmbv.c | 6 +++--- libavcodec/zmbvenc.c | 6 +++--- libavdevice/bktr.c | 2 +- libavdevice/timefilter.c | 2 +- libavfilter/vsrc_buffer.c | 2 +- libavformat/aviobuf.c | 2 +- libavformat/mtv.c | 2 +- libavformat/rmdec.c | 2 +- 22 files changed, 48 insertions(+), 49 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 83cfa0acc3..662ea91d1f 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -223,7 +223,7 @@ static int ac3_parse_header(AC3DecodeContext *s) int i; /* read the rest of the bsi. read twice for dual mono mode. */ - i = !(s->channel_mode); + i = !s->channel_mode; do { skip_bits(gbc, 5); // skip dialog normalization if (get_bits1(gbc)) @@ -792,7 +792,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) } /* dynamic range */ - i = !(s->channel_mode); + i = !s->channel_mode; do { if (get_bits1(gbc)) { s->dynamic_range[i] = ((dynamic_range_tab[get_bits(gbc, 8)] - 1.0) * diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index 6f63c23628..9ff0e5165b 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -658,8 +658,8 @@ void ff_cavs_init_top_lines(AVSContext *h) { h->top_mv[1] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); h->top_pred_Y = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y)); h->top_border_y = av_malloc((h->mb_width+1)*16); - h->top_border_u = av_malloc((h->mb_width)*10); - h->top_border_v = av_malloc((h->mb_width)*10); + h->top_border_u = av_malloc( h->mb_width * 10); + h->top_border_v = av_malloc( h->mb_width * 10); /* alloc space for co-located MVs and types */ h->col_mv = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 514752afc9..2f4b6e3b14 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -490,7 +490,7 @@ static int decode_pic(AVSContext *h) { skip_bits(&s->gb,24);//time_code /* old sample clips were all progressive and no low_delay, bump stream revision if detected otherwise */ - if((s->low_delay) || !(show_bits(&s->gb,9) & 1)) + if (s->low_delay || !(show_bits(&s->gb,9) & 1)) h->stream_revision = 1; /* similarly test top_field_first and repeat_first_field */ else if(show_bits(&s->gb,11) & 3) diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 39c0b2f622..855ae770ad 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -109,8 +109,8 @@ static void put_dc(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t for(y=0; y<8; y++){ int x; for(x=0; x<8; x++){ - dest_cb[x + y*(s->uvlinesize)]= dcu/8; - dest_cr[x + y*(s->uvlinesize)]= dcv/8; + dest_cb[x + y * s->uvlinesize] = dcu / 8; + dest_cr[x + y * s->uvlinesize] = dcv / 8; } } } @@ -1092,8 +1092,8 @@ void ff_er_frame_end(MpegEncContext *s){ for(y=0; y<8; y++){ int x; for(x=0; x<8; x++){ - dcu+=dest_cb[x + y*(s->uvlinesize)]; - dcv+=dest_cr[x + y*(s->uvlinesize)]; + dcu += dest_cb[x + y * s->uvlinesize]; + dcv += dest_cr[x + y * s->uvlinesize]; } } s->dc_val[1][mb_x + mb_y*s->mb_stride]= (dcu+4)>>3; diff --git a/libavcodec/libdiracenc.c b/libavcodec/libdiracenc.c index 33dba2236a..156ba57718 100644 --- a/libavcodec/libdiracenc.c +++ b/libavcodec/libdiracenc.c @@ -136,7 +136,7 @@ static av_cold int libdirac_encode_init(AVCodecContext *avccontext) preset = GetDiracVideoFormatPreset(avccontext); /* initialize the encoder context */ - dirac_encoder_context_init(&(p_dirac_params->enc_ctx), preset); + dirac_encoder_context_init(&p_dirac_params->enc_ctx, preset); p_dirac_params->enc_ctx.src_params.chroma = GetDiracChromaFormat(avccontext->pix_fmt); @@ -199,7 +199,7 @@ static av_cold int libdirac_encode_init(AVCodecContext *avccontext) * irrespective of the type of source material */ p_dirac_params->enc_ctx.enc_params.picture_coding_mode = 1; - p_dirac_params->p_encoder = dirac_encoder_init(&(p_dirac_params->enc_ctx), + p_dirac_params->p_encoder = dirac_encoder_init(&p_dirac_params->enc_ctx, verbose); if (!p_dirac_params->p_encoder) { @@ -221,7 +221,7 @@ static void DiracFreeFrame(void *data) { DiracSchroEncodedFrame *enc_frame = data; - av_freep(&(enc_frame->p_encbuf)); + av_freep(&enc_frame->p_encbuf); av_free(enc_frame); } diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c index dec9c2a37e..2aadd3af3f 100644 --- a/libavcodec/libschroedingerenc.c +++ b/libavcodec/libschroedingerenc.c @@ -258,7 +258,7 @@ static void SchroedingerFreeFrame(void *data) { DiracSchroEncodedFrame *enc_frame = data; - av_freep(&(enc_frame->p_encbuf)); + av_freep(&enc_frame->p_encbuf); av_free(enc_frame); } diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c index d0f4ed39be..a11e4ac913 100644 --- a/libavcodec/libxvidff.c +++ b/libavcodec/libxvidff.c @@ -270,7 +270,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { rc2pass2.version = XVID_VERSION; rc2pass2.bitrate = avctx->bit_rate; - fd = ff_tempfile("xvidff.", &(x->twopassfile)); + fd = ff_tempfile("xvidff.", &x->twopassfile); if( fd == -1 ) { av_log(avctx, AV_LOG_ERROR, "Xvid: Cannot write 2-pass pipe\n"); @@ -414,7 +414,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, char *tmp; struct xvid_context *x = avctx->priv_data; AVFrame *picture = data; - AVFrame *p = &(x->encoded_picture); + AVFrame *p = &x->encoded_picture; xvid_enc_frame_t xvid_enc_frame; xvid_enc_stats_t xvid_enc_stats; @@ -575,7 +575,7 @@ int xvid_strip_vol_header(AVCodecContext *avctx, } /* Less dangerous now, memmove properly copies the two chunks of overlapping data */ - memmove(frame, &(frame[vo_len]), frame_len - vo_len); + memmove(frame, &frame[vo_len], frame_len - vo_len); return frame_len - vo_len; } else return frame_len; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 2019512839..34857d61a6 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1235,7 +1235,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) /* low_delay may be forced, in this case we will have B-frames * that behave like P-frames. */ - avctx->has_b_frames = !(s->low_delay); + avctx->has_b_frames = !s->low_delay; assert((avctx->sub_id == 1) == (avctx->codec_id == CODEC_ID_MPEG1VIDEO)); if (avctx->codec_id == CODEC_ID_MPEG1VIDEO) { diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index a2aa257f89..e4c45886dc 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -705,8 +705,8 @@ av_cold int MPV_common_init(MpegEncContext *s) mv_table_size = (s->mb_height + 2) * s->mb_stride + 1; /* set chroma shifts */ - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt,&(s->chroma_x_shift), - &(s->chroma_y_shift) ); + avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &s->chroma_x_shift, + &s->chroma_y_shift); /* set default edge pos, will be overriden * in decode_header if needed */ @@ -2339,7 +2339,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], } dct_linesize = linesize << s->interlaced_dct; - dct_offset =(s->interlaced_dct)? linesize : linesize*block_size; + dct_offset = s->interlaced_dct ? linesize : linesize * block_size; if(readable){ dest_y= s->dest[0]; @@ -2435,7 +2435,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], }else{ //chroma422 dct_linesize = uvlinesize << s->interlaced_dct; - dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8; + dct_offset = s->interlaced_dct ? uvlinesize : uvlinesize * 8; add_dct(s, block[4], 4, dest_cb, dct_linesize); add_dct(s, block[5], 5, dest_cr, dct_linesize); @@ -2487,7 +2487,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], }else{ dct_linesize = uvlinesize << s->interlaced_dct; - dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8; + dct_offset = s->interlaced_dct ? uvlinesize : uvlinesize * 8; s->dsp.idct_put(dest_cb, dct_linesize, block[4]); s->dsp.idct_put(dest_cr, dct_linesize, block[5]); diff --git a/libavcodec/ppc/mpegvideo_altivec.c b/libavcodec/ppc/mpegvideo_altivec.c index 2d3bf892a0..a033cd7372 100644 --- a/libavcodec/ppc/mpegvideo_altivec.c +++ b/libavcodec/ppc/mpegvideo_altivec.c @@ -268,10 +268,10 @@ static int dct_quantize_altivec(MpegEncContext* s, vec_ste(baseVector, 0, &oldBaseValue); qmat = (vector signed int*)s->q_intra_matrix[qscale]; - biasAddr = &(s->intra_quant_bias); + biasAddr = &s->intra_quant_bias; } else { qmat = (vector signed int*)s->q_inter_matrix[qscale]; - biasAddr = &(s->inter_quant_bias); + biasAddr = &s->inter_quant_bias; } // Load the bias vector (We add 0.5 to the bias so that we're @@ -361,8 +361,8 @@ static int dct_quantize_altivec(MpegEncContext* s, vector signed int max_q_int, min_q_int; vector signed short max_q, min_q; - LOAD4(max_q_int, &(s->max_qcoeff)); - LOAD4(min_q_int, &(s->min_qcoeff)); + LOAD4(max_q_int, &s->max_qcoeff); + LOAD4(min_q_int, &s->min_qcoeff); max_q = vec_pack(max_q_int, max_q_int); min_q = vec_pack(min_q_int, min_q_int); diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 2159a2572d..0688d9d8f0 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -829,7 +829,7 @@ static int frame_thread_init(AVCodecContext *avctx) err = AVERROR(ENOMEM); goto error; } - *(copy->internal) = *(src->internal); + *copy->internal = *src->internal; copy->internal->is_copy = 1; if (codec->init_thread_copy) diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index 90d203dd77..ccf1048c9b 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -88,7 +88,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac return -1; } - zret = inflateReset(&(c->zstream)); + zret = inflateReset(&c->zstream); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret); return -1; @@ -97,7 +97,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac c->zstream.avail_in = len; c->zstream.next_out = c->decomp_buf; c->zstream.avail_out = c->decomp_size; - zret = inflate(&(c->zstream), Z_FINISH); + zret = inflate(&c->zstream, Z_FINISH); // Z_DATA_ERROR means empty picture if ((zret != Z_OK) && (zret != Z_STREAM_END) && (zret != Z_DATA_ERROR)) { av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", zret); @@ -143,7 +143,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->height = avctx->height; // Needed if zlib unused or init aborted before inflateInit - memset(&(c->zstream), 0, sizeof(z_stream)); + memset(&c->zstream, 0, sizeof(z_stream)); switch(avctx->bits_per_coded_sample){ case 8: avctx->pix_fmt = PIX_FMT_PAL8; break; case 16: avctx->pix_fmt = PIX_FMT_RGB555; break; @@ -169,7 +169,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->zstream.zalloc = Z_NULL; c->zstream.zfree = Z_NULL; c->zstream.opaque = Z_NULL; - zret = inflateInit(&(c->zstream)); + zret = inflateInit(&c->zstream); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret); return 1; @@ -193,7 +193,7 @@ static av_cold int decode_end(AVCodecContext *avctx) if (c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); - inflateEnd(&(c->zstream)); + inflateEnd(&c->zstream); return 0; } diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index bc8daed7af..fa952739bb 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5342,7 +5342,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) if (v->profile == PROFILE_ADVANCED) avctx->level = v->level; - avctx->has_b_frames = !!(avctx->max_b_frames); + avctx->has_b_frames = !!avctx->max_b_frames; s->mb_width = (avctx->coded_width + 15) >> 4; s->mb_height = (avctx->coded_height + 15) >> 4; diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 70690ddb2c..e0c38c2360 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -816,8 +816,7 @@ static void create_map(vorbis_context *vc, unsigned floor_number) for (idx = 0; idx < n; ++idx) { map[idx] = floor(BARK((vf->rate * idx) / (2.0f * n)) * - ((vf->bark_map_size) / - BARK(vf->rate / 2.0f))); + (vf->bark_map_size / BARK(vf->rate / 2.0f))); if (vf->bark_map_size-1 < map[idx]) map[idx] = vf->bark_map_size - 1; } @@ -975,7 +974,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext) int headers_len = avccontext->extradata_size; uint8_t *header_start[3]; int header_len[3]; - GetBitContext *gb = &(vc->gb); + GetBitContext *gb = &vc->gb; int hdr_type, ret; vc->avccontext = avccontext; @@ -1615,7 +1614,7 @@ static int vorbis_decode_frame(AVCodecContext *avccontext, void *data, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; vorbis_context *vc = avccontext->priv_data; - GetBitContext *gb = &(vc->gb); + GetBitContext *gb = &vc->gb; const float *channel_ptrs[255]; int i, len, ret; diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 321348024a..a36a844b1f 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -613,7 +613,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->bpp = avctx->bits_per_coded_sample; // Needed if zlib unused or init aborted before inflateInit - memset(&(c->zstream), 0, sizeof(z_stream)); + memset(&c->zstream, 0, sizeof(z_stream)); avctx->pix_fmt = PIX_FMT_RGB24; c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64); @@ -630,7 +630,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->zstream.zalloc = Z_NULL; c->zstream.zfree = Z_NULL; c->zstream.opaque = Z_NULL; - zret = inflateInit(&(c->zstream)); + zret = inflateInit(&c->zstream); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret); return 1; @@ -654,7 +654,7 @@ static av_cold int decode_end(AVCodecContext *avctx) if (c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); - inflateEnd(&(c->zstream)); + inflateEnd(&c->zstream); av_freep(&c->cur); av_freep(&c->prev); diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index 2230436f90..75fcffec8c 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -269,7 +269,7 @@ static av_cold int encode_init(AVCodecContext *avctx) } // Needed if zlib unused or init aborted before deflateInit - memset(&(c->zstream), 0, sizeof(z_stream)); + memset(&c->zstream, 0, sizeof(z_stream)); c->comp_size = avctx->width * avctx->height + 1024 + ((avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * ((avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * 2 + 4; if ((c->work_buf = av_malloc(c->comp_size)) == NULL) { @@ -294,7 +294,7 @@ static av_cold int encode_init(AVCodecContext *avctx) c->zstream.zalloc = Z_NULL; c->zstream.zfree = Z_NULL; c->zstream.opaque = Z_NULL; - zret = deflateInit(&(c->zstream), lvl); + zret = deflateInit(&c->zstream, lvl); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret); return -1; @@ -317,7 +317,7 @@ static av_cold int encode_end(AVCodecContext *avctx) av_freep(&c->comp_buf); av_freep(&c->work_buf); - deflateEnd(&(c->zstream)); + deflateEnd(&c->zstream); av_freep(&c->prev); return 0; diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index e6a1e8ba2d..8abe5ef18f 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -292,7 +292,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) if (bktr_init(s1->filename, width, height, s->standard, - &(s->video_fd), &(s->tuner_fd), -1, 0.0) < 0) { + &s->video_fd, &s->tuner_fd, -1, 0.0) < 0) { ret = AVERROR(EIO); goto out; } diff --git a/libavdevice/timefilter.c b/libavdevice/timefilter.c index 332d33b5e8..136661a541 100644 --- a/libavdevice/timefilter.c +++ b/libavdevice/timefilter.c @@ -69,7 +69,7 @@ double ff_timefilter_update(TimeFilter *self, double system_time, double period) loop_error = system_time - self->cycle_time; /// update loop - self->cycle_time += FFMAX(self->feedback2_factor, 1.0/(self->count)) * loop_error; + self->cycle_time += FFMAX(self->feedback2_factor, 1.0 / self->count) * loop_error; self->clock_period += self->feedback3_factor * loop_error / period; } return self->cycle_time; diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c index 7ef19a1140..91465026c2 100644 --- a/libavfilter/vsrc_buffer.c +++ b/libavfilter/vsrc_buffer.c @@ -147,7 +147,7 @@ static int request_frame(AVFilterLink *link) static int poll_frame(AVFilterLink *link) { BufferSourceContext *c = link->src->priv; - return !!(c->buf); + return !!c->buf; } AVFilter avfilter_vsrc_buffer = { diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index dbbbba5535..6cd2cefa7c 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -168,7 +168,7 @@ static void flush_buffer(AVIOContext *s) void avio_w8(AVIOContext *s, int b) { - *(s->buf_ptr)++ = b; + *s->buf_ptr++ = b; if (s->buf_ptr >= s->buf_end) flush_buffer(s); } diff --git a/libavformat/mtv.c b/libavformat/mtv.c index 4c3b082881..2243733812 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -53,7 +53,7 @@ typedef struct MTVDemuxContext { static int mtv_probe(AVProbeData *p) { /* Magic is 'AMV' */ - if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V') + if (*p->buf != 'A' || *(p->buf + 1) != 'M' || *(p->buf + 2) != 'V') return 0; /* Check for nonzero in bpp and (width|height) header fields */ diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 66b6f8a876..75e4833c4c 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -661,7 +661,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, vst->videobufpos += len; rm->remaining_len-= len; - if(type == 2 || (vst->videobufpos) == vst->videobufsize){ + if (type == 2 || vst->videobufpos == vst->videobufsize) { vst->pkt.data[0] = vst->cur_slice-1; *pkt= vst->pkt; vst->pkt.data= NULL;