mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Rename struct strategy to strategy_t.
This commit is contained in:
parent
db42176a64
commit
95afc5af51
|
@ -97,7 +97,7 @@ int strategyselector_register(void * const opaque, const char * const type, cons
|
||||||
strategy_list * const strategies = opaque;
|
strategy_list * const strategies = opaque;
|
||||||
|
|
||||||
if (strategies->allocated == strategies->count) {
|
if (strategies->allocated == strategies->count) {
|
||||||
strategy* new_strategies = realloc(strategies->strategies, sizeof(strategy) * (strategies->allocated + STRATEGY_LIST_ALLOC_SIZE));
|
strategy_t* new_strategies = realloc(strategies->strategies, sizeof(strategy_t) * (strategies->allocated + STRATEGY_LIST_ALLOC_SIZE));
|
||||||
if (!new_strategies) {
|
if (!new_strategies) {
|
||||||
fprintf(stderr, "Could not increase strategies list size!\n");
|
fprintf(stderr, "Could not increase strategies list size!\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -107,7 +107,7 @@ int strategyselector_register(void * const opaque, const char * const type, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
strategy *new_strategy = &strategies->strategies[strategies->count++];
|
strategy_t *new_strategy = &strategies->strategies[strategies->count++];
|
||||||
new_strategy->type = type;
|
new_strategy->type = type;
|
||||||
new_strategy->strategy_name = strategy_name;
|
new_strategy->strategy_name = strategy_name;
|
||||||
new_strategy->priority = priority;
|
new_strategy->priority = priority;
|
||||||
|
|
|
@ -96,12 +96,12 @@ typedef struct {
|
||||||
const char *strategy_name; //Name of the strategy (e.g. sse2)
|
const char *strategy_name; //Name of the strategy (e.g. sse2)
|
||||||
unsigned int priority; //Priority. 0 = lowest (default strategy)
|
unsigned int priority; //Priority. 0 = lowest (default strategy)
|
||||||
void *fptr; //Pointer to the function
|
void *fptr; //Pointer to the function
|
||||||
} strategy;
|
} strategy_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
unsigned int allocated;
|
unsigned int allocated;
|
||||||
strategy* strategies;
|
strategy_t* strategies;
|
||||||
} strategy_list;
|
} strategy_list;
|
||||||
|
|
||||||
#define STRATEGY_LIST_ALLOC_SIZE 16
|
#define STRATEGY_LIST_ALLOC_SIZE 16
|
||||||
|
|
|
@ -45,7 +45,7 @@ static int16_t idct_result[NUM_SIZES][LCU_WIDTH*LCU_WIDTH] = { { 0 } };
|
||||||
static struct test_env_t {
|
static struct test_env_t {
|
||||||
int log_width; // for selecting dim from bufs
|
int log_width; // for selecting dim from bufs
|
||||||
dct_func * tested_func;
|
dct_func * tested_func;
|
||||||
const strategy * strategy;
|
const strategy_t * strategy;
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
} test_env;
|
} test_env;
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ static void setup_tests()
|
||||||
int block = 0;
|
int block = 0;
|
||||||
for (int s = 0; s < strategies.count && block < NUM_SIZES; ++s)
|
for (int s = 0; s < strategies.count && block < NUM_SIZES; ++s)
|
||||||
{
|
{
|
||||||
strategy *strat = &strategies.strategies[s];
|
strategy_t *strat = &strategies.strategies[s];
|
||||||
dct_func* dct_generic = 0;
|
dct_func* dct_generic = 0;
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
|
@ -108,7 +108,7 @@ static void setup_tests()
|
||||||
block = 0;
|
block = 0;
|
||||||
for (int s = 0; s < strategies.count && block < NUM_SIZES; ++s)
|
for (int s = 0; s < strategies.count && block < NUM_SIZES; ++s)
|
||||||
{
|
{
|
||||||
strategy *strat = &strategies.strategies[s];
|
strategy_t *strat = &strategies.strategies[s];
|
||||||
dct_func* idct_generic = 0;
|
dct_func* idct_generic = 0;
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
|
@ -187,7 +187,7 @@ SUITE(dct_tests)
|
||||||
// Loop through all strategies picking out the intra sad ones and run
|
// Loop through all strategies picking out the intra sad ones and run
|
||||||
// select strategies though all tests
|
// select strategies though all tests
|
||||||
for (unsigned i = 0; i < strategies.count; ++i) {
|
for (unsigned i = 0; i < strategies.count; ++i) {
|
||||||
const strategy * strategy = &strategies.strategies[i];
|
const strategy_t * strategy = &strategies.strategies[i];
|
||||||
|
|
||||||
// Select buffer width according to function name for dct function.
|
// Select buffer width according to function name for dct function.
|
||||||
if (strcmp(strategy->type, "fast_forward_dst_4x4") == 0) {
|
if (strcmp(strategy->type, "fast_forward_dst_4x4") == 0) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ pixel * actual_bufs[NUM_TESTS]; // pointers returned by malloc.
|
||||||
static struct test_env_t {
|
static struct test_env_t {
|
||||||
int log_width; // for selecting dim from bufs
|
int log_width; // for selecting dim from bufs
|
||||||
void * tested_func;
|
void * tested_func;
|
||||||
const strategy * strategy;
|
const strategy_t * strategy;
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
} test_env;
|
} test_env;
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ SUITE(speed_tests)
|
||||||
// Loop through all strategies picking out the intra sad ones and run
|
// Loop through all strategies picking out the intra sad ones and run
|
||||||
// selectec strategies though all tests
|
// selectec strategies though all tests
|
||||||
for (unsigned i = 0; i < strategies.count; ++i) {
|
for (unsigned i = 0; i < strategies.count; ++i) {
|
||||||
const strategy * strategy = &strategies.strategies[i];
|
const strategy_t * strategy = &strategies.strategies[i];
|
||||||
|
|
||||||
// Select buffer width according to function name for intra cost functions.
|
// Select buffer width according to function name for intra cost functions.
|
||||||
if (strcmp(strategy->type, "sad_8bit_4x4") == 0) {
|
if (strcmp(strategy->type, "sad_8bit_4x4") == 0) {
|
||||||
|
|
Loading…
Reference in a new issue