[svn] / trunk / xvidcore / src / motion / motion_smp.h Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/motion/motion_smp.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1682, Fri Feb 24 08:46:22 2006 UTC revision 1874, Fri Jun 5 07:58:41 2009 UTC
# Line 22  Line 22 
22   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
23   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
24   *   *
25   * $Id: motion_smp.h,v 1.1 2006-02-24 08:46:22 syskin Exp $   * $Id: motion_smp.h,v 1.6 2009-06-05 07:58:41 Isibaar Exp $
26   *   *
27   ****************************************************************************/   ****************************************************************************/
28    
# Line 30  Line 30 
30  #define SMP_MOTION_H  #define SMP_MOTION_H
31    
32  #ifdef WIN32  #ifdef WIN32
33    
34  #include <windows.h>  #include <windows.h>
35  #define pthread_t               HANDLE  #define pthread_t               HANDLE
36  #define pthread_create(t,u,f,d) *(t)=CreateThread(NULL,0,f,d,0,NULL)  #define pthread_create(t,u,f,d) *(t)=CreateThread(NULL,0,f,d,0,NULL)
37  #define pthread_join(t,s)       { WaitForSingleObject(t,INFINITE); \  #define pthread_join(t,s)       { WaitForSingleObject(t,INFINITE); \
38                                    CloseHandle(t); }                                    CloseHandle(t); }
39  #define sched_yield()                   Sleep(0)  # define sched_yield()                  Sleep(0);
40  #define HAVE_PTHREAD 1  static __inline int pthread_num_processors_np()
41    {
42            DWORD p_aff, s_aff, r = 0;
43            GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR) &p_aff, (PDWORD_PTR) &s_aff);
44            for(; p_aff != 0; p_aff>>=1) r += p_aff&1;
45            return r;
46    }
47    
48    #elif defined(__amigaos4__)
49    
50    # include <pthread.h>
51    # include <proto/dos.h>
52    # define sched_yield() IDOS->Delay(1)
53    
54  #elif defined(SYS_BEOS)  #elif defined(SYS_BEOS)
55    
56  #include <kernel/OS.h>  #include <kernel/OS.h>
57  #define pthread_t               thread_id  #define pthread_t               thread_id
58  #define pthread_create(t,u,f,d) { *(t)=spawn_thread(f,"",10,d); \  #define pthread_create(t,u,f,d) { *(t)=spawn_thread(f,"",10,d); \
59                                    resume_thread(*(t)); }                                    resume_thread(*(t)); }
60  #define pthread_join(t,s)       wait_for_thread(t,(long*)s)  #define pthread_join(t,s)       wait_for_thread(t,(long*)s)
61  #define sched_yield()                   snooze(0) /* is this correct? */  #define sched_yield()                   snooze(0) /* is this correct? */
 #define HAVE_PTHREAD 1  
62    
63  #elif HAVE_PTHREAD  #else
64  #include <pthread.h>  #include <pthread.h>
65  #endif  #endif
66    
   
 #define THREADS         3  
   
67  typedef struct  typedef struct
68  {  {
69          pthread_t handle;               /* thread's handle */          pthread_t handle;               /* thread's handle */
# Line 80  Line 90 
90          const IMAGE * fRefHV;          const IMAGE * fRefHV;
91    
92          int MVmax, mvSum, mvCount;              /* out */          int MVmax, mvSum, mvCount;              /* out */
93    
94            int minfcode, minbcode;
95  } SMPmotionData;  } SMPmotionData;
96    
97    

Legend:
Removed from v.1682  
changed lines
  Added in v.1874

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4