Commit 850c6db9 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/utvideodec: Factor multiply out of inner loop

0.5% faster loop
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Reviewed-by: 's avatarSteven Liu <lingjiujianke@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5eb4701b
...@@ -195,7 +195,8 @@ static int decode_plane10(UtvideoContext *c, int plane_no, ...@@ -195,7 +195,8 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
prev = 0x200; prev = 0x200;
for (j = sstart; j < send; j++) { for (j = sstart; j < send; j++) {
for (i = 0; i < width * step; i += step) { int ws = width * step;
for (i = 0; i < ws; i += step) {
pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3);
if (pix < 0) { if (pix < 0) {
av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");
...@@ -299,7 +300,8 @@ static int decode_plane(UtvideoContext *c, int plane_no, ...@@ -299,7 +300,8 @@ static int decode_plane(UtvideoContext *c, int plane_no,
prev = 0x80; prev = 0x80;
for (j = sstart; j < send; j++) { for (j = sstart; j < send; j++) {
for (i = 0; i < width * step; i += step) { int ws = width * step;
for (i = 0; i < ws; i += step) {
pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3);
if (pix < 0) { if (pix < 0) {
av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");
......
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