diff options
author | clsid2 <clsid2@3b938f2f-1a1a-0410-8054-a526ea5ff92c> | 2011-03-07 00:08:34 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-03 22:52:58 +0200 |
commit | 0e09997fa452565e59bfbdf81a96917b3c503470 (patch) | |
tree | 51148224344500d4342cdd2da8ea65952d07688e /libavcodec/fmtconvert.c | |
parent | 361fa0ed40a042393a2691e3dba9bd7c4bcfe188 (diff) | |
download | ffmpeg-0e09997fa452565e59bfbdf81a96917b3c503470.tar.gz |
Libavcodec AC3/E-AC3/DTS decoders now output floating point data.
git-svn-id: https://ffdshow-tryout.svn.sourceforge.net/svnroot/ffdshow-tryout@3769 3b938f2f-1a1a-0410-8054-a526ea5ff92c
Diffstat (limited to 'libavcodec/fmtconvert.c')
-rw-r--r-- | libavcodec/fmtconvert.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c index e27c1f69f4..0e8aa5e909 100644 --- a/libavcodec/fmtconvert.c +++ b/libavcodec/fmtconvert.c @@ -66,3 +66,34 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) if (HAVE_ALTIVEC) ff_fmt_convert_init_altivec(c, avctx); if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); } + +/* ffdshow custom code */ +void float_interleave(float *dst, const float **src, long len, int channels) +{ + int i,j,c; + if(channels==2){ + for(i=0; i<len; i++){ + dst[2*i] = src[0][i] / 32768.0f; + dst[2*i+1] = src[1][i] / 32768.0f; + } + }else{ + for(c=0; c<channels; c++) + for(i=0, j=c; i<len; i++, j+=channels) + dst[j] = src[c][i] / 32768.0f; + } +} + +void float_interleave_noscale(float *dst, const float **src, long len, int channels) +{ + int i,j,c; + if(channels==2){ + for(i=0; i<len; i++){ + dst[2*i] = src[0][i]; + dst[2*i+1] = src[1][i]; + } + }else{ + for(c=0; c<channels; c++) + for(i=0, j=c; i<len; i++, j+=channels) + dst[j] = src[c][i]; + } +} |