1 /*****************************************************************************
2 * idctaltivec.c : Altivec IDCT module
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: idctaltivec.c,v 1.8 2001/06/03 12:47:21 sam Exp $
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 #define MODULE_NAME idctaltivec
26 /*****************************************************************************
28 *****************************************************************************/
37 #include "tests.h" /* TestCPU() */
40 #include "video_output.h"
42 #include "video_decoder.h"
45 #include "modules_inner.h"
47 #include "vdec_block.h"
48 #include "vdec_idct.h"
50 #include "idctaltivec.h"
52 #include "modules_export.h"
54 /*****************************************************************************
56 *****************************************************************************/
57 static void idct_getfunctions( function_list_t * p_function_list );
58 static int idct_Probe ( probedata_t *p_data );
59 static void vdec_NormScan ( u8 ppi_scan[2][64] );
61 /*****************************************************************************
62 * Build configuration tree.
63 *****************************************************************************/
65 ADD_WINDOW( "Configuration for Altivec IDCT module" )
66 ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
70 p_module->i_capabilities = MODULE_CAPABILITY_NULL
71 | MODULE_CAPABILITY_IDCT;
72 p_module->psz_longname = "Altivec IDCT module";
76 idct_getfunctions( &p_module->p_functions->idct );
79 MODULE_DEACTIVATE_START
80 MODULE_DEACTIVATE_STOP
82 /* Following functions are local */
84 /*****************************************************************************
85 * Functions exported as capabilities.
86 *****************************************************************************/
87 static void idct_getfunctions( function_list_t * p_function_list )
89 p_function_list->pf_probe = idct_Probe;
90 #define F p_function_list->functions.idct
91 F.pf_idct_init = _M( vdec_InitIDCT );
92 F.pf_sparse_idct = _M( vdec_SparseIDCT );
93 F.pf_idct = _M( vdec_IDCT );
94 F.pf_norm_scan = vdec_NormScan;
95 F.pf_decode_init = _M( vdec_InitDecode );
96 F.pf_decode_mb_c = _M( vdec_DecodeMacroblockC );
97 F.pf_decode_mb_bw = _M( vdec_DecodeMacroblockBW );
101 /*****************************************************************************
102 * idct_Probe: return a preference score
103 *****************************************************************************/
104 static int idct_Probe( probedata_t *p_data )
106 if( !TestCPU( CPU_CAPABILITY_ALTIVEC ) )
111 if( TestMethod( IDCT_METHOD_VAR, "idctaltivec" ) )
116 /* The Altivec iDCT is deactivated until it really works */
117 return( 0 /* 200 */ );
120 /*****************************************************************************
121 * vdec_NormScan : Soon, transpose
122 *****************************************************************************/
123 static void vdec_NormScan( u8 ppi_scan[2][64] )
127 /*****************************************************************************
129 *****************************************************************************/
130 void _M( vdec_IDCT )( vdec_thread_t * p_vdec, dctelem_t * p_block,
133 IDCT( p_block, p_block );