Commit c932f128 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/cavsdec: simplify % 512 operations

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0608bc65
......@@ -1003,11 +1003,11 @@ static int decode_pic(AVSContext *h)
/* get temporal distances and MV scaling factors */
if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) {
h->dist[0] = (h->cur.poc - h->DPB[0].poc + 512) % 512;
h->dist[0] = (h->cur.poc - h->DPB[0].poc) & 511;
} else {
h->dist[0] = (h->DPB[0].poc - h->cur.poc + 512) % 512;
h->dist[0] = (h->DPB[0].poc - h->cur.poc) & 511;
}
h->dist[1] = (h->cur.poc - h->DPB[1].poc + 512) % 512;
h->dist[1] = (h->cur.poc - h->DPB[1].poc) & 511;
h->scale_den[0] = h->dist[0] ? 512/h->dist[0] : 0;
h->scale_den[1] = h->dist[1] ? 512/h->dist[1] : 0;
if (h->cur.f->pict_type == AV_PICTURE_TYPE_B) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment