optimize predictor #1 in plain-C

For some reason, gcc has hard time inlining this one...

Also optimize predictor #0 and #1 for encoding, so we don't have to
call the generic pointers VP8LPredictors[...]

Change-Id: I1ff31e3b83874b53f84fe23487f644619fd61db9
This commit is contained in:
Pascal Massimino
2016-12-12 17:41:36 +01:00
parent 9ae0b3f65a
commit fbba5bc2c1
2 changed files with 51 additions and 31 deletions

View File

@ -168,7 +168,15 @@ static uint32_t Predictor13(uint32_t left, const uint32_t* const top) {
}
GENERATE_PREDICTOR_ADD(Predictor0, PredictorAdd0)
GENERATE_PREDICTOR_ADD(Predictor1, PredictorAdd1)
static void PredictorAdd1(const uint32_t* in, const uint32_t* upper,
int num_pixels, uint32_t* out) {
int i;
uint32_t left = out[-1];
for (i = 0; i < num_pixels; ++i) {
out[i] = left = VP8LAddPixels(in[i], left);
}
(void)upper;
}
GENERATE_PREDICTOR_ADD(Predictor2, PredictorAdd2)
GENERATE_PREDICTOR_ADD(Predictor3, PredictorAdd3)
GENERATE_PREDICTOR_ADD(Predictor4, PredictorAdd4)