/*****************************************************************************
- * idctaltivec.c : Altivec IDCT module
+ * idctaltivec.c : AltiVec IDCT module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: idctaltivec.c,v 1.20 2001/12/06 13:46:23 massiot Exp $
+ * $Id: idctaltivec.c,v 1.27 2002/07/31 20:56:51 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#ifndef __BUILD_ALTIVEC_ASM__
-#define MODULE_NAME idctaltivec
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include "defs.h"
+#include <vlc/vlc.h>
-#include <stdlib.h>
+#include <stdlib.h> /* malloc(), free() */
#include <string.h>
-#include <inttypes.h>
-
-#include "config.h"
-#include "common.h"
-#include "intf_msg.h"
-#include "threads.h"
-#include "mtime.h"
-#include "tests.h" /* TestCPU() */
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h> /* int16_t .. */
+#endif
#include "idct.h"
-#include "modules.h"
-#include "modules_export.h"
-
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-ADD_WINDOW( "Configuration for Altivec IDCT module" )
- ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- p_module->i_capabilities = MODULE_CAPABILITY_NULL
- | MODULE_CAPABILITY_IDCT;
- p_module->psz_longname = "Altivec IDCT module";
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- idct_getfunctions( &p_module->p_functions->idct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
+static int Open( vlc_object_t *p_this );
/*****************************************************************************
- * idct_Probe: return a preference score
+ * Module descriptor
*****************************************************************************/
-static int idct_Probe( probedata_t *p_data )
-{
- if( !TestCPU( CPU_CAPABILITY_ALTIVEC ) )
- {
- return( 0 );
- }
-
- if( TestMethod( IDCT_METHOD_VAR, "idctaltivec" )
- || TestMethod( IDCT_METHOD_VAR, "altivec" ) )
- {
- return( 999 );
- }
-
- return( 200 );
-}
+vlc_module_begin();
+ set_description( _("AltiVec IDCT module") );
+ set_capability( "idct", 200 );
+ add_shortcut( "altivec" );
+ add_requirement( ALTIVEC );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* NormScan : This IDCT uses reordered coeffs, so we patch the scan table
}
/*****************************************************************************
- * IDCT in Altivec
+ * IDCT in AltiVec
*****************************************************************************/
#ifndef CAN_COMPILE_C_ALTIVEC
*****************************************************************************/
static void idct_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = idct_Probe;
#define F p_function_list->functions.idct
F.pf_idct_init = InitIDCT;
F.pf_norm_scan = NormScan;