You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
swr: drop 'AV' prefix from ResampleContext.
This type/struct is not part of the public API.
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct AVResampleContext{
|
typedef struct ResampleContext {
|
||||||
const AVClass *av_class;
|
const AVClass *av_class;
|
||||||
FELEM *filter_bank;
|
FELEM *filter_bank;
|
||||||
int filter_length;
|
int filter_length;
|
||||||
@@ -70,7 +70,7 @@ typedef struct AVResampleContext{
|
|||||||
int phase_mask;
|
int phase_mask;
|
||||||
int linear;
|
int linear;
|
||||||
double factor;
|
double factor;
|
||||||
}AVResampleContext;
|
} ResampleContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0th order modified bessel function of the first kind.
|
* 0th order modified bessel function of the first kind.
|
||||||
@@ -199,13 +199,13 @@ static int build_filter(FELEM *filter, double factor, int tap_count, int phase_c
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVResampleContext *swr_resample_init(AVResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){
|
ResampleContext *swr_resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){
|
||||||
double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
|
double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
|
||||||
int phase_count= 1<<phase_shift;
|
int phase_count= 1<<phase_shift;
|
||||||
|
|
||||||
if (!c || c->phase_shift != phase_shift || c->linear!=linear || c->factor != factor
|
if (!c || c->phase_shift != phase_shift || c->linear!=linear || c->factor != factor
|
||||||
|| c->filter_length != FFMAX((int)ceil(filter_size/factor), 1)) {
|
|| c->filter_length != FFMAX((int)ceil(filter_size/factor), 1)) {
|
||||||
c = av_mallocz(sizeof(AVResampleContext));
|
c = av_mallocz(sizeof(*c));
|
||||||
if (!c)
|
if (!c)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ error:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void swr_resample_free(AVResampleContext **c){
|
void swr_resample_free(ResampleContext **c){
|
||||||
if(!*c)
|
if(!*c)
|
||||||
return;
|
return;
|
||||||
av_freep(&(*c)->filter_bank);
|
av_freep(&(*c)->filter_bank);
|
||||||
@@ -246,13 +246,13 @@ void swr_resample_free(AVResampleContext **c){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void swr_compensate(struct SwrContext *s, int sample_delta, int compensation_distance){
|
void swr_compensate(struct SwrContext *s, int sample_delta, int compensation_distance){
|
||||||
AVResampleContext *c= s->resample;
|
ResampleContext *c= s->resample;
|
||||||
// sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr;
|
// sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr;
|
||||||
c->compensation_distance= compensation_distance;
|
c->compensation_distance= compensation_distance;
|
||||||
c->dst_incr = c->ideal_dst_incr - c->ideal_dst_incr * (int64_t)sample_delta / compensation_distance;
|
c->dst_incr = c->ideal_dst_incr - c->ideal_dst_incr * (int64_t)sample_delta / compensation_distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
int swr_resample(AVResampleContext *c, short *dst, const short *src, int *consumed, int src_size, int dst_size, int update_ctx){
|
int swr_resample(ResampleContext *c, short *dst, const short *src, int *consumed, int src_size, int dst_size, int update_ctx){
|
||||||
int dst_index, i;
|
int dst_index, i;
|
||||||
int index= c->index;
|
int index= c->index;
|
||||||
int frac= c->frac;
|
int frac= c->frac;
|
||||||
@@ -341,7 +341,7 @@ av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", c->dst_incr, c->ideal_dst_incr, c->comp
|
|||||||
return dst_index;
|
return dst_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
int swr_multiple_resample(AVResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed){
|
int swr_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed){
|
||||||
int i, ret= -1;
|
int i, ret= -1;
|
||||||
|
|
||||||
for(i=0; i<dst->ch_count; i++){
|
for(i=0; i<dst->ch_count; i++){
|
||||||
|
@@ -61,7 +61,7 @@ typedef struct SwrContext { //FIXME find unused fields
|
|||||||
struct AudioConvert *in_convert;
|
struct AudioConvert *in_convert;
|
||||||
struct AudioConvert *out_convert;
|
struct AudioConvert *out_convert;
|
||||||
struct AudioConvert *full_convert;
|
struct AudioConvert *full_convert;
|
||||||
struct AVResampleContext *resample;
|
struct ResampleContext *resample;
|
||||||
|
|
||||||
float matrix[SWR_CH_MAX][SWR_CH_MAX];
|
float matrix[SWR_CH_MAX][SWR_CH_MAX];
|
||||||
int32_t matrix32[SWR_CH_MAX][SWR_CH_MAX];
|
int32_t matrix32[SWR_CH_MAX][SWR_CH_MAX];
|
||||||
@@ -70,11 +70,11 @@ typedef struct SwrContext { //FIXME find unused fields
|
|||||||
//TODO callbacks for asm optims
|
//TODO callbacks for asm optims
|
||||||
}SwrContext;
|
}SwrContext;
|
||||||
|
|
||||||
struct AVResampleContext *swr_resample_init(struct AVResampleContext *, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff);
|
struct ResampleContext *swr_resample_init(struct ResampleContext *, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff);
|
||||||
void swr_resample_free(struct AVResampleContext **c);
|
void swr_resample_free(struct ResampleContext **c);
|
||||||
int swr_multiple_resample(struct AVResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed);
|
int swr_multiple_resample(struct ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed);
|
||||||
void swr_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
|
void swr_resample_compensate(struct ResampleContext *c, int sample_delta, int compensation_distance);
|
||||||
int swr_resample(struct AVResampleContext *c, short *dst, const short *src, int *consumed, int src_size, int dst_size, int update_ctx);
|
int swr_resample(struct ResampleContext *c, short *dst, const short *src, int *consumed, int src_size, int dst_size, int update_ctx);
|
||||||
|
|
||||||
int swr_rematrix_init(SwrContext *s);
|
int swr_rematrix_init(SwrContext *s);
|
||||||
int swr_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy);
|
int swr_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy);
|
||||||
|
Reference in New Issue
Block a user