Parent Directory | Revision Log
Revision 1.3 - (view) (download)
1 : | syskin | 1.1 | /***************************************************************************** |
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 | 1.3 | * $Id: motion_smp.h,v 1.2 2006/02/24 23:35:04 suxen_drol Exp $ |
26 : | syskin | 1.1 | * |
27 : | ****************************************************************************/ | ||
28 : | |||
29 : | #ifndef SMP_MOTION_H | ||
30 : | #define SMP_MOTION_H | ||
31 : | |||
32 : | #ifdef WIN32 | ||
33 : | syskin | 1.3 | |
34 : | # 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 : | syskin | 1.1 | |
49 : | #elif defined(SYS_BEOS) | ||
50 : | |||
51 : | syskin | 1.3 | # 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 : | |||
58 : | #else | ||
59 : | # include <pthread.h> | ||
60 : | #endif | ||
61 : | syskin | 1.1 | |
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 | 1.2 | |
89 : | syskin | 1.3 | int minfcode, minbcode; |
90 : | syskin | 1.1 | } SMPmotionData; |
91 : | |||
92 : | |||
93 : | void MotionEstimateSMP(SMPmotionData * h); | ||
94 : | void SMPMotionEstimationBVOP(SMPmotionData * h); | ||
95 : | |||
96 : | syskin | 1.3 | #endif /* SMP_MOTION_H */ |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |