comparison divx4_vbr.c @ 17566:f580a7755ac5

Patch by Stefan Huehner / stefan % huehner ! org \ patch replaces '()' for the correct '(void)' in function declarations/prototypes which have no parameters. The '()' syntax tell thats there is a variable list of arguments, so that the compiler cannot check this. The extra CFLAG '-Wstrict-declarations' shows those cases. Comments about a similar patch applied to ffmpeg: That in C++ these mean the same, but in ANSI C the semantics are different; function() is an (obsolete) K&R C style forward declaration, it basically means that the function can have any number and any types of parameters, effectively completely preventing the compiler from doing any sort of type checking. -- Erik Slagter Defining functions with unspecified arguments is allowed but bad. With arguments unspecified the compiler can't report an error/warning if the function is called with incorrect arguments. -- M\ns Rullg\rd
author rathann
date Thu, 09 Feb 2006 14:08:03 +0000
parents 11b249ef87b0
children 682a16136d6c
comparison
equal deleted inserted replaced
17565:dc65faaadb04 17566:f580a7755ac5
314 VbrControl_set_quant(m_fQuant*m_vFrames[0].mult); 314 VbrControl_set_quant(m_fQuant*m_vFrames[0].mult);
315 m_lEncodedBits=m_lExpectedBits=0; 315 m_lEncodedBits=m_lExpectedBits=0;
316 return 0; 316 return 0;
317 } 317 }
318 318
319 int VbrControl_get_intra() 319 int VbrControl_get_intra(void)
320 { 320 {
321 return m_vFrames[m_iCount].is_key_frame; 321 return m_vFrames[m_iCount].is_key_frame;
322 } 322 }
323 323
324 short VbrControl_get_drop() 324 short VbrControl_get_drop(void)
325 { 325 {
326 return m_bDrop; 326 return m_bDrop;
327 } 327 }
328 328
329 int VbrControl_get_quant() 329 int VbrControl_get_quant(void)
330 { 330 {
331 return m_iQuant; 331 return m_iQuant;
332 } 332 }
333 333
334 void VbrControl_set_quant(float quant) 334 void VbrControl_set_quant(float quant)
338 m_iQuant++; 338 m_iQuant++;
339 if(m_iQuant<min_quantizer) m_iQuant=min_quantizer; 339 if(m_iQuant<min_quantizer) m_iQuant=min_quantizer;
340 if(m_iQuant>max_quantizer) m_iQuant=max_quantizer; 340 if(m_iQuant>max_quantizer) m_iQuant=max_quantizer;
341 } 341 }
342 342
343 void VbrControl_update_1pass_vbr() 343 void VbrControl_update_1pass_vbr(void)
344 { 344 {
345 VbrControl_set_quant(m_fQuant); 345 VbrControl_set_quant(m_fQuant);
346 m_iCount++; 346 m_iCount++;
347 } 347 }
348 348
393 VbrControl_set_quant(q); 393 VbrControl_set_quant(q);
394 if(m_pFile) 394 if(m_pFile)
395 fprintf(m_pFile, ", new quant %d\n", m_iQuant); 395 fprintf(m_pFile, ", new quant %d\n", m_iQuant);
396 } 396 }
397 397
398 void VbrControl_close() 398 void VbrControl_close(void)
399 { 399 {
400 if(m_pFile) 400 if(m_pFile)
401 { 401 {
402 fclose(m_pFile); 402 fclose(m_pFile);
403 m_pFile=NULL; 403 m_pFile=NULL;