[Ffmpeg-devel] [PATCH] simple internal lzo decoder
Jindrich Makovicka
makovick
Mon Jan 16 00:34:33 CET 2006
Reimar D?ffinger wrote:
[...]
> + if (back == 1) {
> + memset(dst, *src, cnt);
> + dst += cnt;
> + } else {
> +#ifdef OUTBUF_PADDED
> + dst[0] = src[0];
> + dst[1] = src[1];
> + dst[2] = src[2];
> + dst[3] = src[3];
> + src += 4;
> + dst += 4;
> + cnt -= 4;
> + if (cnt > 0) {
> + dst[0] = src[0];
> + dst[1] = src[1];
> + dst[2] = src[2];
> + dst[3] = src[3];
> + dst[4] = src[4];
> + dst[5] = src[5];
> + dst[6] = src[6];
> + dst[7] = src[7];
> + src += 8;
> + dst += 8;
> + cnt -= 8;
> + }
> +#endif
> + if (cnt > 0) {
> + int blocklen = back;
> + while (cnt > blocklen) {
> + memcpy(dst, src, blocklen);
> + dst += blocklen;
> + cnt -= blocklen;
> + blocklen <<= 1;
> + }
> + memcpy(dst, src, cnt);
> + }
> + dst += cnt;
> + }
> + c->out = dst;
> }
will this work for 1 < back < 12, back !=4 and cnt > back ?
--
Jindrich Makovicka
More information about the ffmpeg-devel
mailing list