]> git.sesse.net Git - vlc/blob - src/ac3_decoder/ac3_downmix.c
*Bugfixes, cleanings in gtk.
[vlc] / src / ac3_decoder / ac3_downmix.c
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 $
6  *
7  * Authors: Michel Kaempf <maxx@via.ecp.fr>
8  *          Aaron Holtzman <aholtzma@engr.uvic.ca>
9  *          Renaud Dartus <reno@videolan.org>
10  *
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.
15  * 
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.
20  *
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  *****************************************************************************/
25 #include "defs.h"
26
27 #include <string.h>                                              /* memcpy() */
28
29 #include "config.h"
30 #include "common.h"
31 #include "threads.h"
32 #include "mtime.h"
33
34 #include "intf_msg.h"                        /* intf_DbgMsg(), intf_ErrMsg() */
35 #include "tests.h"
36
37 #include "stream_control.h"
38 #include "input_ext-dec.h"
39
40 #include "ac3_decoder.h"
41 #include "ac3_downmix.h"
42
43 void downmix_init (downmix_t * p_downmix)
44 {
45 #if 0
46     if ( TestCPU (CPU_CAPABILITY_SSE) )
47     {
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;
56     } 
57     else if ( TestCPU (CPU_CAPABILITY_3DNOW) )
58     {
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;
67     } 
68     else
69 #endif
70     {
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;
78     }
79 }