void vp8_arch_x86_decode_init(VP8D_COMP *pbi) { int flags = x86_simd_caps(); /* Note: * * This platform can be built without runtime CPU detection as well. If * you modify any of the function mappings present in this file, be sure * to also update them in static mapings (<arch>/filename_<arch>.h) */ #if CONFIG_RUNTIME_CPU_DETECT /* Override default functions with fastest ones for this CPU. */ #if HAVE_MMX if (flags & HAS_MMX) { pbi->dequant.block = vp8_dequantize_b_mmx; pbi->dequant.idct_add = vp8_dequant_idct_add_mmx; pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_mmx; pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_mmx; pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_mmx; pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_mmx; } #endif #if HAVE_SSE2 if (flags & HAS_SSE2) { pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_sse2; pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_sse2; pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_sse2; } #endif #endif }
void vp8_machine_specific_config(VP8_COMMON *ctx) { #if CONFIG_MULTITHREAD ctx->processor_core_count = get_cpu_count(); #endif /* CONFIG_MULTITHREAD */ #if ARCH_ARM ctx->cpu_caps = arm_cpu_caps(); #elif ARCH_X86 || ARCH_X86_64 ctx->cpu_caps = x86_simd_caps(); #endif }
void vp8_arch_x86_encoder_init(VP8_COMP *cpi) { #if CONFIG_RUNTIME_CPU_DETECT int flags = x86_simd_caps(); /* Note: * * This platform can be built without runtime CPU detection as well. If * you modify any of the function mappings present in this file, be sure * to also update them in static mapings (<arch>/filename_<arch>.h) */ /* Override default functions with fastest ones for this CPU. */ #if HAVE_MMX if (flags & HAS_MMX) { cpi->rtcd.variance.sad16x16 = vp8_sad16x16_mmx; cpi->rtcd.variance.sad16x8 = vp8_sad16x8_mmx; cpi->rtcd.variance.sad8x16 = vp8_sad8x16_mmx; cpi->rtcd.variance.sad8x8 = vp8_sad8x8_mmx; cpi->rtcd.variance.sad4x4 = vp8_sad4x4_mmx; cpi->rtcd.variance.var4x4 = vp8_variance4x4_mmx; cpi->rtcd.variance.var8x8 = vp8_variance8x8_mmx; cpi->rtcd.variance.var8x16 = vp8_variance8x16_mmx; cpi->rtcd.variance.var16x8 = vp8_variance16x8_mmx; cpi->rtcd.variance.var16x16 = vp8_variance16x16_mmx; cpi->rtcd.variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_mmx; cpi->rtcd.variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_mmx; cpi->rtcd.variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_mmx; cpi->rtcd.variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_mmx; cpi->rtcd.variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_mmx; cpi->rtcd.variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_mmx; cpi->rtcd.variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_mmx; cpi->rtcd.variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_mmx; cpi->rtcd.variance.subpixmse16x16 = vp8_sub_pixel_mse16x16_mmx; cpi->rtcd.variance.mse16x16 = vp8_mse16x16_mmx; cpi->rtcd.variance.getmbss = vp8_get_mb_ss_mmx; cpi->rtcd.variance.get4x4sse_cs = vp8_get4x4sse_cs_mmx; cpi->rtcd.fdct.short4x4 = vp8_short_fdct4x4_mmx; cpi->rtcd.fdct.short8x4 = vp8_short_fdct8x4_mmx; cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_mmx; cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_mmx; cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_c; cpi->rtcd.encodemb.berr = vp8_block_error_mmx; cpi->rtcd.encodemb.mberr = vp8_mbblock_error_mmx; cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_mmx; cpi->rtcd.encodemb.subb = vp8_subtract_b_mmx; cpi->rtcd.encodemb.submby = vp8_subtract_mby_mmx; cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_mmx; /*cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_mmx;*/ } #endif #if HAVE_SSE2 if (flags & HAS_SSE2) { cpi->rtcd.variance.sad16x16 = vp8_sad16x16_wmt; cpi->rtcd.variance.sad16x8 = vp8_sad16x8_wmt; cpi->rtcd.variance.sad8x16 = vp8_sad8x16_wmt; cpi->rtcd.variance.sad8x8 = vp8_sad8x8_wmt; cpi->rtcd.variance.sad4x4 = vp8_sad4x4_wmt; cpi->rtcd.variance.copy32xn = vp8_copy32xn_sse2; cpi->rtcd.variance.var4x4 = vp8_variance4x4_wmt; cpi->rtcd.variance.var8x8 = vp8_variance8x8_wmt; cpi->rtcd.variance.var8x16 = vp8_variance8x16_wmt; cpi->rtcd.variance.var16x8 = vp8_variance16x8_wmt; cpi->rtcd.variance.var16x16 = vp8_variance16x16_wmt; cpi->rtcd.variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_wmt; cpi->rtcd.variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_wmt; cpi->rtcd.variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_wmt; cpi->rtcd.variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_wmt; cpi->rtcd.variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_wmt; cpi->rtcd.variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_wmt; cpi->rtcd.variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_wmt; cpi->rtcd.variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_wmt; cpi->rtcd.variance.subpixmse16x16 = vp8_sub_pixel_mse16x16_wmt; cpi->rtcd.variance.mse16x16 = vp8_mse16x16_wmt; cpi->rtcd.variance.getmbss = vp8_get_mb_ss_sse2; /* cpi->rtcd.variance.get4x4sse_cs not implemented for wmt */; cpi->rtcd.fdct.short4x4 = vp8_short_fdct4x4_sse2; cpi->rtcd.fdct.short8x4 = vp8_short_fdct8x4_sse2; cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_sse2; cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_sse2; cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_sse2 ; cpi->rtcd.encodemb.berr = vp8_block_error_xmm; cpi->rtcd.encodemb.mberr = vp8_mbblock_error_xmm; cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_xmm; cpi->rtcd.encodemb.subb = vp8_subtract_b_sse2; cpi->rtcd.encodemb.submby = vp8_subtract_mby_sse2; cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_sse2; cpi->rtcd.quantize.quantb = vp8_regular_quantize_b_sse2; cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_sse2; #if !(CONFIG_REALTIME_ONLY) cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_sse2; #endif } #endif #if HAVE_SSE3 if (flags & HAS_SSE3) { cpi->rtcd.variance.sad16x16 = vp8_sad16x16_sse3; cpi->rtcd.variance.sad16x16x3 = vp8_sad16x16x3_sse3; cpi->rtcd.variance.sad16x8x3 = vp8_sad16x8x3_sse3; cpi->rtcd.variance.sad8x16x3 = vp8_sad8x16x3_sse3; cpi->rtcd.variance.sad8x8x3 = vp8_sad8x8x3_sse3; cpi->rtcd.variance.sad4x4x3 = vp8_sad4x4x3_sse3; cpi->rtcd.search.full_search = vp8_full_search_sadx3; cpi->rtcd.variance.sad16x16x4d = vp8_sad16x16x4d_sse3; cpi->rtcd.variance.sad16x8x4d = vp8_sad16x8x4d_sse3; cpi->rtcd.variance.sad8x16x4d = vp8_sad8x16x4d_sse3; cpi->rtcd.variance.sad8x8x4d = vp8_sad8x8x4d_sse3; cpi->rtcd.variance.sad4x4x4d = vp8_sad4x4x4d_sse3; cpi->rtcd.variance.copy32xn = vp8_copy32xn_sse3; cpi->rtcd.search.diamond_search = vp8_diamond_search_sadx4; cpi->rtcd.search.refining_search = vp8_refining_search_sadx4; } #endif #if HAVE_SSSE3 if (flags & HAS_SSSE3) { cpi->rtcd.variance.sad16x16x3 = vp8_sad16x16x3_ssse3; cpi->rtcd.variance.sad16x8x3 = vp8_sad16x8x3_ssse3; cpi->rtcd.variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_ssse3; cpi->rtcd.variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_ssse3; cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_ssse3; #if CONFIG_INTERNAL_STATS #if ARCH_X86_64 cpi->rtcd.variance.ssimpf_8x8 = vp8_ssim_parms_8x8_sse3; cpi->rtcd.variance.ssimpf = vp8_ssim_parms_16x16_sse3; #endif #endif } #endif #if HAVE_SSE4_1 if (flags & HAS_SSE4_1) { cpi->rtcd.variance.sad16x16x8 = vp8_sad16x16x8_sse4; cpi->rtcd.variance.sad16x8x8 = vp8_sad16x8x8_sse4; cpi->rtcd.variance.sad8x16x8 = vp8_sad8x16x8_sse4; cpi->rtcd.variance.sad8x8x8 = vp8_sad8x8x8_sse4; cpi->rtcd.variance.sad4x4x8 = vp8_sad4x4x8_sse4; cpi->rtcd.search.full_search = vp8_full_search_sadx8; cpi->rtcd.quantize.quantb = vp8_regular_quantize_b_sse4; } #endif #endif }
int test_change_cpu_dec(int argc, const char** argv, const std::string &working_dir, const std::string sub_folder_str, int test_type, int delete_ivf, int artifact_detection) { #if defined(ARM) printf("\nTEST NOT SUPPORTED FOR ARM.\n"); return kTestFailed; #endif #if defined(_PPC) printf("\nTEST NOT SUPPORTED FOR PPC.\n"); return kTestFailed; #else char *comp_out_str = "Version"; char *test_dir = "test_change_cpu_dec"; int input_ver = vpxt_check_arg_input(argv[1], argc); if (input_ver < 0) return vpxt_test_help(argv[1], 0); std::string input = argv[2]; int mode = atoi(argv[3]); int bitrate = atoi(argv[4]); int version_num = atoi(argv[5]); std::string enc_format = argv[6]; std::string dec_format = argv[7]; unsigned int total_ms = 0; unsigned int total_ms_2 = 0; int speed = 0; int fail = 0; int modes_run = 0; int simd_caps = x86_simd_caps(); char simd_caps_orig_char[10]; vpxt_itoa_custom(simd_caps, simd_caps_orig_char, 10); //////////// Formatting Test Specific directory //////////// std::string cur_test_dir_str; std::string file_index_str; char main_test_dir_char[255] = ""; char file_index_output_char[255] = ""; if (initialize_test_directory(argc, argv, test_type, working_dir, test_dir, cur_test_dir_str, file_index_str, main_test_dir_char, file_index_output_char, sub_folder_str) == 11) return kTestErrFileMismatch; std::string cpu_dec_only_enc = cur_test_dir_str + slashCharStr() + test_dir + "_compression"; vpxt_enc_format_append(cpu_dec_only_enc, enc_format); std::string cpu_dec_only_dec = cur_test_dir_str + slashCharStr() + test_dir + "_decompression"; std::string cpu_dec_only_dec_none = cpu_dec_only_dec + "_none"; vpxt_dec_format_append(cpu_dec_only_dec_none, dec_format); std::string cpu_dec_only_dec_mmx = cpu_dec_only_dec + "_mmx"; vpxt_dec_format_append(cpu_dec_only_dec_mmx, dec_format); std::string cpu_dec_only_dec_sse = cpu_dec_only_dec + "_sse"; vpxt_dec_format_append(cpu_dec_only_dec_sse, dec_format); std::string cpu_dec_only_dec_sse2 = cpu_dec_only_dec + "_sse2"; vpxt_dec_format_append(cpu_dec_only_dec_sse2, dec_format); std::string cpu_dec_only_dec_sse3 = cpu_dec_only_dec + "_sse3"; vpxt_dec_format_append(cpu_dec_only_dec_sse3, dec_format); std::string cpu_dec_only_dec_ssse3 = cpu_dec_only_dec + "_ssse3"; vpxt_dec_format_append(cpu_dec_only_dec_ssse3, dec_format); std::string cpu_dec_only_dec_sse4_1 = cpu_dec_only_dec + "_sse4_1"; vpxt_dec_format_append(cpu_dec_only_dec_sse4_1, dec_format); ///////////// Open Output File and Print Header //////////// std::string text_file_str = cur_test_dir_str + slashCharStr() + test_dir; FILE *fp; vpxt_open_output_file(test_type, text_file_str, fp); vpxt_print_header(argc, argv, main_test_dir_char, cur_test_dir_str, test_dir, test_type); VP8_CONFIG opt; vpxt_default_parameters(opt); /////////////////// Use Custom Settings /////////////////// if(vpxt_use_custom_settings(argv, argc, input_ver, fp, file_index_str, file_index_output_char, test_type, opt, bitrate) == kTestIndeterminate) return kTestIndeterminate; opt.target_bandwidth = bitrate; opt.Mode = MODE_GOODQUALITY; opt.Version = version_num; int compress_int = opt.Version; vpxt_determinate_parameters(opt); int counter = 0; int mode_2 = 0; // Run Test only (Runs Test, Sets up test to be run, or skips compresion of // files) if (test_type == kTestOnly) { std::vector<std::string> decompression_vector; if (vpxt_file_exists_check(cpu_dec_only_dec_none)) decompression_vector.push_back(cpu_dec_only_dec_none); if (vpxt_file_exists_check(cpu_dec_only_dec_mmx)) decompression_vector.push_back(cpu_dec_only_dec_mmx); if (vpxt_file_exists_check(cpu_dec_only_dec_sse)) decompression_vector.push_back(cpu_dec_only_dec_sse); if (vpxt_file_exists_check(cpu_dec_only_dec_sse2)) decompression_vector.push_back(cpu_dec_only_dec_sse2); if (vpxt_file_exists_check(cpu_dec_only_dec_sse3)) decompression_vector.push_back(cpu_dec_only_dec_sse3); if (vpxt_file_exists_check(cpu_dec_only_dec_ssse3)) decompression_vector.push_back(cpu_dec_only_dec_ssse3); if (vpxt_file_exists_check(cpu_dec_only_dec_sse4_1)) decompression_vector.push_back(cpu_dec_only_dec_sse4_1); modes_run = decompression_vector.size(); total_ms = vpxt_time_return(decompression_vector[0].c_str(), 1); unsigned int current_dec_file = 0; while (current_dec_file < decompression_vector.size()) { total_ms_2 = vpxt_time_return(decompression_vector[current_dec_file].c_str(), 1); if (current_dec_file >= 1) { tprintf(PRINT_BTH, "\n"); char comp_file_index_output_char[255]; char comp_file_2[255]; vpxt_file_name(decompression_vector[current_dec_file-1].c_str(), comp_file_index_output_char, 0); vpxt_file_name(decompression_vector[current_dec_file].c_str(), comp_file_2, 0); tprintf(PRINT_BTH, "\nComparing %s to %s\n", comp_file_index_output_char, comp_file_2); int lng_rc = vpxt_compare_enc(decompression_vector[current_dec_file-1].c_str(), decompression_vector[current_dec_file].c_str(), 0); if (lng_rc >= 0) { tprintf(PRINT_BTH, "\n * Fail: Files differ at frame: %i", lng_rc); fail = 1; } if (lng_rc == -1) tprintf(PRINT_BTH, " * Files are identical"); if (lng_rc == -2) { tprintf(PRINT_BTH, "\n * Fail: File 2 ends before File 1." "\n"); fail = 1; } if (lng_rc == -3) { tprintf(PRINT_BTH, "\n * Fail: File 1 ends before File 2." "\n"); fail = 1; } } current_dec_file++; } tprintf(PRINT_BTH, "\n"); } else { std::vector<std::string> decompression_vector; opt.Mode = mode; if (vpxt_compress(input.c_str(), cpu_dec_only_enc.c_str(), speed, bitrate, opt, comp_out_str, compress_int, 0, enc_format, kSetConfigOff) == -1) { fclose(fp); record_test_complete(file_index_str, file_index_output_char, test_type); return kTestIndeterminate; } putenv("VPX_SIMD_CAPS=0"); std::string output_2_str = cpu_dec_only_dec + "_none"; vpxt_dec_format_append(output_2_str, dec_format); tprintf(PRINT_BTH, "\n\nDetected CPU capability: none"); unsigned int cpu_tick_1 = 0; total_ms = vpxt_decompress_time_and_output(cpu_dec_only_enc.c_str() , output_2_str.c_str(), cpu_tick_1, dec_format, 1); decompression_vector.push_back(output_2_str); if (total_ms == -1) { fclose(fp); record_test_complete(file_index_str, file_index_output_char, test_type); std::string simd_caps_str = "VPX_SIMD_CAPS="; simd_caps_str += simd_caps_orig_char; putenv((char*)simd_caps_str.c_str()); return kTestIndeterminate; } tprintf(PRINT_BTH, "\n"); int counter_max = 64; counter++; int i = 1; while (counter < counter_max) { int cpu_found = 0; int has_check = (counter + 1) / 2; if ((simd_caps & HAS_MMX) == has_check) cpu_found = 1; if ((simd_caps & HAS_SSE) == has_check) cpu_found = 1; if ((simd_caps & HAS_SSE2) == has_check) cpu_found = 1; if ((simd_caps & HAS_SSE3) == has_check) cpu_found = 1; if ((simd_caps & HAS_SSSE3) == has_check) cpu_found = 1; if ((simd_caps & HAS_SSE4_1) == has_check) cpu_found = 1; if (cpu_found == 1) { std::string cpu_str; tprintf(PRINT_BTH, "\nDetected CPU capability: "); if ((simd_caps & HAS_MMX) == has_check) cpu_str = "_mmx"; if ((simd_caps & HAS_SSE) == has_check) cpu_str = "_sse"; if ((simd_caps & HAS_SSE2) == has_check) cpu_str = "_sse2"; if ((simd_caps & HAS_SSE3) == has_check) cpu_str = "_sse3"; if ((simd_caps & HAS_SSSE3) == has_check) cpu_str = "_ssse3"; if ((simd_caps & HAS_SSE4_1) == has_check) cpu_str = "_sse4_1"; tprintf(PRINT_BTH, "%s", cpu_str.c_str()); std::string cpu_id_str = "VPX_SIMD_CAPS="; char counter_char[10]; vpxt_itoa_custom(counter, counter_char, 10); cpu_id_str += counter_char; char cpu_char[255]; snprintf(cpu_char, 255, cpu_id_str.c_str()); putenv(cpu_char); ////////////////////////////////// /////// Compresion and time /////// std::string change_cpu_dec_out_file_1 = cpu_dec_only_dec; std::string change_cpu_dec_out_file_2 = cpu_dec_only_dec; char count[20]; vpxt_itoa_custom(counter, count, 10); change_cpu_dec_out_file_1 += cpu_str.c_str(); vpxt_dec_format_append(change_cpu_dec_out_file_1, dec_format); unsigned int cpu_tick_2 = 0; total_ms_2 = vpxt_decompress_time_and_output(cpu_dec_only_enc.c_str(), change_cpu_dec_out_file_1.c_str(), cpu_tick_2, dec_format, 1); decompression_vector.push_back(change_cpu_dec_out_file_1); if (total_ms_2 == -1) { fclose(fp); record_test_complete(file_index_str, file_index_output_char, test_type); std::string simd_caps_str = "VPX_SIMD_CAPS=" + *simd_caps_orig_char; putenv((char*)simd_caps_str.c_str()); return kTestIndeterminate; } int count_old = (counter - 1); vpxt_itoa_custom(count_old, count, 10); change_cpu_dec_out_file_2 += cpu_str.c_str(); vpxt_dec_format_append(change_cpu_dec_out_file_2, dec_format); if (test_type != 2) { char comp_file_index_output_char[255]; char comp_file_2[255]; vpxt_file_name( decompression_vector[decompression_vector.size()-1].c_str(), comp_file_index_output_char, 0); vpxt_file_name( decompression_vector[decompression_vector.size()-2].c_str(), comp_file_2, 0); tprintf(PRINT_BTH, "\nComparing %s to %s\n", comp_file_index_output_char, comp_file_2); int lng_rc = vpxt_compare_dec( decompression_vector[decompression_vector.size()-1].c_str(), decompression_vector[decompression_vector.size()-2].c_str()); if (lng_rc >= 0) { tprintf(PRINT_BTH, "\n * Fail: Files differ at frame: " "%i on file number %i", lng_rc, i); fail = 1; } if (lng_rc == -1) tprintf(PRINT_BTH, " * Files are identical"); if (lng_rc == -2) { tprintf(PRINT_BTH, "\n * Fail: File 2 ends before File " "1.\n"); fail = 1; } if (lng_rc == -3) { tprintf(PRINT_BTH, "\n * Fail: File 1 ends before File " "2.\n"); fail = 1; } } } counter = ((counter + 1) * 2) - 1; tprintf(PRINT_BTH, "\n\n"); i++; } modes_run = decompression_vector.size(); } // Create Compression only stop test short. if (test_type == kCompOnly) { // Compression only run fclose(fp); record_test_complete(file_index_str, file_index_output_char, test_type); std::string simd_caps_str = "VPX_SIMD_CAPS="; simd_caps_str += simd_caps_orig_char; putenv((char*)simd_caps_str.c_str()); return kTestEncCreated; } int test_state = kTestPassed; tprintf(PRINT_BTH, "\nResults:\n\n"); if (fail == 0) { vpxt_formated_print(RESPRT, "All Files Identical - Passed"); tprintf(PRINT_BTH, "\n"); } if (fail == 1) { vpxt_formated_print(RESPRT, "All Files not Identical - Failed"); tprintf(PRINT_BTH, "\n"); test_state = kTestFailed; } if (modes_run == 7) { vpxt_formated_print(RESPRT, "All instruction sets run - Passed"); tprintf(PRINT_BTH, "\n"); } if (modes_run != 7) { vpxt_formated_print(RESPRT, "Not all instruction sets run - MinPassed"); tprintf(PRINT_BTH, "\n"); if (test_state != kTestFailed) test_state = kTestMinPassed; } if (total_ms != total_ms_2) { vpxt_formated_print(RESPRT, "Decompress times are not equal - Passed"); tprintf(PRINT_BTH, "\n"); } if (total_ms == total_ms_2) { vpxt_formated_print(RESPRT, "CPU changes are not effecting the runtime " "- MinPassed"); tprintf(PRINT_BTH, "\n"); test_state = kTestMinPassed; } if (test_state == kTestMinPassed) tprintf(PRINT_BTH, "\nMinPass\n"); if (test_state == kTestPassed) tprintf(PRINT_BTH, "\nPassed\n"); if (test_state == kTestFailed) tprintf(PRINT_BTH, "\nFailed\n"); if (delete_ivf) vpxt_delete_files(8, cpu_dec_only_enc.c_str(), cpu_dec_only_dec_none.c_str(), cpu_dec_only_dec_mmx.c_str(), cpu_dec_only_dec_sse.c_str(), cpu_dec_only_dec_sse2.c_str(), cpu_dec_only_dec_sse3.c_str(), cpu_dec_only_dec_ssse3.c_str(), cpu_dec_only_dec_sse4_1.c_str()); fclose(fp); record_test_complete(file_index_str, file_index_output_char, test_type); std::string simd_caps_str = "VPX_SIMD_CAPS="; simd_caps_str += simd_caps_orig_char; putenv((char*)simd_caps_str.c_str()); return test_state; #endif }
void vp8_arch_x86_common_init(VP8_COMMON *ctx) { #if CONFIG_RUNTIME_CPU_DETECT VP8_COMMON_RTCD *rtcd = &ctx->rtcd; int flags = x86_simd_caps(); /* Note: * * This platform can be built without runtime CPU detection as well. If * you modify any of the function mappings present in this file, be sure * to also update them in static mapings (<arch>/filename_<arch>.h) */ /* Override default functions with fastest ones for this CPU. */ #if HAVE_MMX if (flags & HAS_MMX) { rtcd->idct.idct1 = vp8_short_idct4x4llm_1_mmx; rtcd->idct.idct16 = vp8_short_idct4x4llm_mmx; rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_mmx; rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_mmx; rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_mmx; rtcd->recon.recon = vp8_recon_b_mmx; rtcd->recon.copy8x8 = vp8_copy_mem8x8_mmx; rtcd->recon.copy8x4 = vp8_copy_mem8x4_mmx; rtcd->recon.copy16x16 = vp8_copy_mem16x16_mmx; rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_mmx; rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_mmx; rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_mmx; rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_mmx; rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_mmx; rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_mmx; rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_mmx; rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_mmx; rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_mmx; rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_mmx; rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_mmx; rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_mmx; rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_mmx; rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_mmx; rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_mmx; rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_mmx; #if CONFIG_POSTPROC rtcd->postproc.down = vp8_mbpost_proc_down_mmx; /*rtcd->postproc.across = vp8_mbpost_proc_across_ip_c;*/ rtcd->postproc.downacross = vp8_post_proc_down_and_across_mmx; rtcd->postproc.addnoise = vp8_plane_add_noise_mmx; #endif } #endif #if HAVE_SSE2 if (flags & HAS_SSE2) { rtcd->recon.recon2 = vp8_recon2b_sse2; rtcd->recon.recon4 = vp8_recon4b_sse2; rtcd->recon.copy16x16 = vp8_copy_mem16x16_sse2; rtcd->recon.build_intra_predictors_mbuv = vp8_build_intra_predictors_mbuv_sse2; rtcd->recon.build_intra_predictors_mbuv_s = vp8_build_intra_predictors_mbuv_s_sse2; rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_sse2; rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_sse2; rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_sse2; rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_sse2; rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_sse2; rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_sse2; rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_sse2; rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_sse2; rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_sse2; rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_sse2; rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_sse2; rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_sse2; rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_sse2; rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_sse2; #if CONFIG_POSTPROC rtcd->postproc.down = vp8_mbpost_proc_down_xmm; rtcd->postproc.across = vp8_mbpost_proc_across_ip_xmm; rtcd->postproc.downacross = vp8_post_proc_down_and_across_xmm; rtcd->postproc.addnoise = vp8_plane_add_noise_wmt; #endif } #endif #if HAVE_SSSE3 if (flags & HAS_SSSE3) { rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_ssse3; rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_ssse3; rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_ssse3; rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_ssse3; rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_ssse3; rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_ssse3; rtcd->recon.build_intra_predictors_mbuv = vp8_build_intra_predictors_mbuv_ssse3; rtcd->recon.build_intra_predictors_mbuv_s = vp8_build_intra_predictors_mbuv_s_ssse3; } #endif #endif }