int main(int argc, char **argv) { AVCodecContext *ctx; int c; DSPContext cctx, mmxctx; int flags[2] = { AV_CPU_FLAG_MMX, AV_CPU_FLAG_MMX2 }; int flags_size = HAVE_MMX2 ? 2 : 1; for(;;) { c = getopt(argc, argv, "h"); if (c == -1) break; switch(c) { case 'h': help(); break; } } printf("ffmpeg motion test\n"); ctx = avcodec_alloc_context(); ctx->dsp_mask = AV_CPU_FLAG_FORCE; dsputil_init(&cctx, ctx); for (c = 0; c < flags_size; c++) { int x; ctx->dsp_mask = AV_CPU_FLAG_FORCE | flags[c]; dsputil_init(&mmxctx, ctx); for (x = 0; x < 2; x++) { printf("%s for %dx%d pixels\n", c ? "mmx2" : "mmx", x ? 8 : 16, x ? 8 : 16); test_motion("mmx", mmxctx.pix_abs[x][0], cctx.pix_abs[x][0]); test_motion("mmx_x2", mmxctx.pix_abs[x][1], cctx.pix_abs[x][1]); test_motion("mmx_y2", mmxctx.pix_abs[x][2], cctx.pix_abs[x][2]); test_motion("mmx_xy2", mmxctx.pix_abs[x][3], cctx.pix_abs[x][3]); } } av_free(ctx); return 0; }
int main(int argc, char **argv) { AVCodecContext *ctx; int c; MECmpContext cctx, mmxctx; int flags[2] = { AV_CPU_FLAG_MMX, AV_CPU_FLAG_MMXEXT }; int flags_size = HAVE_MMXEXT ? 2 : 1; if (argc > 1) { help(); return 1; } printf("ffmpeg motion test\n"); ctx = avcodec_alloc_context3(NULL); ctx->flags |= CODEC_FLAG_BITEXACT; av_force_cpu_flags(0); memset(&cctx, 0, sizeof(cctx)); ff_me_cmp_init(&cctx, ctx); for (c = 0; c < flags_size; c++) { int x; av_force_cpu_flags(flags[c]); memset(&mmxctx, 0, sizeof(mmxctx)); ff_me_cmp_init(&mmxctx, ctx); for (x = 0; x < 2; x++) { printf("%s for %dx%d pixels\n", c ? "mmx2" : "mmx", x ? 8 : 16, x ? 8 : 16); test_motion("mmx", mmxctx.pix_abs[x][0], cctx.pix_abs[x][0]); test_motion("mmx_x2", mmxctx.pix_abs[x][1], cctx.pix_abs[x][1]); test_motion("mmx_y2", mmxctx.pix_abs[x][2], cctx.pix_abs[x][2]); test_motion("mmx_xy2", mmxctx.pix_abs[x][3], cctx.pix_abs[x][3]); } } av_free(ctx); return 0; }
int main(int argc, char **argv) { AVCodecContext *ctx; int c; DSPContext cctx, mmxctx; int flags[2] = { AV_CPU_FLAG_MMX, AV_CPU_FLAG_MMXEXT }; int flags_size = HAVE_MMXEXT ? 2 : 1; if (argc > 1) { help(); return 1; } printf("ffmpeg motion test\n"); ctx = avcodec_alloc_context3(NULL); ctx->dsp_mask = AV_CPU_FLAG_FORCE; memset(&cctx, 0, sizeof(cctx)); ff_dsputil_init(&cctx, ctx); for (c = 0; c < flags_size; c++) { int x; ctx->dsp_mask = AV_CPU_FLAG_FORCE | flags[c]; memset(&mmxctx, 0, sizeof(mmxctx)); ff_dsputil_init(&mmxctx, ctx); for (x = 0; x < 2; x++) { printf("%s for %dx%d pixels\n", c ? "mmx2" : "mmx", x ? 8 : 16, x ? 8 : 16); test_motion("mmx", mmxctx.pix_abs[x][0], cctx.pix_abs[x][0]); test_motion("mmx_x2", mmxctx.pix_abs[x][1], cctx.pix_abs[x][1]); test_motion("mmx_y2", mmxctx.pix_abs[x][2], cctx.pix_abs[x][2]); test_motion("mmx_xy2", mmxctx.pix_abs[x][3], cctx.pix_abs[x][3]); } } av_free(ctx); return 0; }
int main(int argc, char **argv) { int c; for(;;) { c = getopt(argc, argv, "h"); if (c == -1) break; switch(c) { case 'h': help(); break; } } printf("ffmpeg motion test\n"); test_motion("mmx", pix_abs16x16_mmx, pix_abs16x16_c); test_motion("mmx_x2", pix_abs16x16_x2_mmx, pix_abs16x16_x2_c); test_motion("mmx_y2", pix_abs16x16_y2_mmx, pix_abs16x16_y2_c); test_motion("mmx_xy2", pix_abs16x16_xy2_mmx, pix_abs16x16_xy2_c); return 0; }