static void setup_tests() { for (int test = 0; test < NUM_TESTS; ++test) { unsigned size = NUM_CHUNKS * 64 * 64; actual_bufs[test] = malloc(size * sizeof(kvz_pixel) + SIMD_ALIGNMENT); bufs[test] = ALIGNED_POINTER(actual_bufs[test], SIMD_ALIGNMENT); } for (int test = 0; test < NUM_TESTS; ++test) { for (int chunk = 0; chunk < NUM_CHUNKS; ++chunk) { const int width = 64; int x = (test + chunk) % width; int y = (test + chunk) / width; init_gradient(width - x, y, width, 255 / width, &bufs[test][chunk * 64*64]); } } }
void default_panel() { panels = NULL; num_panels = 0; default_icon = NULL; task_dragged = FALSE; panel_horizontal = TRUE; panel_position = CENTER; panel_items_order = NULL; panel_autohide = FALSE; panel_autohide_show_timeout = 0; panel_autohide_hide_timeout = 0; panel_autohide_height = 5; // for vertical panels this is of course the width panel_shrink = FALSE; panel_strut_policy = STRUT_FOLLOW_SIZE; panel_dock = FALSE; // default not in the dock panel_layer = BOTTOM_LAYER; // default is bottom layer panel_window_name = strdup("tint2"); wm_menu = FALSE; max_tick_urgent = 14; mouse_left = TOGGLE_ICONIFY; backgrounds = g_array_new(0, 0, sizeof(Background)); gradients = g_array_new(0, 0, sizeof(GradientClass)); memset(&panel_config, 0, sizeof(Panel)); snprintf(panel_config.area.name, sizeof(panel_config.area.name), "Panel"); panel_config.mouse_over_alpha = 100; panel_config.mouse_over_saturation = 0; panel_config.mouse_over_brightness = 10; panel_config.mouse_pressed_alpha = 100; panel_config.mouse_pressed_saturation = 0; panel_config.mouse_pressed_brightness = 0; panel_config.mouse_effects = 1; // First background is always fully transparent Background transparent_bg; init_background(&transparent_bg); g_array_append_val(backgrounds, transparent_bg); GradientClass transparent_gradient; init_gradient(&transparent_gradient, GRADIENT_VERTICAL); g_array_append_val(gradients, transparent_gradient); }
static void setup_tests() { for (int test = 0; test < NUM_TESTS; ++test) { dct_actual_bufs[test] = malloc(LCU_WIDTH*LCU_WIDTH*sizeof(int16_t) + SIMD_ALIGNMENT); dct_bufs[test] = ALIGNED_POINTER(dct_actual_bufs[test], SIMD_ALIGNMENT); } for (int test = 0; test < NUM_TESTS; ++test) { const int width = LCU_WIDTH; init_gradient(width, width, width, 255 / width, dct_bufs[test]); } // Select buffer width according to function name for dct function. int block = 0; for (int s = 0; s < strategies.count && block < NUM_SIZES; ++s) { strategy_t *strat = &strategies.strategies[s]; dct_func* dct_generic = 0; if ( ( strcmp(strat->type, "fast_forward_dst_4x4") == 0 || strcmp(strat->type, "dct_4x4") == 0 || strcmp(strat->type, "dct_8x8") == 0 || strcmp(strat->type, "dct_16x16") == 0 || strcmp(strat->type, "dct_32x32") == 0 ) && strcmp(strat->strategy_name, "generic") == 0 ) { dct_generic = strat->fptr; dct_generic(KVZ_BIT_DEPTH, dct_bufs[block], dct_result[block]); ++block; } } block = 0; for (int s = 0; s < strategies.count && block < NUM_SIZES; ++s) { strategy_t *strat = &strategies.strategies[s]; dct_func* idct_generic = 0; if ( ( strcmp(strat->type, "fast_inverse_dst_4x4") == 0 || strcmp(strat->type, "idct_4x4") == 0 || strcmp(strat->type, "idct_8x8") == 0 || strcmp(strat->type, "idct_16x16") == 0 || strcmp(strat->type, "idct_32x32") == 0 ) && strcmp(strat->strategy_name, "generic") == 0 ) { idct_generic = strat->fptr; idct_generic(KVZ_BIT_DEPTH, dct_bufs[block], idct_result[block]); ++block; } } }