mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
mmvideo: remove some conditional statements by limiting range of half_horiz and half_vert parameters to [0,1]
Originally committed as revision 26299 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
cb77dad724
commit
091bc6ca8c
@ -78,6 +78,10 @@ static void mm_decode_pal(MmContext *s, const uint8_t *buf, const uint8_t *buf_e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param half_horiz Half horizontal resolution (0 or 1)
|
||||||
|
* @param half_vert Half vertical resolution (0 or 1)
|
||||||
|
*/
|
||||||
static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
|
static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
|
||||||
{
|
{
|
||||||
int i, x, y;
|
int i, x, y;
|
||||||
@ -108,11 +112,15 @@ static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const
|
|||||||
|
|
||||||
if (x >= s->avctx->width) {
|
if (x >= s->avctx->width) {
|
||||||
x=0;
|
x=0;
|
||||||
y += half_vert ? 2 : 1;
|
y += 1 + half_vert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param half_horiz Half horizontal resolution (0 or 1)
|
||||||
|
* @param half_vert Half vertical resolution (0 or 1)
|
||||||
|
*/
|
||||||
static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
|
static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
|
||||||
{
|
{
|
||||||
const int data_ptr = 2 + AV_RL16(&buf[0]);
|
const int data_ptr = 2 + AV_RL16(&buf[0]);
|
||||||
@ -145,12 +153,12 @@ static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const
|
|||||||
}
|
}
|
||||||
d++;
|
d++;
|
||||||
}
|
}
|
||||||
x += half_horiz ? 2 : 1;
|
x += 1 + half_horiz;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r += length;
|
r += length;
|
||||||
y += half_vert ? 2 : 1;
|
y += 1 + half_vert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user