[FFmpeg-cvslog] svq1dec: check return value of get_bits1() in more common way

Paul B Mahol git at videolan.org
Sun Oct 14 12:45:24 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Oct 14 09:14:35 2012 +0000| [8f4020d8a4b2e6264f54accbcb881577316c3ca6] | committer: Paul B Mahol

svq1dec: check return value of get_bits1() in more common way

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

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

 libavcodec/svq1dec.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index b5999d4..8e4a482 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -100,7 +100,7 @@ static const uint8_t string_table[256] = {
                 break;                                                  \
         }                                                               \
         /* divide block if next bit set */                              \
-        if (get_bits1(bitbuf) == 0)                                     \
+        if (!get_bits1(bitbuf))                                         \
             break;                                                      \
         /* add child nodes */                                           \
         list[n++] = list[i];                                            \
@@ -564,7 +564,7 @@ static int svq1_decode_frame_header(GetBitContext *bitbuf, MpegEncContext *s)
     }
 
     /* unknown fields */
-    if (get_bits1(bitbuf) == 1) {
+    if (get_bits1(bitbuf)) {
         skip_bits1(bitbuf);    /* use packet checksum if (1) */
         skip_bits1(bitbuf);    /* component checksums after image data if (1) */
 
@@ -572,13 +572,13 @@ static int svq1_decode_frame_header(GetBitContext *bitbuf, MpegEncContext *s)
             return AVERROR_INVALIDDATA;
     }
 
-    if (get_bits1(bitbuf) == 1) {
+    if (get_bits1(bitbuf)) {
         skip_bits1(bitbuf);
         skip_bits(bitbuf, 4);
         skip_bits1(bitbuf);
         skip_bits(bitbuf, 2);
 
-        while (get_bits1(bitbuf) == 1)
+        while (get_bits1(bitbuf))
             skip_bits(bitbuf, 8);
     }
 



More information about the ffmpeg-cvslog mailing list