This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

math function in DSP for dm8168

hi TI-friends,

I try to implement something as below in DSP

double y_psnr, f_mse = 0;

...

if( f_mse <= 0.0000000001 ) /* Max 100dB */
y_psnr = 100;
else
y_psnr = (double)(-10.0 * log10( f_mse ));

Vps_printf(" ************ f_mse = %f, y_psnr = %f !!\n", f_mse, y_psnr);

and the console shows

[c6xdsp ] ************ f_mse = 1102.983845, y_psnr = -21272267950.000000 !!
[c6xdsp ] ************ f_mse = 1102.986799, y_psnr = -4515725110.000000 !!
[c6xdsp ] ************ f_mse = 1102.986568, y_psnr = -2470487590.000000 !!

by electronic calculator

the result should be following

f_mse = 1102.983845, y_psnr = -695743084...

Is anything wrong in DSP ??

  • I try following

    if( f_mse <= 0.0000000001 ) /* Max 100dB */
    y_psnr = 100;
    else
    y_psnr = (double)( log10( f_mse ));

    Vps_printf(" ************ f_mse = %f, y_psnr = %f !!\n", f_mse, y_psnr);

    and the result is as below

    [c6xdsp ] ************ f_mse = 1102.985534, y_psnr = -669789437.000000 !!
    [c6xdsp ] ************ f_mse = 1102.985585, y_psnr = -624964762.000000 !!
    [c6xdsp ] ************ f_mse = 1102.984758, y_psnr = -1358048280.000000 !!
    [c6xdsp ] ************ f_mse = 1102.986386, y_psnr = 85150016.000000 !!
    [c6xdsp ] ************ f_mse = 1102.986413, y_psnr = 109124712.000000 !!


    it looks like the math function of log10 wasn't supported no matter in DSP or M3VPSS or M3VIDEO.

    Right??  if not, how can I do that ??