[Ffmpeg-cvslog] [ffmpeg]: r5417 - in /trunk: libavcodec/snow.c libavcodec/snow.h tests/ffmpeg.regression.ref tests/rotozoom.regression.ref

Måns Rullgård mru
Mon May 29 00:56:34 CEST 2006


Mike Melanson <mike at multimedia.cx> writes:

> Romain DEGEZ wrote:
>> lorenm at natsuki.mplayerhq.hu wrote:
>>
>>> Author: lorenm
>>> Date: Sun May 28 23:44:47 2006
>>> New Revision: 5417
>>>
>>> Log:
>>> Snow multiple reference frames
>>> (bitstream is not backwards compatible, even if refs aren't used)
>>> +    int mx_context= av_log2(2*ABS(left->mx - top->mx)) + 16*!!b->ref;
>>> +    int my_context= av_log2(2*ABS(left->my - top->my)) + 16*!!b->ref;
>> Wow, never see that.
>> What does '!!' mean ?
>
> I'm just guessing here, but I think that maybe:
>
>    n = 16*!!b->ref
>
> is equivalent to:
>
>    if (b->ref)
>      n = 16;
>    else
>      n = 0;
>
> I think there's a langauge lawyer on the list who could confirm or deny.

That's quite right.  Perhaps writing !!foo as !(!(foo)) helps showing
this.  Remember that the result of any boolean operator (!, &&, ||) is
of type int and has a value of 0 or 1.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-cvslog mailing list