* idct.c : IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idct.c,v 1.2 2001/01/15 06:18:23 sam Exp $
+ * $Id: idct.c,v 1.7 2001/02/20 07:49:13 sam Exp $
*
* Authors: Gaƫl Hendryckx <jimmy@via.ecp.fr>
*
*****************************************************************************/
#define MODULE_NAME idct
+#include "modules_inner.h"
/*****************************************************************************
* Preamble
#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 "idct.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_InitIDCT ( vdec_thread_t * p_vdec);
- void vdec_SparseIDCT ( vdec_thread_t * p_vdec, dctelem_t * p_block,
- int i_sparse_pos);
-static void vdec_IDCT ( vdec_thread_t * p_vdec, dctelem_t * p_block,
- int i_idontcare );
+static void vdec_NormScan ( u8 ppi_scan[2][64] );
/*****************************************************************************
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
-int InitModule( module_t * p_module )
+MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
- p_module->psz_longname = "C IDCT module";
+ p_module->psz_longname = "IDCT module";
p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
* 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().
*****************************************************************************/
-int ActivateModule( module_t * p_module )
+MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
-int DeactivateModule( module_t * p_module )
+MODULE_DEACTIVATE
{
free( p_module->p_functions );
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;
}
/*****************************************************************************
*****************************************************************************/
static int idct_Probe( probedata_t *p_data )
{
+ if( TestMethod( IDCT_METHOD_VAR, "idct" ) )
+ {
+ return( 999 );
+ }
+
/* This plugin always works */
- return( 100 );
+ return( 50 );
}
/*****************************************************************************
- * vdec_InitIDCT : initialize datas for vdec_SparseIDCT
+ * vdec_NormScan : Unused in this IDCT
*****************************************************************************/
-static void vdec_InitIDCT (vdec_thread_t * p_vdec)
+static void vdec_NormScan( u8 ppi_scan[2][64] )
{
- int i;
-
- dctelem_t * p_pre = p_vdec->p_pre_idct;
- memset( p_pre, 0, 64*64*sizeof(dctelem_t) );
-
- for( i=0 ; i < 64 ; i++ )
- {
- p_pre[i*64+i] = 1 << SPARSE_SCALE_FACTOR;
- vdec_IDCT( p_vdec, &p_pre[i*64], 0) ;
- }
- return;
}
/*****************************************************************************
* vdec_IDCT : IDCT function for normal matrices
*****************************************************************************/
-static void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block,
- int i_idontcare )
+void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block,
+ int i_idontcare )
{
s32 tmp0, tmp1, tmp2, tmp3;
s32 tmp10, tmp11, tmp12, tmp13;