In some cases, Y which represents the height of a column was equal to 1
and therefore when passed through the log, the output displayed was
zero, by adding this 0.1, this allows you to see a column when y = 1
without really changing the height of each column
(cherry picked from commit
c347fed91e76bd31387171e1ff67224c21194362)
Gbp-Pq: Name 0017-spectrogram-allows-better-visualization-of-low-frequ.patch
#define HEIGHT_TEXT N_("Video height")
#define HEIGHT_LONGTEXT N_("The height of the visualization window, in pixels.")
+#define LOG_OFFSET 0.1
+
vlc_module_begin()
set_shortname(N_("glSpectrum"))
set_description(N_("3D OpenGL spectrum visualization"))
if (p_dest[j] > y)
y = p_dest[j];
}
- /* Calculate the height of the bar */
- float new_height = y != 0 ? logf(y) * 0.4f : 0;
+ /* Calculate the height of the bar
+ This log_offset makes it possible to display low values */
+ float new_height = y != 0 ? logf( y + LOG_OFFSET ) * 0.4f : 0;
height[i] = new_height > height[i]
? new_height : height[i];
}
#define GRAD_ANGLE_MAX 0.5
#define GRAD_INCR 0.01
+#define LOG_OFFSET 0.1
+
/*****************************************************************************
* dummy_Run
*****************************************************************************/
if ( p_dest[j] > y )
y = p_dest[j];
}
- /* Calculate the height of the bar */
+ /* Calculate the height of the bar
+ This log_offset makes it possible to display low values */
if( y != 0 )
{
- height[i] = log( y ) * 30;
+ height[i] = log( y + LOG_OFFSET ) * 30;
if( height[i] > 380 )
height[i] = 380;
}