[FFmpeg-devel] [PATCH] exr: rle decompression
Paul B Mahol
onemda at gmail.com
Thu Jul 12 19:37:58 CEST 2012
On 7/12/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> 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
Changed and pushed.
>
> otherwise LGTM unless we have a reusable RLE decoder which code could
> be reused
I don't see any possible candidate.
More information about the ffmpeg-devel
mailing list