[FFmpeg-cvslog] r15474 - trunk/libavcodec/indeo3.c
Benoit Fouet
ml_benoitfouet
Tue Sep 30 11:45:11 CEST 2008
benoit wrote:
> Modified: trunk/libavcodec/indeo3.c
> ==============================================================================
> --- trunk/libavcodec/indeo3.c (original)
> +++ trunk/libavcodec/indeo3.c Tue Sep 30 11:35:53 2008
> @@ -69,24 +69,25 @@ static av_cold void build_modpred(Indeo3
> s->ModPred = av_malloc(8 * 128);
>
> for (i=0; i < 128; ++i) {
> - s->ModPred[i+0*128] = (i > 126) ? 254 : 2*((i + 1) - ((i + 1) % 2));
> - s->ModPred[i+1*128] = (i == 7) ? 20 : ((i == 119 || i == 120)
> - ? 236 : 2*((i + 2) - ((i + 1) % 3)));
> - s->ModPred[i+2*128] = (i > 125) ? 248 : 2*((i + 2) - ((i + 2) % 4));
> - s->ModPred[i+3*128] = 2*((i + 1) - ((i - 3) % 5));
> - s->ModPred[i+4*128] = (i == 8) ? 20 : 2*((i + 1) - ((i - 3) % 6));
> - s->ModPred[i+5*128] = 2*((i + 4) - ((i + 3) % 7));
> - s->ModPred[i+6*128] = (i > 123) ? 240 : 2*((i + 4) - ((i + 4) % 8));
> - s->ModPred[i+7*128] = 2*((i + 5) - ((i + 4) % 9));
> + s->ModPred[i+0*128] = i > 126 ? 254 : 2*(i + 1 - ((i + 1) % 2));
> + s->ModPred[i+1*128] = i == 7 ? 20 :
> + i == 119 ||
> + i == 120 ? 236 : 2*(i + 2 - ((i + 1) % 3));
> + s->ModPred[i+2*128] = i > 125 ? 248 : 2*(i + 2 - ((i + 2) % 4));
> + s->ModPred[i+3*128] = 2*(i + 1 - ((i - 3) % 5));
> + s->ModPred[i+4*128] = i == 8 ? 20 : 2*(i + 1 - ((i - 3) % 6));
> + s->ModPred[i+5*128] = 2*(i + 4 - ((i + 3) % 7));
> + s->ModPred[i+6*128] = i > 123 ? 240 : 2*(i + 4 - ((i + 4) % 8));
> + s->ModPred[i+7*128] = 2*(i + 5 - ((i + 4) % 9));
> }
>
I also tried to simplify assignations to use less modulo operations, but
it lead to less symetric code, so I left the code as it was.
If the simplification is prefered, I can do it, though...
--
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com
More information about the ffmpeg-cvslog
mailing list