| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 void CpuInfo::MaskCpuFlagsForTest(int enable_flags) { | 38 void CpuInfo::MaskCpuFlagsForTest(int enable_flags) { |
| 39 libyuv::MaskCpuFlags(enable_flags); | 39 libyuv::MaskCpuFlags(enable_flags); |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Detect an Intel Core I5 or better such as 4th generation Macbook Air. | 42 // Detect an Intel Core I5 or better such as 4th generation Macbook Air. |
| 43 bool IsCoreIOrBetter() { | 43 bool IsCoreIOrBetter() { |
| 44 #if defined(__i386__) || defined(__x86_64__) || \ | 44 #if defined(__i386__) || defined(__x86_64__) || \ |
| 45 defined(_M_IX86) || defined(_M_X64) | 45 defined(_M_IX86) || defined(_M_X64) |
| 46 uint32 cpu_info[4]; | 46 uint32_t cpu_info[4]; |
| 47 libyuv::CpuId(0, 0, &cpu_info[0]); // Function 0: Vendor ID | 47 libyuv::CpuId(0, 0, &cpu_info[0]); // Function 0: Vendor ID |
| 48 if (cpu_info[1] == 0x756e6547 && cpu_info[3] == 0x49656e69 && | 48 if (cpu_info[1] == 0x756e6547 && cpu_info[3] == 0x49656e69 && |
| 49 cpu_info[2] == 0x6c65746e) { // GenuineIntel | 49 cpu_info[2] == 0x6c65746e) { // GenuineIntel |
| 50 // Detect CPU Family and Model | 50 // Detect CPU Family and Model |
| 51 // 3:0 - Stepping | 51 // 3:0 - Stepping |
| 52 // 7:4 - Model | 52 // 7:4 - Model |
| 53 // 11:8 - Family | 53 // 11:8 - Family |
| 54 // 13:12 - Processor Type | 54 // 13:12 - Processor Type |
| 55 // 19:16 - Extended Model | 55 // 19:16 - Extended Model |
| 56 // 27:20 - Extended Family | 56 // 27:20 - Extended Family |
| (...skipping 14 matching lines...) Expand all Loading... |
| 71 (family == 6 && (model == kAtom || model <= kCore2))) { | 71 (family == 6 && (model == kAtom || model <= kCore2))) { |
| 72 return false; | 72 return false; |
| 73 } | 73 } |
| 74 return true; | 74 return true; |
| 75 } | 75 } |
| 76 #endif | 76 #endif |
| 77 return false; | 77 return false; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace cricket | 80 } // namespace cricket |
| OLD | NEW |