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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1690 - (view) (download)

1 : syskin 1682 /*****************************************************************************
2 :     *
3 :     * XVID MPEG-4 VIDEO CODEC
4 :     * - multithreaded Motion Estimation header -
5 :     *
6 :     * Copyright(C) 2005 Radoslaw Czyz <xvid@syskin.cjb.net>
7 :     *
8 :     * significant portions derived from x264 project,
9 :     * original authors: Trax, Gianluigi Tiesi, Eric Petit
10 :     *
11 :     * This program is free software ; you can redistribute it and/or modify
12 :     * it under the terms of the GNU General Public License as published by
13 :     * the Free Software Foundation ; either version 2 of the License, or
14 :     * (at your option) any later version.
15 :     *
16 :     * This program is distributed in the hope that it will be useful,
17 :     * but WITHOUT ANY WARRANTY ; without even the implied warranty of
18 :     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 :     * GNU General Public License for more details.
20 :     *
21 :     * You should have received a copy of the GNU General Public License
22 :     * along with this program ; if not, write to the Free Software
23 :     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 :     *
25 : syskin 1690 * $Id: motion_smp.h,v 1.3 2006-02-27 00:22:31 syskin Exp $
26 : syskin 1682 *
27 :     ****************************************************************************/
28 :    
29 :     #ifndef SMP_MOTION_H
30 :     #define SMP_MOTION_H
31 :    
32 :     #ifdef WIN32
33 :    
34 : syskin 1690 # include <winbase.h>
35 :     # include <windows.h>
36 :     # define pthread_t HANDLE
37 :     # define pthread_create(t,u,f,d) *(t)=CreateThread(NULL,0,f,d,0,NULL)
38 :     # define pthread_join(t,s) { WaitForSingleObject(t,INFINITE); \
39 :     CloseHandle(t); }
40 :     # define sched_yield() Sleep(0);
41 :     static int pthread_num_processors_np()
42 :     {
43 :     unsigned int p_aff, s_aff, r = 0;
44 :     GetProcessAffinityMask(GetCurrentProcess(), &p_aff, &s_aff);
45 :     for(; p_aff != 0; p_aff>>=1) r += p_aff&1;
46 :     return r;
47 :     }
48 :    
49 : syskin 1682 #elif defined(SYS_BEOS)
50 :    
51 : syskin 1690 # include <kernel/OS.h>
52 :     # define pthread_t thread_id
53 :     # define pthread_create(t,u,f,d) { *(t)=spawn_thread(f,"",10,d); \
54 :     resume_thread(*(t)); }
55 :     # define pthread_join(t,s) wait_for_thread(t,(long*)s)
56 :     # define sched_yield() snooze(0) /* is this correct? */
57 : syskin 1682
58 : syskin 1690 #else
59 :     # include <pthread.h>
60 :     #endif
61 : syskin 1682
62 :     typedef struct
63 :     {
64 :     pthread_t handle; /* thread's handle */
65 :     const MBParam * pParam;
66 :     const FRAMEINFO * current;
67 :     const FRAMEINFO * reference;
68 :     const IMAGE * pRefH;
69 :     const IMAGE * pRefV;
70 :     const IMAGE * pRefHV;
71 :     const IMAGE * pGMC;
72 :     uint8_t * RefQ;
73 :     int y_step;
74 :     int start_y;
75 :     int * complete_count_self;
76 :     int * complete_count_above;
77 :    
78 :     /* bvop stuff */
79 :     int time_bp, time_pp;
80 :     const MACROBLOCK * f_mbs;
81 :     const IMAGE * pRef;
82 :     const IMAGE * fRef;
83 :     const IMAGE * fRefH;
84 :     const IMAGE * fRefV;
85 :     const IMAGE * fRefHV;
86 :    
87 :     int MVmax, mvSum, mvCount; /* out */
88 : suxen_drol 1686
89 : syskin 1690 int minfcode, minbcode;
90 : syskin 1682 } SMPmotionData;
91 :    
92 :    
93 :     void MotionEstimateSMP(SMPmotionData * h);
94 :     void SMPMotionEstimationBVOP(SMPmotionData * h);
95 :    
96 : syskin 1690 #endif /* SMP_MOTION_H */

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