version 1.9, 2016/06/10 06:42:22 |
version 1.10, 2016/09/23 07:29:24 |
|
|
|
|
/* |
/* |
* Resample the given number of frames. The number of output frames |
* Resample the given number of frames. The number of output frames |
* must match the coresponding number the input frames. Either always |
* must match the coresponding number of input frames. Either always |
* use icnt and ocnt such that: |
* use icnt and ocnt such that: |
* |
* |
* icnt * oblksz = ocnt * iblksz |
* icnt * oblksz = ocnt * iblksz |
|
|
unsigned int i, g; |
unsigned int i, g; |
|
|
/* |
/* |
* reduice iblksz/oblksz fraction |
* reduce iblksz/oblksz fraction |
*/ |
*/ |
g = uint_gcd(iblksz, oblksz); |
g = uint_gcd(iblksz, oblksz); |
iblksz /= g; |
iblksz /= g; |
oblksz /= g; |
oblksz /= g; |
|
|
/* |
/* |
* ensure weired rates dont cause integer overflows |
* ensure weird rates don't cause integer overflow |
*/ |
*/ |
while (iblksz > ADATA_UNIT || oblksz > ADATA_UNIT) { |
while (iblksz > ADATA_UNIT || oblksz > ADATA_UNIT) { |
iblksz >>= 1; |
iblksz >>= 1; |
|
|
} |
} |
|
|
/* |
/* |
* decode "todo" frames from from foreign to native encoding |
* decode "todo" frames from foreign to native encoding |
*/ |
*/ |
void |
void |
dec_do(struct conv *p, unsigned char *in, unsigned char *out, int todo) |
dec_do(struct conv *p, unsigned char *in, unsigned char *out, int todo) |
|
|
} |
} |
|
|
/* |
/* |
* overwrite output with "todo" input frames with with the given volume |
* overwrite output with "todo" input frames with the given volume |
*/ |
*/ |
void |
void |
cmap_copy(struct cmap *p, void *in, void *out, int vol, int todo) |
cmap_copy(struct cmap *p, void *in, void *out, int vol, int todo) |