Changeset 524254f836416fba567be30b2b168d63811fb3a5

Show
Ignore:
Timestamp:
21/10/05 00:37:14 (3 years ago)
Author:
Scott Caudle <zcot@videolan.org>
git-committer:
Scott Caudle <zcot@videolan.org> 1129847834 +0000
git-parent:

[46d8d47a755832d9153d40825eefdfd5cd4737f5]

git-author:
Scott Caudle <zcot@videolan.org> 1129847834 +0000
Message:

updates spectrometer visualization. some optimization tweaks and additional features.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/visualization/visual/effects.c

    r661e782 r524254f  
    397397 
    398398    p_buffs = p_s16_buff; 
    399     //i_nb_bands = config_GetInt ( p_aout, "visual-nbbands" ); 
    400     //i_separ    = config_GetInt( p_aout, "visual-separ" ); 
    401     //i_amp     = config_GetInt ( p_aout, "visual-amp" ); 
    402     //i_peak     = config_GetInt ( p_aout, "visual-peaks" ); 
    403     /* previous 4 vars changed.. using them as `spect' variables */ 
    404399    i_original     = config_GetInt ( p_aout, "spect-show-original" ); 
    405400    i_nb_bands     = config_GetInt ( p_aout, "spect-nbbands" ); 
     
    421416    else 
    422417    { 
    423         i_nb_bands = 80; 
     418        if( i_nb_bands > 80 ) 
     419            i_nb_bands = 80; 
    424420        xscale = xscale2; 
    425421    } 
    426     i_nb_bands *= i_sections; 
    427     /* whoops, dont malloc the following memory for all the duplicated bands.. 
    428         -only the original 20 or 80 will be fine */ 
    429422 
    430423    if( !p_effect->p_data ) 
     
    447440    } 
    448441 
    449  
    450442    height = (int *)malloc( i_nb_bands * sizeof(int) ); 
    451443    if( !height) 
     
    454446        return -1; 
    455447    } 
     448 
    456449    /* Convert the buffer to int16_t  */ 
    457450    /* Pasted from float32tos16.c */ 
     
    482475    for(i= 0; i< FFT_BUFFER_SIZE ; i++ ) 
    483476        p_dest[i] = ( (int) sqrt( p_output [ i + 1 ] ) ) >> 8; 
     477 
     478    i_nb_bands *= i_sections; 
    484479 
    485480    for ( i = 0 ; i< i_nb_bands/i_sections ;i++) 
     
    661656 
    662657                    *(p_picture->p[1].p_pixels + x + y * p_picture->p[1].i_pitch 
    663                     - p_picture->p[1].i_pitch 
    664658                    ) = 0;/* U(R,G,B); */ 
    665659 
     
    668662                        if ( 0x04 * (i_line + k ) -0x0f < 0xff) 
    669663                            *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    670                             - p_picture->p[2].i_pitch 
    671664                            ) = ( 0x04 * ( i_line + k ) ) -(color1-1);/* -V(R,G,B); */ 
    672665                        else 
    673666                            *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    674                             - p_picture->p[2].i_pitch 
    675667                            ) = 255;/* V(R,G,B); */ 
    676668                    } 
     
    678670                    { 
    679671                        *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    680                         - p_picture->p[2].i_pitch 
    681672                        ) = color1;/* V(R,G,B); */ 
    682673                    } 
     
    706697 
    707698            *(p_picture->p[1].p_pixels + x + y * p_picture->p[1].i_pitch 
    708             - p_picture->p[1].i_pitch 
    709699            ) = 0;/* U(R,G,B); */ 
    710700 
     
    713703                if( 0x04 * i_line -0x0f < 0xff) 
    714704                    *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    715                     - p_picture->p[2].i_pitch 
    716705                    ) = ( 0x04 * i_line) -(color1-1);/* -V(R,G,B); */ 
    717706                else 
    718707                    *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    719                     - p_picture->p[2].i_pitch 
    720708                    ) = 255;/* V(R,G,B); */ 
    721709            } 
     
    723711            { 
    724712                *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    725                 - p_picture->p[2].i_pitch 
    726713                ) = color1;/* V(R,G,B); */ 
    727714            } 
     
    756743 
    757744                *(p_picture->p[1].p_pixels + x + y * p_picture->p[1].i_pitch 
    758                 - p_picture->p[1].i_pitch 
    759745                ) = 0; 
    760746 
     
    763749                    if ( 0x04 * i_line -0x0f < 0xff) 
    764750                        *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    765                         - p_picture->p[2].i_pitch 
    766751                        ) = ( 0x04 * i_line) -(color1-1); 
    767752                    else 
    768753                        *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    769                         - p_picture->p[2].i_pitch 
    770754                        ) = 255; 
    771755                } 
     
    773757                { 
    774758                    *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
    775                     - p_picture->p[2].i_pitch 
    776759                    ) = color1; 
    777760                } 
  • modules/visualization/visual/visual.c

    r2b6826a r524254f  
    5252#define NBBANDS_LONGTEXT N_( \ 
    5353      "Number of bands used by spectrum analyzer, should be 20 or 80." ) 
     54#define SPNBBANDS_LONGTEXT N_( \ 
     55      "Number of bands used by the spectrOmeter, from 20 to 80." ) 
    5456 
    5557#define SEPAR_TEXT N_( "Band separator" ) 
     
    126128             PEAKS_TEXT, PEAKS_LONGTEXT, VLC_TRUE ); 
    127129    set_section( N_("Spectrometer") , NULL ); 
    128     add_bool("spect-show-original", VLC_TRUE, NULL, 
     130    add_bool("spect-show-original", VLC_FALSE, NULL, 
    129131             ORIG_TEXT, ORIG_LONGTEXT, VLC_TRUE ); 
    130132    add_bool("spect-show-base", VLC_TRUE, NULL, 
    131133             BASE_TEXT, BASE_LONGTEXT, VLC_TRUE ); 
    132     add_integer("spect-radius", 22, NULL, 
     134    add_integer("spect-radius", 42, NULL, 
    133135             RADIUS_TEXT, RADIUS_LONGTEXT, VLC_TRUE ); 
    134     add_integer("spect-sections", 2, NULL, 
     136    add_integer("spect-sections", 3, NULL, 
    135137             SECT_TEXT, SECT_LONGTEXT, VLC_TRUE ); 
    136     add_integer("spect-color", 16, NULL, 
     138    add_integer("spect-color", 80, NULL, 
    137139             COLOR1_TEXT, COLOR1_LONGTEXT, VLC_TRUE ); 
    138140    add_bool("spect-show-bands", VLC_TRUE, NULL, 
    139141             BANDS_TEXT, BANDS_LONGTEXT, VLC_TRUE ); 
    140     add_integer("spect-nbbands", 80, NULL, 
    141              NBBANDS_TEXT, NBBANDS_LONGTEXT, VLC_TRUE ); 
     142    add_integer("spect-nbbands", 32, NULL, 
     143             NBBANDS_TEXT, SPNBBANDS_LONGTEXT, VLC_TRUE ); 
    142144    add_integer("spect-separ", 1, NULL, 
    143145             SEPAR_TEXT, SEPAR_LONGTEXT, VLC_TRUE ); 
    144     add_integer("spect-amp", 3, NULL, 
     146    add_integer("spect-amp", 8, NULL, 
    145147             AMP_TEXT, AMP_LONGTEXT, VLC_TRUE ); 
    146148    add_bool("spect-show-peaks", VLC_TRUE, NULL, 
    147149             PEAKS_TEXT, PEAKS_LONGTEXT, VLC_TRUE ); 
    148     add_integer("spect-peak-width", 1, NULL, 
     150    add_integer("spect-peak-width", 61, NULL, 
    149151             PEAK_WIDTH_TEXT, PEAK_WIDTH_LONGTEXT, VLC_TRUE ); 
    150152    add_integer("spect-peak-height", 1, NULL,