Revision 0e09997f libavcodec/fmtconvert.c
libavcodec/fmtconvert.c | ||
---|---|---|
66 | 66 |
if (HAVE_ALTIVEC) ff_fmt_convert_init_altivec(c, avctx); |
67 | 67 |
if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); |
68 | 68 |
} |
69 |
|
|
70 |
/* ffdshow custom code */ |
|
71 |
void float_interleave(float *dst, const float **src, long len, int channels) |
|
72 |
{ |
|
73 |
int i,j,c; |
|
74 |
if(channels==2){ |
|
75 |
for(i=0; i<len; i++){ |
|
76 |
dst[2*i] = src[0][i] / 32768.0f; |
|
77 |
dst[2*i+1] = src[1][i] / 32768.0f; |
|
78 |
} |
|
79 |
}else{ |
|
80 |
for(c=0; c<channels; c++) |
|
81 |
for(i=0, j=c; i<len; i++, j+=channels) |
|
82 |
dst[j] = src[c][i] / 32768.0f; |
|
83 |
} |
|
84 |
} |
|
85 |
|
|
86 |
void float_interleave_noscale(float *dst, const float **src, long len, int channels) |
|
87 |
{ |
|
88 |
int i,j,c; |
|
89 |
if(channels==2){ |
|
90 |
for(i=0; i<len; i++){ |
|
91 |
dst[2*i] = src[0][i]; |
|
92 |
dst[2*i+1] = src[1][i]; |
|
93 |
} |
|
94 |
}else{ |
|
95 |
for(c=0; c<channels; c++) |
|
96 |
for(i=0, j=c; i<len; i++, j+=channels) |
|
97 |
dst[j] = src[c][i]; |
|
98 |
} |
|
99 |
} |
Also available in: Unified diff