Changeset 2a94eca


Ignore:
Timestamp:
Dec 20, 2018, 7:03:45 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
7dea72f
Parents:
2589ea9
Message:

[io] add helpers to pad source output

Location:
src/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/io/ioutils.c

    r2589ea9 r2a94eca  
    2020
    2121#include "aubio_priv.h"
     22#include "fmat.h"
    2223
    2324uint_t
     
    9293}
    9394
     95void
     96aubio_source_pad_output (fvec_t *read_data, uint_t source_read)
     97{
     98  uint_t i = 0;
     99  if (source_read < read_data->length) {
     100    for (i = source_read; i < read_data->length; i++) {
     101      read_data->data[i] = 0.;
     102    }
     103  }
     104}
     105
     106void
     107aubio_source_pad_multi_output (fmat_t *read_data,
     108    uint_t source_channels, uint_t source_read) {
     109  uint_t i, j;
     110  if (source_read < read_data->length) {
     111    for (i = 0; i < read_data->height; i++) {
     112      for (j = source_read; j < read_data->length; j++) {
     113        read_data->data[i][j] = 0.;
     114      }
     115    }
     116  }
     117}
     118
    94119uint_t
    95120aubio_sink_validate_input_length(const char_t *kind, const char_t *path,
  • src/io/ioutils.h

    r2589ea9 r2a94eca  
    8080    uint_t source_channels, uint_t read_data_height);
    8181
     82/** pad end of source output vector with zeroes
     83
     84  \param read_data   output vector to pad
     85  \param source_read number of frames read
     86
     87*/
     88void
     89aubio_source_pad_output (fvec_t *read_data, uint_t source_read);
     90
     91/** pad end of source output matrix with zeroes
     92
     93  \param read_data   output matrix to pad
     94  \param source_channels number of channels in the source
     95  \param source_read number of frames read
     96
     97*/
     98void
     99aubio_source_pad_multi_output (fmat_t *read_data, uint_t source_channels,
     100        uint_t source_read);
     101
    82102/** validate length of sink input
    83103
Note: See TracChangeset for help on using the changeset viewer.