X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fresample.h;h=d58e1e52fe01156454e62c305284f091e8e08c85;hb=166867a58d74619aa11aeb562a994cc364d62231;hp=b80bb6bd933304d59c79effad28fc250b7002c51;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/resample.h b/cinelerra-5.1/cinelerra/resample.h index b80bb6bd..d58e1e52 100644 --- a/cinelerra-5.1/cinelerra/resample.h +++ b/cinelerra-5.1/cinelerra/resample.h @@ -29,7 +29,7 @@ #define BLACKSIZE 25 #include "resample.inc" -#include "samples.inc" +#include "samples.h" #include class Resample @@ -41,57 +41,43 @@ public: // All positions are in file sample rate // This must reverse the buffer during reverse playback // so the filter always renders forward. - virtual int read_samples(Samples *buffer, int64_t start, int64_t len); + virtual int read_samples(Samples *buffer, + int64_t start, int64_t len, int direction); // Resample from the file handler and store in *output. // Returns 1 if the input reader failed. - int resample(Samples *samples, - int64_t out_len, - int in_rate, - int out_rate, // Starting sample in output samplerate // If reverse, the end of the buffer. - int64_t out_position, - int direction); - - int get_direction(); - + int resample(Samples *samples, + int64_t out_len, int in_rate, int out_rate, + int64_t out_position, int direction); static void reverse_buffer(double *buffer, int64_t len); // Reset after seeking void reset(); private: - double blackman(int i, double offset, double fcn, int l); + void blackman(double fcn, int l); + int set_input_position(int64_t in_pos, int in_dir); // Query output temp int get_output_size(); // void read_output(Samples *output, int size); // Resamples input and dumps it to output_temp - void resample_chunk(Samples *input, - int64_t in_len, - int in_rate, - int out_rate); - int read_chunk(Samples *input, - int64_t len); - -// History buffer for resampling. - double *old; - double itime; - - + void resample_chunk(Samples *input, int64_t in_len, + int in_rate, int out_rate); + int direction; // Unaligned resampled output double *output_temp; - - // Total samples in unaligned output int64_t output_size; - - int direction; // Allocation of unaligned output int64_t output_allocation; +// History buffer for resampling. + Samples old; // input chunk Samples *input; + double itime; // Position of source in source sample rate. int64_t input_position; int64_t input_size;