1 /*****************************************************************************
2 * ac3_downmix.c: ac3 downmix functions
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: ac3_downmix.c,v 1.23 2001/05/14 15:58:03 reno Exp $
7 * Authors: Michel Kaempf <maxx@via.ecp.fr>
8 * Aaron Holtzman <aholtzma@engr.uvic.ca>
9 * Renaud Dartus <reno@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
27 #include <string.h> /* memcpy() */
34 #include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */
37 #include "stream_control.h"
38 #include "input_ext-dec.h"
40 #include "ac3_decoder.h"
41 #include "ac3_downmix.h"
43 void downmix_init (downmix_t * p_downmix)
46 if ( TestCPU (CPU_CAPABILITY_SSE) )
48 intf_WarnMsg (1,"ac3dec: using MMX_SSE for downmix");
49 p_downmix->downmix_3f_2r_to_2ch = downmix_3f_2r_to_2ch_sse;
50 p_downmix->downmix_2f_2r_to_2ch = downmix_2f_2r_to_2ch_sse;
51 p_downmix->downmix_3f_1r_to_2ch = downmix_3f_1r_to_2ch_sse;
52 p_downmix->downmix_2f_1r_to_2ch = downmix_2f_1r_to_2ch_sse;
53 p_downmix->downmix_3f_0r_to_2ch = downmix_3f_0r_to_2ch_sse;
54 p_downmix->stream_sample_2ch_to_s16 = stream_sample_2ch_to_s16_sse;
55 p_downmix->stream_sample_1ch_to_s16 = stream_sample_1ch_to_s16_sse;
57 else if ( TestCPU (CPU_CAPABILITY_3DNOW) )
59 intf_WarnMsg (1,"ac3dec: using MMX_3DNOW for downmix");
60 p_downmix->downmix_3f_2r_to_2ch = downmix_3f_2r_to_2ch_3dn;
61 p_downmix->downmix_2f_2r_to_2ch = downmix_2f_2r_to_2ch_3dn;
62 p_downmix->downmix_3f_1r_to_2ch = downmix_3f_1r_to_2ch_3dn;
63 p_downmix->downmix_2f_1r_to_2ch = downmix_2f_1r_to_2ch_3dn;
64 p_downmix->downmix_3f_0r_to_2ch = downmix_3f_0r_to_2ch_3dn;
65 p_downmix->stream_sample_2ch_to_s16 = stream_sample_2ch_to_s16_3dn;
66 p_downmix->stream_sample_1ch_to_s16 = stream_sample_1ch_to_s16_3dn;
71 p_downmix->downmix_3f_2r_to_2ch = downmix_3f_2r_to_2ch_c;
72 p_downmix->downmix_2f_2r_to_2ch = downmix_2f_2r_to_2ch_c;
73 p_downmix->downmix_3f_1r_to_2ch = downmix_3f_1r_to_2ch_c;
74 p_downmix->downmix_2f_1r_to_2ch = downmix_2f_1r_to_2ch_c;
75 p_downmix->downmix_3f_0r_to_2ch = downmix_3f_0r_to_2ch_c;
76 p_downmix->stream_sample_2ch_to_s16 = stream_sample_2ch_to_s16_c;
77 p_downmix->stream_sample_1ch_to_s16 = stream_sample_1ch_to_s16_c;