Mercurial > libavcodec.hg
comparison resample2.c @ 2426:1ee03f2a6cd5 libavcodec
av_malloc vs av_mallocz patch by (Kurosu <kurosu inforezo org>)
author | michael |
---|---|
date | Wed, 12 Jan 2005 18:25:48 +0000 |
parents | 21c5ef8a4ff7 |
children | d4c4b84e0fac |
comparison
equal
deleted
inserted
replaced
2425:d0bcc85d3856 | 2426:1ee03f2a6cd5 |
---|---|
132 */ | 132 */ |
133 AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){ | 133 AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){ |
134 AVResampleContext *c= av_mallocz(sizeof(AVResampleContext)); | 134 AVResampleContext *c= av_mallocz(sizeof(AVResampleContext)); |
135 double factor= FFMIN(out_rate * cutoff / in_rate, 1.0); | 135 double factor= FFMIN(out_rate * cutoff / in_rate, 1.0); |
136 int phase_count= 1<<phase_shift; | 136 int phase_count= 1<<phase_shift; |
137 | |
138 memset(c, 0, sizeof(AVResampleContext)); | |
139 | 137 |
140 c->phase_shift= phase_shift; | 138 c->phase_shift= phase_shift; |
141 c->phase_mask= phase_count-1; | 139 c->phase_mask= phase_count-1; |
142 c->linear= linear; | 140 c->linear= linear; |
143 | 141 |