On Tue, Sep 17, 2013 at 9:50 AM, Deepthi Nandakumar <
[email protected]> wrote:

> The idea behind this was to remove integer-type additions with bool
> variables. It likely works for all known cases, but would make the code
> cleaner.
>

Oh, I see.  Later in the function it does:

for (int i = 0; i < 1 + bBidir; i++)

in that case, all you need to do is change the type of bBidir to int.  The
other changes should be unnecessary.


>
> On Tue, Sep 17, 2013 at 4:54 PM, Derek Buitenhuis <
> [email protected]> wrote:
>
>> On 9/17/2013 11:52 AM, [email protected] wrote:
>> > # HG changeset patch
>> > # User Deepthi Nandakumar <[email protected]>
>> > # Date 1379415109 -19800
>> > # Node ID defa0cb72646c483e7708e3f40a608e4be250818
>> > # Parent  0d33ff236f68bc2238138a7213301b2efc0e6426
>> > lookahead: change const bool to const int, so can be used safely in
>> loop counter.
>>
>> I'm not sure what the intended use is? Something a cast can't fix?
>>
>> > -    const bool bBidir = (b < p1);
>> > +    const int bBidir = (b < p1) ? 1 : 0;
>>
>> You don't need a branch here. (b < p1) will evaluate to 0 or 1,
>> since C++ is only weakly statically typed.
>>
>> > -    if (!bBidir)
>> > +    if (bBidir == 0)
>>
>> This isn't necessary, but it may be the convention in the codebase?
>>
>> - Derek
>>
>> _______________________________________________
>> x265-devel mailing list
>> [email protected]
>> https://mailman.videolan.org/listinfo/x265-devel
>>
>
>
> _______________________________________________
> x265-devel mailing list
> [email protected]
> https://mailman.videolan.org/listinfo/x265-devel
>
>


-- 
Steve Borho
_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to