#define RTCD_C
#include "vpx_rtcd.h"
-#if CONFIG_MULTITHREAD && HAVE_PTHREAD_H
-#include <pthread.h>
-static void once(void (*func)(void))
-{
- static pthread_once_t lock = PTHREAD_ONCE_INIT;
- pthread_once(&lock, func);
-}
-
-
-#elif CONFIG_MULTITHREAD && defined(_WIN32)
-#include <windows.h>
-static void once(void (*func)(void))
-{
- /* Using a static initializer here rather than InitializeCriticalSection()
- * since there's no race-free context in which to execute it. Protecting
- * it with an atomic op like InterlockedCompareExchangePointer introduces
- * an x86 dependency, and InitOnceExecuteOnce requires Vista.
- */
- static CRITICAL_SECTION lock = {(void *)-1, -1, 0, 0, 0, 0};
- static int done;
-
- EnterCriticalSection(&lock);
-
- if (!done)
- {
- func();
- done = 1;
- }
-
- LeaveCriticalSection(&lock);
-}
-
-
-#else
/* No-op version that performs no synchronization. vpx_rtcd() is idempotent,
* so as long as your platform provides atomic loads/stores of pointers
* no synchronization is strictly necessary.
*/
-static void once(void (*func)(void))
-{
- static int done;
+static void once(void (*func)(void)) {
+ static int done;
- if(!done)
- {
- func();
- done = 1;
- }
+ if(!done) {
+ func();
+ done = 1;
+ }
}
-#endif
-
-void vpx_rtcd()
-{
- once(setup_rtcd_internal);
+void vpx_rtcd() {
+ once(setup_rtcd_internal);
}
#include "vpx_ports/vpx_timer.h"
#include "vp8/common/pred_common.h"
-// #define DBG_PRNT_SEGMAP 1
+#define DBG_PRNT_SEGMAP 0
#if CONFIG_RUNTIME_CPU_DETECT
#define RTCD(x) &cpi->common.rtcd.x
sum_intra_stats(cpi, x);
vp8_tokenize_mb(cpi, &x->e_mbd, t, 0);
}
-#if CONFIG_NEWBESTREFMVvp8_tokenize_mb
+#if CONFIG_NEWBESTREFMV
else
vp8_tokenize_mb(cpi, &x->e_mbd, t, 1);
#endif