comparison libdiracenc.c @ 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 043574c5c153
children 646065f63290
comparison
equal deleted inserted replaced
10054:8ab9fbad11b2 10055:fdb318d12314
173 p_dirac_params->enc_ctx.decode_flag = 1; 173 p_dirac_params->enc_ctx.decode_flag = 1;
174 p_dirac_params->enc_ctx.instr_flag = 1; 174 p_dirac_params->enc_ctx.instr_flag = 1;
175 } 175 }
176 176
177 /* Intra-only sequence */ 177 /* Intra-only sequence */
178 if (avccontext->gop_size == 0 ) { 178 if (!avccontext->gop_size) {
179 p_dirac_params->enc_ctx.enc_params.num_L1 = 0; 179 p_dirac_params->enc_ctx.enc_params.num_L1 = 0;
180 if (avccontext->coder_type == FF_CODER_TYPE_VLC) 180 if (avccontext->coder_type == FF_CODER_TYPE_VLC)
181 p_dirac_params->enc_ctx.enc_params.using_ac = 0; 181 p_dirac_params->enc_ctx.enc_params.using_ac = 0;
182 } else 182 } else
183 avccontext->has_b_frames = 1; 183 avccontext->has_b_frames = 1;
184 184
185 if (avccontext->flags & CODEC_FLAG_QSCALE) { 185 if (avccontext->flags & CODEC_FLAG_QSCALE) {
186 if (avccontext->global_quality != 0) { 186 if (avccontext->global_quality) {
187 p_dirac_params->enc_ctx.enc_params.qf = 187 p_dirac_params->enc_ctx.enc_params.qf =
188 avccontext->global_quality / (FF_QP2LAMBDA*10.0); 188 avccontext->global_quality / (FF_QP2LAMBDA*10.0);
189 /* if it is not default bitrate then send target rate. */ 189 /* if it is not default bitrate then send target rate. */
190 if (avccontext->bit_rate >= 1000 && 190 if (avccontext->bit_rate >= 1000 &&
191 avccontext->bit_rate != 200000) { 191 avccontext->bit_rate != 200000) {
244 FfmpegDiracSchroEncodedFrame* p_frame_output = NULL; 244 FfmpegDiracSchroEncodedFrame* p_frame_output = NULL;
245 FfmpegDiracSchroEncodedFrame* p_next_output_frame = NULL; 245 FfmpegDiracSchroEncodedFrame* p_next_output_frame = NULL;
246 int go = 1; 246 int go = 1;
247 int last_frame_in_sequence = 0; 247 int last_frame_in_sequence = 0;
248 248
249 if (data == NULL) { 249 if (!data) {
250 /* push end of sequence if not already signalled */ 250 /* push end of sequence if not already signalled */
251 if (!p_dirac_params->eos_signalled) { 251 if (!p_dirac_params->eos_signalled) {
252 dirac_encoder_end_sequence( p_dirac_params->p_encoder ); 252 dirac_encoder_end_sequence( p_dirac_params->p_encoder );
253 p_dirac_params->eos_signalled = 1; 253 p_dirac_params->eos_signalled = 1;
254 } 254 }
356 last_frame_in_sequence = 1; 356 last_frame_in_sequence = 1;
357 357
358 p_next_output_frame = 358 p_next_output_frame =
359 ff_dirac_schro_queue_pop(&p_dirac_params->enc_frame_queue); 359 ff_dirac_schro_queue_pop(&p_dirac_params->enc_frame_queue);
360 360
361 if (p_next_output_frame == NULL) 361 if (!p_next_output_frame)
362 return 0; 362 return 0;
363 363
364 memcpy(frame, p_next_output_frame->p_encbuf, p_next_output_frame->size); 364 memcpy(frame, p_next_output_frame->p_encbuf, p_next_output_frame->size);
365 avccontext->coded_frame->key_frame = p_next_output_frame->key_frame; 365 avccontext->coded_frame->key_frame = p_next_output_frame->key_frame;
366 /* Use the frame number of the encoded frame as the pts. It is OK to do 366 /* Use the frame number of the encoded frame as the pts. It is OK to do