Fix output channle ordering

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24721 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rtogni 2007-10-07 15:06:53 +00:00
parent a3f24d8300
commit b8c80f6477
1 changed files with 24 additions and 25 deletions

View File

@ -52,7 +52,7 @@ LIBAD_EXTERN(libdca)
static const char ch2flags[6] = {
DTS_MONO,
DTS_STEREO,
DTS_2F1R,
DTS_3F,
DTS_2F2R,
DTS_3F2R,
DTS_3F2R | DTS_LFE
@ -90,10 +90,9 @@ static void convert2s16_multi(sample_t *f, int16_t *s16, int flags, int ch_out)
break;
case DTS_3F:
for(i = 0; i < 256; i++){
s16[5*i] = convert(f[i]);
s16[5*i+1] = convert(f[i+512]);
s16[5*i+2] = s16[5*i+3] = 0;
s16[5*i+4] = convert(f[i+256]);
s16[3*i] = convert(f[i+256]);
s16[3*i+1] = convert(f[i+512]);
s16[3*i+2] = convert(f[i]);
}
break;
case DTS_2F2R:
@ -106,57 +105,57 @@ static void convert2s16_multi(sample_t *f, int16_t *s16, int flags, int ch_out)
break;
case DTS_3F2R:
for(i = 0; i < 256; i++){
s16[5*i] = convert(f[i]);
s16[5*i] = convert(f[i+256]);
s16[5*i+1] = convert(f[i+512]);
s16[5*i+2] = convert(f[i+768]);
s16[5*i+3] = convert(f[i+1024]);
s16[5*i+4] = convert(f[i+256]);
s16[5*i+4] = convert(f[i]);
}
break;
case DTS_MONO | DTS_LFE:
for(i = 0; i < 256; i++){
s16[6*i] = s16[6*i+1] = s16[6*i+2] = s16[6*i+3] = 0;
s16[6*i+4] = convert(f[i+256]);
s16[6*i+5] = convert(f[i]);
s16[6*i+4] = convert(f[i]);
s16[6*i+5] = convert(f[i+256]);
}
break;
case DTS_CHANNEL | DTS_LFE:
case DTS_STEREO | DTS_LFE:
case DTS_DOLBY | DTS_LFE:
for(i = 0; i < 256; i++){
s16[6*i] = convert(f[i+256]);
s16[6*i+1] = convert(f[i+512]);
s16[6*i] = convert(f[i]);
s16[6*i+1] = convert(f[i+256]);
s16[6*i+2] = s16[6*i+3] = s16[6*i+4] = 0;
s16[6*i+5] = convert(f[i]);
s16[6*i+5] = convert(f[i+512]);
}
break;
case DTS_3F | DTS_LFE:
for(i = 0; i < 256; i++){
s16[6*i] = convert(f[i+256]);
s16[6*i+1] = convert(f[i+768]);
s16[6*i+1] = convert(f[i+512]);
s16[6*i+2] = s16[6*i+3] = 0;
s16[6*i+4] = convert(f[i+512]);
s16[6*i+5] = convert(f[i]);
s16[6*i+4] = convert(f[i]);
s16[6*i+5] = convert(f[i+768]);
}
break;
case DTS_2F2R | DTS_LFE:
for(i = 0; i < 256; i++){
s16[6*i] = convert(f[i+256]);
s16[6*i+1] = convert(f[i+512]);
s16[6*i+2] = convert(f[i+768]);
s16[6*i+3] = convert(f[i+1024]);
s16[6*i] = convert(f[i]);
s16[6*i+1] = convert(f[i+256]);
s16[6*i+2] = convert(f[i+512]);
s16[6*i+3] = convert(f[i+768]);
s16[6*i+4] = 0;
s16[6*i+5] = convert(f[i]);
s16[6*i+5] = convert(f[1024]);
}
break;
case DTS_3F2R | DTS_LFE:
for(i = 0; i < 256; i++){
s16[6*i] = convert(f[i+256]);
s16[6*i+1] = convert(f[i+768]);
s16[6*i+2] = convert(f[i+1024]);
s16[6*i+3] = convert(f[i+1280]);
s16[6*i+4] = convert(f[i+512]);
s16[6*i+5] = convert(f[i]);
s16[6*i+1] = convert(f[i+512]);
s16[6*i+2] = convert(f[i+768]);
s16[6*i+3] = convert(f[i+1024]);
s16[6*i+4] = convert(f[i]);
s16[6*i+5] = convert(f[i+1280]);
}
break;
}