Error C2668 an ambiguous call of an overloaded function code from the site http://h264bitstream.sourceforge.net/

I ran the h264 parser program downloaded from http://h264bitstream.sourceforge.net/

when i run the code i get the following errors:

error C2668: 'log': overloaded function ambiguous call
1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (575): may be "long double log (long double)"
1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (527): or 'float log (float)'
1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (120 ): or 'double log (double)'

in the following code snippet

else if( pps->slice_group_map_type == 6 )
        {
            pps->pic_size_in_map_units_minus1 = bs_read_ue(b);
            for( i = 0; i <= pps->pic_size_in_map_units_minus1; i++ )
            {
                **pps->slice_group_id[ i ] = bs_read_u(b, ceil( log2( pps->num_slice_groups_minus1 + 1 ) ) ); // was u(v)**
            }
        }
    }

      

error C2668: 'log': ambiguous overloaded function call 1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (575): may be "long double log (long double)"
1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (527): or 'float log (float)'
1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (120 ): or 'double log (double)'
1> when trying to match the argument list '(int)' in the following code snippet

 if( pps->num_slice_groups_minus1 > 0 &&
        pps->slice_group_map_type >= 3 && pps->slice_group_map_type <= 5)
    {
        sh->slice_group_change_cycle = 
            **bs_read_u(b, ceil( log2( pps->pic_size_in_map_units_minus1 +  
                                     pps->slice_group_change_rate_minus1 + 1 ) ) ); // was u(v) // FIXME add 2?**
    }

      

error C2668: 'log': overloaded function ambiguous call 1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (575): may be "long double log (long double)"
1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (527): or 'float log (float)'
1> c: \ program files \ microsoft visual studio 10.0 \ vc \ include \ math.h (120 ): or 'double log (double)'
1> when trying to match the argument list '(int)'

bs_write_ue(b, pps->pic_size_in_map_units_minus1);
            for( i = 0; i <= pps->pic_size_in_map_units_minus1; i++ )
            {
                **bs_write_u(b, ceil( log2( pps->num_slice_groups_minus1 + 1 ) ), pps->slice_group_id[ i ] ); // was u(v)**
            }
        }

      

What should I do to resolve it?

+3


source to share


2 answers


Change your calls to log2 so they look like this:



log2( (double)(pps->num_slice_groups_minus1 + 1) )

      

0


source


Try using 1.0 instead of 1 as Input Parameter. Your parameter log(...)

expects double, float, or long double variable type. Your variable num_slice_groups_minus1

must also be in double, float or long double if it is not.



Example: log2( pps->num_slice_groups_minus1 + 1.0 )

0


source







All Articles