[FFmpeg-cvslog] r22937 - in trunk: libavcodec/amrnbdec.c libavcodec/atrac1.c libavcodec/audioconvert.c libavcodec/qcelpdata.h libavcodec/qcelpdec.c libavcodec/ra288.c libavcodec/sipr.c libavcodec/sipr16k.c libavco...

Måns Rullgård mans
Sun Apr 25 18:38:19 CEST 2010


"Ronald S. Bultje" <rsbultje at gmail.com> writes:

> Hi,
>
> On Sat, Apr 24, 2010 at 7:15 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Sat, Apr 24, 2010 at 04:43:19PM -0400, Ronald S. Bultje wrote:
>>> Hi,
>> [...]
>>> ?common.h | ? ?2 +-
>>> ?1 file changed, 1 insertion(+), 1 deletion(-)
>>> 1c9e93cda8ce3e1e41630d14efc97d7528d75d41 ?clip.patch
>>> Index: libavutil/common.h
>>> ===================================================================
>>> --- libavutil/common.h ? ? ? ?(revision 22937)
>>> +++ libavutil/common.h ? ? ? ?(working copy)
>>> @@ -151,7 +151,7 @@
>>> ? */
>>> ?static inline av_const int32_t av_clipl_int32(int64_t a)
>>> ?{
>>> - ? ?if ((a+2147483648) & ~2147483647) return (a>>63) ^ 2147483647;
>>> + ? ?if ((a+2147483648U) & ~INT64_C(4294967295)) return (a>>63) ^ 2147483647;
>>> ? ? ?else ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?return a;
>>
>> i think this would be more readable when written in hexadecimal
>
> Fair enough, see attached.
>
> Would you like me to make the same changes to clip8/16?
>
> Ronald
>
> Index: libavutil/common.h
> ===================================================================
> --- libavutil/common.h	(revision 22937)
> +++ libavutil/common.h	(working copy)
> @@ -151,7 +151,7 @@
>   */
>  static inline av_const int32_t av_clipl_int32(int64_t a)
>  {
> -    if ((a+2147483648) & ~2147483647) return (a>>63) ^ 2147483647;
> +    if ((a+0x80000000U) & ~INT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
>      else                              return a;
>  }

I prefer writing the u suffix in lowercase, as that makes it visually
more distinct from the digits.

Please use UINT64_C to avoid any surprises from bitwise operations on
signed numbers.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-cvslog mailing list