[FFmpeg-cvslog] qtrle: use bytestream2_get_buffer()

Paul B Mahol git at videolan.org
Wed Aug 21 21:34:27 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Aug 21 18:57:30 2013 +0000| [925d0837b9f06be66e6aa56ff432154061829781] | committer: Paul B Mahol

qtrle: use bytestream2_get_buffer()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=925d0837b9f06be66e6aa56ff432154061829781
---

 libavcodec/qtrle.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 6bf138f..6dfe2ce 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -110,8 +110,8 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
             rle_code *= 2;
             CHECK_PIXEL_PTR(rle_code);
 
-            while (rle_code--)
-                rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
+            bytestream2_get_buffer(&s->g, &rgb[pixel_ptr], rle_code);
+            pixel_ptr += rle_code;
         }
     }
 }
@@ -214,9 +214,8 @@ static void qtrle_decode_8bpp(QtrleContext *s, int row_ptr, int lines_to_change)
                 rle_code *= 4;
                 CHECK_PIXEL_PTR(rle_code);
 
-                while (rle_code--) {
-                    rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
-                }
+                bytestream2_get_buffer(&s->g, &rgb[pixel_ptr], rle_code);
+                pixel_ptr += rle_code;
             }
         }
         row_ptr += row_inc;



More information about the ffmpeg-cvslog mailing list