[FFmpeg-devel] [PATCH] exr: rle decompression
Michael Niedermayer
michaelni at gmx.at
Thu Jul 12 15:30:02 CEST 2012
On Thu, Jul 12, 2012 at 01:15:33AM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
> libavcodec/exr.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 44 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/exr.c b/libavcodec/exr.c
> index aa77b8e..893d9a2 100644
> --- a/libavcodec/exr.c
> +++ b/libavcodec/exr.c
> @@ -34,6 +34,7 @@
>
> #include "avcodec.h"
> #include "bytestream.h"
> +#include "mathops.h"
> #include "libavutil/imgutils.h"
>
> enum ExrCompr {
> @@ -183,6 +184,40 @@ static void reorder_pixels(uint8_t *src, uint8_t *dst, int size)
> }
> }
>
> +static int rle_uncompress(const uint8_t *src, int ssize, uint8_t *dst, int dsize)
> +{
> + uint8_t *dst_end = dst + dsize;
> + int count;
> +
> + while (ssize > 0) {
> + count = sign_extend(*src++, 8);
reading as int8_t should avoid the sign_extend and might be faster
if the compiler isnt that smart
otherwise LGTM unless we have a reusable RLE decoder which code could
be reused
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120712/fab3fb5c/attachment.asc>
More information about the ffmpeg-devel
mailing list