19 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: xvid_bench.c,v 1.38 2008-11-26 23:37:28 Isibaar Exp $ |
* $Id: xvid_bench.c,v 1.38.2.1 2008-12-02 14:00:09 Isibaar Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
47 |
#include "xvid.h" |
#include "xvid.h" |
48 |
|
|
49 |
// inner guts |
// inner guts |
50 |
|
#include "portab.h" |
51 |
#include "dct/idct.h" |
#include "dct/idct.h" |
52 |
#include "dct/fdct.h" |
#include "dct/fdct.h" |
53 |
#include "image/colorspace.h" |
#include "image/colorspace.h" |
2206 |
int width, height; |
int width, height; |
2207 |
uint32_t chksum = 0; |
uint32_t chksum = 0; |
2208 |
const char * test_bitstream = 0; |
const char * test_bitstream = 0; |
2209 |
|
#if defined(WIN32) && defined(ARCH_IS_X86_64) |
2210 |
|
DECLARE_ALIGNED_MATRIX(xmm_save, 2, 4, uint64_t, 16); |
2211 |
|
// assumes xmm6 and xmm7 won't be falsely preserved by C code |
2212 |
|
for(c=0;c<4;c++) |
2213 |
|
xmm_save[c] = read_counter(); |
2214 |
|
prime_xmm(xmm_save); |
2215 |
|
#endif |
2216 |
|
|
2217 |
cpu_mask = 0; // default => will use autodectect |
cpu_mask = 0; // default => will use autodectect |
2218 |
for(c=1; c<argc; ++c) |
for(c=1; c<argc; ++c) |
2292 |
if (what==-2) |
if (what==-2) |
2293 |
test_quant_bug(); |
test_quant_bug(); |
2294 |
|
|
2295 |
|
#if defined(WIN32) && defined(ARCH_IS_X86_64) |
2296 |
|
get_xmm(xmm_save+4); |
2297 |
|
if (memcmp(xmm_save, xmm_save+4, 4*sizeof(int64_t))) { |
2298 |
|
printf("\nWIN64 ERROR: XMM6 and XMM7 contents not preserved!\n" |
2299 |
|
" XMM6 XMM7\n" |
2300 |
|
"Before: %.16I64X%.16I64X %.16I64X%.16I64X\n" |
2301 |
|
"After: %.16I64X%.16I64X %.16I64X%.16I64X", |
2302 |
|
xmm_save[0],xmm_save[1],xmm_save[2],xmm_save[3], |
2303 |
|
xmm_save[4],xmm_save[5],xmm_save[6],xmm_save[7]); |
2304 |
|
} else { |
2305 |
|
printf("\nWIN64: XMM6 and XMM7 contents preserved correctly.\n"); |
2306 |
|
} |
2307 |
|
#endif |
2308 |
|
|
2309 |
if ((what >= 0 && what <= 6) || what == 10) { |
if ((what >= 0 && what <= 6) || what == 10) { |
2310 |
printf("\n\n" |
printf("\n\n" |
2311 |
"NB: If a function isn't optimised for a specific set of intructions,\n" |
"NB: If a function isn't optimised for a specific set of intructions,\n" |