Drop useless '!= 0' from 'exp != 0', replace 'exp == 0' by '!exp'.
Originally committed as revision 19647 to svn://svn.ffmpeg.org/ffmpeg/trunk
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;
{
FfmpegDiracSchroQueueElement *top = queue->p_head;
- if (top != NULL) {
+ if (top) {
void *data = top->data;
queue->p_head = queue->p_head->next;
--queue->size;
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 +
}
/* 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;
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. */
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 );
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);
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,
*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;
/* 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);
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);
/* 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",
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);