/*****************************************************************************
* idctclassic.c : Classic IDCT module
*****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: idctclassic.c,v 1.7 2001/02/20 07:49:13 sam Exp $
+ * Copyright (C) 1999-2001 VideoLAN
+ * $Id: idctclassic.c,v 1.24 2002/05/18 17:47:46 sam Exp $
*
* Authors: Gaƫl Hendryckx <jimmy@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME idctclassic
-
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include "defs.h"
-
#include <stdlib.h>
+#include <string.h>
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
-#include "tests.h"
-
-#include "video.h"
-#include "video_output.h"
-
-#include "video_decoder.h"
-
-#include "modules.h"
-#include "modules_inner.h"
+#include <videolan/vlc.h>
#include "idct.h"
+#include "block_c.h"
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
static void idct_getfunctions( function_list_t * p_function_list );
-static int idct_Probe ( probedata_t *p_data );
-static void vdec_NormScan ( u8 ppi_scan[2][64] );
-
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
-ADD_WINDOW( "Configuration for classic IDCT module" )
- ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
-MODULE_CONFIG_END
+MODULE_CONFIG_STOP
-/*****************************************************************************
- * InitModule: get the module structure and configuration.
- *****************************************************************************
- * We have to fill psz_name, psz_longname and psz_version. These variables
- * will be strdup()ed later by the main application because the module can
- * be unloaded later to save memory, and we want to be able to access this
- * data even after the module has been unloaded.
- *****************************************************************************/
-MODULE_INIT
-{
- p_module->psz_name = MODULE_STRING;
- p_module->psz_longname = "classic IDCT module";
- p_module->psz_version = VERSION;
-
- p_module->i_capabilities = MODULE_CAPABILITY_NULL
- | MODULE_CAPABILITY_IDCT;
-
- return( 0 );
-}
-
-/*****************************************************************************
- * ActivateModule: set the module to an usable state.
- *****************************************************************************
- * This function fills the capability functions and the configuration
- * structure. Once ActivateModule() has been called, the i_usage can
- * be set to 0 and calls to NeedModule() be made to increment it. To unload
- * the module, one has to wait until i_usage == 0 and call DeactivateModule().
- *****************************************************************************/
-MODULE_ACTIVATE
-{
- p_module->p_functions = malloc( sizeof( module_functions_t ) );
- if( p_module->p_functions == NULL )
- {
- return( -1 );
- }
+MODULE_INIT_START
+ SET_DESCRIPTION( _("classic IDCT module") )
+ ADD_CAPABILITY( IDCT, 100 )
+ ADD_SHORTCUT( "classic" )
+ ADD_SHORTCUT( "idctclassic" )
+MODULE_INIT_STOP
+MODULE_ACTIVATE_START
idct_getfunctions( &p_module->p_functions->idct );
+MODULE_ACTIVATE_STOP
- p_module->p_config = p_config;
-
- return( 0 );
-}
-
-/*****************************************************************************
- * DeactivateModule: make sure the module can be unloaded.
- *****************************************************************************
- * This function must only be called when i_usage == 0. If it successfully
- * returns, i_usage can be set to -1 and the module unloaded. Be careful to
- * lock usage_lock during the whole process.
- *****************************************************************************/
-MODULE_DEACTIVATE
-{
- free( p_module->p_functions );
-
- return( 0 );
-}
+MODULE_DEACTIVATE_START
+MODULE_DEACTIVATE_STOP
/* Following functions are local */
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * NormScan : Unused in this IDCT
*****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list )
+static void NormScan( u8 ppi_scan[2][64] )
{
- p_function_list->pf_probe = idct_Probe;
- p_function_list->functions.idct.pf_init = vdec_InitIDCT;
- p_function_list->functions.idct.pf_sparse_idct = vdec_SparseIDCT;
- p_function_list->functions.idct.pf_idct = vdec_IDCT;
- p_function_list->functions.idct.pf_norm_scan = vdec_NormScan;
}
/*****************************************************************************
- * idct_Probe: returns a preference score
+ * IDCT : IDCT function for normal matrices
*****************************************************************************/
-static int idct_Probe( probedata_t *p_data )
+static inline void IDCT( dctelem_t * p_block )
{
- if( TestMethod( IDCT_METHOD_VAR, "idctclassic" ) )
- {
- return( 999 );
- }
-
- /* This plugin always works */
- return( 100 );
-}
-
-/*****************************************************************************
- * vdec_NormScan : Unused in this IDCT
- *****************************************************************************/
-static void vdec_NormScan( u8 ppi_scan[2][64] )
-{
-}
-
-/*****************************************************************************
- * vdec_IDCT : IDCT function for normal matrices
- *****************************************************************************/
-void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block,
- int i_idontcare )
-{
- /* dct classique: pour tester la meilleure entre la classique et la */
- /* no classique */
s32 tmp0, tmp1, tmp2, tmp3;
s32 tmp10, tmp11, tmp12, tmp13;
s32 z1, z2, z3, z4, z5;
* may be commented out.
*/
-#ifndef NO_ZERO_COLUMN_TEST /*ajoute un test mais evite des calculs */
+#ifndef NO_ZERO_COLUMN_TEST /* Adds a test but avoids calculus */
if ((dataptr[DCTSIZE*1] | dataptr[DCTSIZE*2] | dataptr[DCTSIZE*3] |
dataptr[DCTSIZE*4] | dataptr[DCTSIZE*5] | dataptr[DCTSIZE*6] |
dataptr[DCTSIZE*7]) == 0)
}
}
+static inline void RestoreCPUState( )
+{
+ ;
+}
+
+#include "idct_sparse.h"
+#include "idct_decl.h"
+