Mercurial > libavcodec.hg
changeset 10055:fdb318d12314 libavcodec
Simplify 'if' condition statements.
Drop useless '!= 0' from 'exp != 0', replace 'exp == 0' by '!exp'.
author | diego |
---|---|
date | Sat, 15 Aug 2009 11:02:50 +0000 |
parents | 8ab9fbad11b2 |
children | 646065f63290 |
files | libdirac_libschro.c libdiracdec.c libdiracenc.c libschroedingerdec.c libschroedingerenc.c |
diffstat | 5 files changed, 14 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/libdirac_libschro.c Sat Aug 15 09:12:58 2009 +0000 +++ b/libdirac_libschro.c Sat Aug 15 11:02:50 2009 +0000 @@ -86,12 +86,12 @@ FfmpegDiracSchroQueueElement *p_new = av_mallocz(sizeof(FfmpegDiracSchroQueueElement)); - if (p_new == NULL) + if (!p_new) return -1; p_new->data = p_data; - if (queue->p_head == NULL) + if (!queue->p_head) queue->p_head = p_new; else queue->p_tail->next = p_new; @@ -105,7 +105,7 @@ { FfmpegDiracSchroQueueElement *top = queue->p_head; - if (top != NULL) { + if (top) { void *data = top->data; queue->p_head = queue->p_head->next; --queue->size;
--- a/libdiracdec.c Sat Aug 15 09:12:58 2009 +0000 +++ b/libdiracdec.c Sat Aug 15 11:02:50 2009 +0000 @@ -141,7 +141,7 @@ avccontext->height); /* allocate output buffer */ - if (p_dirac_params->p_out_frame_buf == NULL) + if (!p_dirac_params->p_out_frame_buf) p_dirac_params->p_out_frame_buf = av_malloc (pict_size); buffer[0] = p_dirac_params->p_out_frame_buf; buffer[1] = p_dirac_params->p_out_frame_buf +
--- a/libdiracenc.c Sat Aug 15 09:12:58 2009 +0000 +++ b/libdiracenc.c Sat Aug 15 11:02:50 2009 +0000 @@ -175,7 +175,7 @@ } /* Intra-only sequence */ - if (avccontext->gop_size == 0 ) { + if (!avccontext->gop_size) { p_dirac_params->enc_ctx.enc_params.num_L1 = 0; if (avccontext->coder_type == FF_CODER_TYPE_VLC) p_dirac_params->enc_ctx.enc_params.using_ac = 0; @@ -183,7 +183,7 @@ avccontext->has_b_frames = 1; if (avccontext->flags & CODEC_FLAG_QSCALE) { - if (avccontext->global_quality != 0) { + if (avccontext->global_quality) { p_dirac_params->enc_ctx.enc_params.qf = avccontext->global_quality / (FF_QP2LAMBDA*10.0); /* if it is not default bitrate then send target rate. */ @@ -246,7 +246,7 @@ int go = 1; int last_frame_in_sequence = 0; - if (data == NULL) { + if (!data) { /* push end of sequence if not already signalled */ if (!p_dirac_params->eos_signalled) { dirac_encoder_end_sequence( p_dirac_params->p_encoder ); @@ -358,7 +358,7 @@ p_next_output_frame = ff_dirac_schro_queue_pop(&p_dirac_params->enc_frame_queue); - if (p_next_output_frame == NULL) + if (!p_next_output_frame) return 0; memcpy(frame, p_next_output_frame->p_encbuf, p_next_output_frame->size);
--- a/libschroedingerdec.c Sat Aug 15 09:12:58 2009 +0000 +++ b/libschroedingerdec.c Sat Aug 15 11:02:50 2009 +0000 @@ -196,7 +196,7 @@ avccontext->time_base.den = p_schro_params->format->frame_rate_numerator; avccontext->time_base.num = p_schro_params->format->frame_rate_denominator; - if (p_schro_params->dec_pic.data[0] == NULL) + if (!p_schro_params->dec_pic.data[0]) { avpicture_alloc(&p_schro_params->dec_pic, avccontext->pix_fmt, @@ -226,7 +226,7 @@ *data_size = 0; FfmpegSchroParseContextInit (&parse_ctx, buf, buf_size); - if (buf_size == 0) { + if (!buf_size) { if (!p_schro_params->eos_signalled) { state = schro_decoder_push_end_of_stream(decoder); p_schro_params->eos_signalled = 1; @@ -300,7 +300,7 @@ /* Grab next frame to be returned from the top of the queue. */ frame = ff_dirac_schro_queue_pop(&p_schro_params->dec_frame_queue); - if (frame != NULL) { + if (frame) { memcpy (p_schro_params->dec_pic.data[0], frame->components[0].data, frame->components[0].length);
--- a/libschroedingerenc.c Sat Aug 15 09:12:58 2009 +0000 +++ b/libschroedingerenc.c Sat Aug 15 11:02:50 2009 +0000 @@ -145,7 +145,7 @@ avccontext->coded_frame = &p_schro_params->picture; - if (avccontext->gop_size == 0){ + if (!avccontext->gop_size) { schro_encoder_setting_set_double (p_schro_params->encoder, "gop_structure", SCHRO_ENCODER_GOP_INTRA_ONLY); @@ -164,7 +164,7 @@ /* FIXME - Need to handle SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY. */ if (avccontext->flags & CODEC_FLAG_QSCALE) { - if (avccontext->global_quality == 0) { + if (!avccontext->global_quality) { /* lossless coding */ schro_encoder_setting_set_double (p_schro_params->encoder, "rate_control", @@ -366,7 +366,7 @@ p_frame_output = ff_dirac_schro_queue_pop (&p_schro_params->enc_frame_queue); - if (p_frame_output == NULL) + if (!p_frame_output) return 0; memcpy(frame, p_frame_output->p_encbuf, p_frame_output->size);