Changeset eaa8fb6d9f44b149bdcd4e5252794765e620ad83

Show
Ignore:
Timestamp:
28/06/08 12:07:02 (4 months ago)
Author:
Rémi Denis-Courmont <rdenis@simphalempin.com>
git-committer:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1214647622 +0300
git-parent:

[1f03f5e7d63405106b7fc4f34101d04ce61c78d0]

git-author:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1214647622 +0300
Message:

uint is not standard (and breaks Win32) - use unsigned

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/audio_filter/scaletempo.c

    r3c5f3a2 reaa8fb6  
    8282    double    scale; 
    8383    /* parameters */ 
    84     uint      ms_stride; 
     84    unsigned  ms_stride; 
    8585    double    percent_overlap; 
    86     uint      ms_search; 
     86    unsigned  ms_search; 
    8787    /* audio format */ 
    88     uint      samples_per_frame;  /* AKA number of channels */ 
    89     uint      bytes_per_sample; 
    90     uint      bytes_per_frame; 
    91     uint      sample_rate; 
     88    unsigned  samples_per_frame;  /* AKA number of channels */ 
     89    unsigned  bytes_per_sample; 
     90    unsigned  bytes_per_frame; 
     91    unsigned  sample_rate; 
    9292    /* stride */ 
    9393    double    frames_stride_scaled; 
    9494    double    frames_stride_error; 
    95     uint      bytes_stride; 
     95    unsigned  bytes_stride; 
    9696    double    bytes_stride_scaled; 
    97     uint      bytes_queue_max; 
    98     uint      bytes_queued; 
    99     uint      bytes_to_slide; 
     97    unsigned  bytes_queue_max; 
     98    unsigned  bytes_queued; 
     99    unsigned  bytes_to_slide; 
    100100    uint8_t  *buf_queue; 
    101101    /* overlap */ 
    102     uint      samples_overlap; 
    103     uint      samples_standing; 
    104     uint      bytes_overlap; 
    105     uint      bytes_standing; 
     102    unsigned  samples_overlap; 
     103    unsigned  samples_standing; 
     104    unsigned  bytes_overlap; 
     105    unsigned  bytes_standing; 
    106106    void     *buf_overlap; 
    107107    void     *table_blend; 
    108     void    (*output_overlap)( aout_filter_t *p_filter, void *p_out_buf, uint bytes_off ); 
     108    void    (*output_overlap)( aout_filter_t *p_filter, void *p_out_buf, unsigned bytes_off ); 
    109109    /* best overlap */ 
    110     uint      frames_search; 
     110    unsigned  frames_search; 
    111111    void     *buf_pre_corr; 
    112112    void     *table_window; 
    113     uint    (*best_overlap_offset)( aout_filter_t *p_filter ); 
     113    unsigned(*best_overlap_offset)( aout_filter_t *p_filter ); 
    114114    /* for "audio filter" only, manage own buffers */ 
    115115    int       i_buf; 
     
    120120 * best_overlap_offset: calculate best offset for overlap 
    121121 *****************************************************************************/ 
    122 static uint best_overlap_offset_float( aout_filter_t *p_filter ) 
     122static unsigned best_overlap_offset_float( aout_filter_t *p_filter ) 
    123123{ 
    124124    aout_filter_sys_t *p = p_filter->p_sys; 
    125125    float *pw, *po, *ppc, *search_start; 
    126126    float best_corr = INT_MIN; 
    127     uint best_off = 0; 
    128     uint i, off; 
     127    unsigned best_off = 0; 
     128    unsigned i, off; 
    129129 
    130130    pw  = p->table_window; 
     
    159159static void output_overlap_float( aout_filter_t   *p_filter, 
    160160                                  void            *buf_out, 
    161                                   uint             bytes_off ) 
     161                                  unsigned         bytes_off ) 
    162162{ 
    163163    aout_filter_sys_t *p = p_filter->p_sys; 
     
    166166    float *po   = p->buf_overlap; 
    167167    float *pin  = (float *)( p->buf_queue + bytes_off ); 
    168     uint i; 
     168    unsigned i; 
    169169    for( i = 0; i < p->samples_overlap; i++ ) { 
    170170        *pout++ = *po - *pb++ * ( *po - *pin++ ); po++; 
     
    181181{ 
    182182    aout_filter_sys_t *p = p_filter->p_sys; 
    183     uint bytes_in = i_buffer - offset; 
     183    unsigned bytes_in = i_buffer - offset; 
    184184    size_t offset_unchanged = offset; 
    185185 
    186186    if( p->bytes_to_slide > 0 ) { 
    187187        if( p->bytes_to_slide < p->bytes_queued ) { 
    188             uint bytes_in_move = p->bytes_queued - p->bytes_to_slide; 
     188            unsigned bytes_in_move = p->bytes_queued - p->bytes_to_slide; 
    189189            memmove( p->buf_queue, 
    190190                     p->buf_queue + p->bytes_to_slide, 
     
    193193            p->bytes_queued   = bytes_in_move; 
    194194        } else { 
    195             uint bytes_in_skip; 
     195            unsigned bytes_in_skip; 
    196196            p->bytes_to_slide -= p->bytes_queued; 
    197197            bytes_in_skip      = __MIN( p->bytes_to_slide, bytes_in ); 
     
    204204 
    205205    if( bytes_in > 0 ) { 
    206         uint bytes_in_copy = __MIN( p->bytes_queue_max - p->bytes_queued, bytes_in ); 
     206        unsigned bytes_in_copy = __MIN( p->bytes_queue_max - p->bytes_queued, bytes_in ); 
    207207        memcpy( p->buf_queue + p->bytes_queued, 
    208208                p_buffer + offset, 
     
    226226 
    227227    size_t offset_in = fill_queue( p_filter, p_buffer, i_buffer, 0 ); 
    228     uint bytes_out = 0; 
     228    unsigned bytes_out = 0; 
    229229    while( p->bytes_queued >= p->bytes_queue_max ) { 
    230         uint bytes_off = 0; 
     230        unsigned bytes_off = 0; 
    231231 
    232232        // output stride 
     
    248248                p->bytes_overlap ); 
    249249        double frames_to_slide = p->frames_stride_scaled + p->frames_stride_error; 
    250         uint  frames_to_stride_whole = (int)frames_to_slide; 
     250        unsigned frames_to_stride_whole = (int)frames_to_slide; 
    251251        p->bytes_to_slide       = frames_to_stride_whole * p->bytes_per_frame; 
    252252        p->frames_stride_error  = frames_to_slide - frames_to_stride_whole; 
     
    269269    if( bytes_to_out >= (int)p->bytes_queue_max ) { 
    270270      /* while (total_buffered - stride_length * n >= queue_max) n++ */ 
    271       bytes_out = p->bytes_stride * ( (uint)( 
     271      bytes_out = p->bytes_stride * ( (unsigned)( 
    272272          ( bytes_to_out - p->bytes_queue_max + /* rounding protection */ p->bytes_per_frame ) 
    273273          / p->bytes_stride_scaled ) + 1 ); 
     
    282282{ 
    283283    aout_filter_sys_t *p = p_filter->p_sys; 
    284     uint i,j; 
    285  
    286     uint frames_stride = p->ms_stride * p->sample_rate / 1000.0; 
     284    unsigned i,j; 
     285 
     286    unsigned frames_stride = p->ms_stride * p->sample_rate / 1000.0; 
    287287    p->bytes_stride = frames_stride * p->bytes_per_frame; 
    288288 
    289289    /* overlap */ 
    290     uint frames_overlap = frames_stride * p->percent_overlap; 
     290    unsigned frames_overlap = frames_stride * p->percent_overlap; 
    291291    if( frames_overlap < 1 ) { /* if no overlap */ 
    292292        p->bytes_overlap    = 0; 
     
    295295        p->output_overlap   = NULL; 
    296296    } else { 
    297         uint prev_overlap   = p->bytes_overlap; 
     297        unsigned prev_overlap   = p->bytes_overlap; 
    298298        p->bytes_overlap    = frames_overlap * p->bytes_per_frame; 
    299299        p->samples_overlap  = frames_overlap * p->samples_per_frame; 
     
    324324        p->best_overlap_offset = NULL; 
    325325    } else { 
    326         uint bytes_pre_corr = ( p->samples_overlap - p->samples_per_frame ) * 4; /* sizeof (int32|float) */ 
     326        unsigned bytes_pre_corr = ( p->samples_overlap - p->samples_per_frame ) * 4; /* sizeof (int32|float) */ 
    327327        p->buf_pre_corr = malloc( bytes_pre_corr ); 
    328328        p->table_window = malloc( bytes_pre_corr ); 
     
    340340    } 
    341341 
    342     uint new_size = ( p->frames_search + frames_stride + frames_overlap ) * p->bytes_per_frame; 
     342    unsigned new_size = ( p->frames_search + frames_stride + frames_overlap ) * p->bytes_per_frame; 
    343343    if( p->bytes_queued > new_size ) { 
    344344        if( p->bytes_to_slide > p->bytes_queued ) { 
     
    346346          p->bytes_queued    = 0; 
    347347        } else { 
    348             uint new_queued = __MIN( p->bytes_queued - p->bytes_to_slide, new_size ); 
     348            unsigned new_queued = __MIN( p->bytes_queued - p->bytes_to_slide, new_size ); 
    349349            memmove( p->buf_queue, 
    350350                     p->buf_queue + p->bytes_queued - new_queued,