[FFmpeg-cvslog] avcodec/cavsdec: simplify % 512 operations
Michael Niedermayer
git at videolan.org
Wed Jun 18 04:56:37 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jun 18 04:18:40 2014 +0200| [c932f12806d28d8c287002807638b338e1d84dd3] | committer: Michael Niedermayer
avcodec/cavsdec: simplify % 512 operations
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c932f12806d28d8c287002807638b338e1d84dd3
---
libavcodec/cavsdec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 51f6e25..20cc180 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -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) {
More information about the ffmpeg-cvslog
mailing list