diff options
author | Diego Biurrun <diego@biurrun.de> | 2009-08-15 11:02:50 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2009-08-15 11:02:50 +0000 |
commit | 7c809dc3e24a321ed0b1fc3a34442127b762f801 (patch) | |
tree | 73039cb645ad3ffeacdc54f779dc90a3444b2ad5 | |
parent | cea0b5272d82c19c86dfcc3c61e097f4df9a4c2d (diff) | |
download | ffmpeg-7c809dc3e24a321ed0b1fc3a34442127b762f801.tar.gz |
Simplify 'if' condition statements.
Drop useless '!= 0' from 'exp != 0', replace 'exp == 0' by '!exp'.
Originally committed as revision 19647 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/libdirac_libschro.c | 6 | ||||
-rw-r--r-- | libavcodec/libdiracdec.c | 2 | ||||
-rw-r--r-- | libavcodec/libdiracenc.c | 8 | ||||
-rw-r--r-- | libavcodec/libschroedingerdec.c | 6 | ||||
-rw-r--r-- | libavcodec/libschroedingerenc.c | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/libavcodec/libdirac_libschro.c b/libavcodec/libdirac_libschro.c index 5bfaeb784c..df9133da5d 100644 --- a/libavcodec/libdirac_libschro.c +++ b/libavcodec/libdirac_libschro.c @@ -86,12 +86,12 @@ int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data) 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 @@ void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue) { FfmpegDiracSchroQueueElement *top = queue->p_head; - if (top != NULL) { + if (top) { void *data = top->data; queue->p_head = queue->p_head->next; --queue->size; diff --git a/libavcodec/libdiracdec.c b/libavcodec/libdiracdec.c index 9050f8829c..d78893dbf2 100644 --- a/libavcodec/libdiracdec.c +++ b/libavcodec/libdiracdec.c @@ -141,7 +141,7 @@ static int libdirac_decode_frame(AVCodecContext *avccontext, 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 + diff --git a/libavcodec/libdiracenc.c b/libavcodec/libdiracenc.c index 07510c6afc..a9f8438e37 100644 --- a/libavcodec/libdiracenc.c +++ b/libavcodec/libdiracenc.c @@ -175,7 +175,7 @@ static av_cold int libdirac_encode_init(AVCodecContext *avccontext) } /* 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 @@ static av_cold int libdirac_encode_init(AVCodecContext *avccontext) 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 @@ static int libdirac_encode_frame(AVCodecContext *avccontext, 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 @@ static int libdirac_encode_frame(AVCodecContext *avccontext, 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); diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index 3985a1ca2d..e1c1844f82 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -196,7 +196,7 @@ static void libschroedinger_handle_first_access_unit(AVCodecContext *avccontext) 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 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, *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 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, /* 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); diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c index 965096ab01..aadf061ad3 100644 --- a/libavcodec/libschroedingerenc.c +++ b/libavcodec/libschroedingerenc.c @@ -145,7 +145,7 @@ static int libschroedinger_encode_init(AVCodecContext *avccontext) 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 @@ static int libschroedinger_encode_init(AVCodecContext *avccontext) /* 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 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, 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); |