]> git.sesse.net Git - vlc/blob - plugins/yuvmmx/yuvmmx.c
955ef4a91a2b6b77e9c844036f71afc0c9be4b85
[vlc] / plugins / yuvmmx / yuvmmx.c
1 /*****************************************************************************
2  * yuvmmx.c : Accelerated MMX YUV functions for vlc
3  *****************************************************************************
4  * Copyright (C) 2000 VideoLAN
5  *
6  * Authors:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 /*****************************************************************************
24  * Preamble
25  *****************************************************************************/
26 #include "defs.h"
27
28 #include <stdlib.h>                                      /* malloc(), free() */
29
30 #include "config.h"
31 #include "common.h"                                     /* boolean_t, byte_t */
32 #include "threads.h"
33 #include "mtime.h"
34 #include "tests.h"                                              /* TestMMX() */
35 #include "plugins.h"
36
37 #include "interface.h"
38 #include "audio_output.h"
39 #include "video.h"
40 #include "video_output.h"
41
42 /*****************************************************************************
43  * Exported prototypes
44  *****************************************************************************/
45 static void yuv_GetPlugin( p_vout_thread_t p_vout );
46
47 /* YUV transformations */
48 int     yuv_MMXInit          ( p_vout_thread_t p_vout );
49 int     yuv_MMXReset         ( p_vout_thread_t p_vout );
50 void    yuv_MMXEnd           ( p_vout_thread_t p_vout );
51
52 /*****************************************************************************
53  * GetConfig: get the plugin structure and configuration
54  *****************************************************************************/
55 plugin_info_t * GetConfig( void )
56 {
57     plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
58
59     p_info->psz_name    = "Accelerated MMX YUV to RGB transformations";
60     p_info->psz_version = VERSION;
61     p_info->psz_author  = "the VideoLAN team <vlc@videolan.org>";
62
63     p_info->aout_GetPlugin = NULL;
64     p_info->vout_GetPlugin = NULL;
65     p_info->intf_GetPlugin = NULL;
66     p_info->yuv_GetPlugin  = yuv_GetPlugin;
67
68     if( TestMMX() )
69     {
70         p_info->i_score = 0x200;
71     }
72     else
73     {
74         p_info->i_score = 0x0;
75     }
76
77     /* If this plugin was requested, score it higher */
78     if( TestMethod( YUV_METHOD_VAR, "mmx" ) )
79     {
80         p_info->i_score += 0x200;
81     }
82
83     return( p_info );
84 }
85
86 /*****************************************************************************
87  * Following functions are only called through the p_info structure
88  *****************************************************************************/
89
90 static void yuv_GetPlugin( p_vout_thread_t p_vout )
91 {
92     p_vout->p_yuv_init   = yuv_MMXInit;
93     p_vout->p_yuv_reset  = yuv_MMXReset;
94     p_vout->p_yuv_end    = yuv_MMXEnd;
95 }
96