[FFmpeg-devel] [PATCH] sgidec: use bytestream2_get_bufferu()

Michael Niedermayer michaelni at gmx.at
Mon Aug 26 17:49:20 CEST 2013


On Mon, Aug 26, 2013 at 03:22:18PM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/sgidec.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
> index 4f7f8ac..3ce5994 100644
> --- a/libavcodec/sgidec.c
> +++ b/libavcodec/sgidec.c
> @@ -138,9 +138,10 @@ static int read_uncompressed_sgi(unsigned char* out_buf, SgiState *s)
>      for (y = s->height - 1; y >= 0; y--) {
>          out_end = out_buf + (y * s->linesize);
>          if (s->bytes_per_channel == 1) {
> -            for (x = s->width; x > 0; x--)
> -                for (z = 0; z < s->depth; z++)
> -                    *out_end++ = bytestream2_get_byteu(&gp[z]);
> +            for (x = s->width; x > 0; x--) {
> +                bytestream2_get_bufferu(&gp[z], out_end, s->depth);
> +                out_end += s->depth;
> +            }

LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- 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/20130826/17bed78b/attachment.asc>


More information about the ffmpeg-devel mailing list