MIPS: dspr2: added optimization for function GetResidualCost

set/get residual C functions moved to new file in src/dsp
mips32 version of GetResidualCost moved to new file

Change-Id: I7cebb7933a89820ff28c187249a9181f281081d2
This commit is contained in:
Pascal Massimino
2015-02-07 02:13:26 -08:00
parent be6635e91d
commit a987faedfa
13 changed files with 392 additions and 226 deletions

View File

@ -24,7 +24,8 @@ extern "C" {
// On-the-fly info about the current set of residuals. Handy to avoid
// passing zillions of params.
typedef struct {
typedef struct VP8Residual VP8Residual;
struct VP8Residual {
int first;
int last;
const int16_t* coeffs;
@ -33,17 +34,11 @@ typedef struct {
ProbaArray* prob;
StatsArray* stats;
CostArray* cost;
} VP8Residual;
};
void VP8InitResidual(int first, int coeff_type,
VP8Encoder* const enc, VP8Residual* const res);
typedef void (*VP8SetResidualCoeffsFunc)(const int16_t* const coeffs,
VP8Residual* const res);
extern VP8SetResidualCoeffsFunc VP8SetResidualCoeffs;
void VP8SetResidualCoeffsInit(void); // must be called first
int VP8RecordCoeffs(int ctx, const VP8Residual* const res);
// approximate cost per level:
@ -55,12 +50,6 @@ static WEBP_INLINE int VP8BitCost(int bit, uint8_t proba) {
return !bit ? VP8EntropyCost[proba] : VP8EntropyCost[255 - proba];
}
// Cost calculation function.
typedef int (*VP8GetResidualCostFunc)(int ctx0, const VP8Residual* const res);
extern VP8GetResidualCostFunc VP8GetResidualCost;
void VP8GetResidualCostInit(void); // must be called first
// Level cost calculations
extern const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2];
void VP8CalculateLevelCosts(VP8Proba* const proba);