[FFmpeg-cvslog] avdevice/decklink_dec: Used av_parity instead of duplicated function

Karthick J git at videolan.org
Sun Oct 1 19:27:45 EEST 2017


ffmpeg | branch: master | Karthick J <kjeyapal at akamai.com> | Fri Sep 29 09:18:55 2017 +0530| [9e271e3fa3f9ccee70ca3cb21c7c1bd7e871f464] | committer: Carl Eugen Hoyos

avdevice/decklink_dec: Used av_parity instead of duplicated function

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

 libavdevice/decklink_dec.cpp | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 3ce2cab5f4..8a14094474 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -106,14 +106,6 @@ static int get_vanc_line_idx(BMDDisplayMode mode)
     return i - 1;
 }
 
-static inline uint16_t parity (uint16_t x)
-{
-    uint16_t i;
-    for (i = 4 * sizeof (x); i > 0; i /= 2)
-        x ^= x >> i;
-    return x & 1;
-}
-
 static inline void clear_parity_bits(uint16_t *buf, int len) {
     int i;
     for (i = 0; i < len; i++)
@@ -126,7 +118,7 @@ static int check_vanc_parity_checksum(uint16_t *buf, int len, uint16_t checksum)
     for (i = 3; i < len - 1; i++) {
         uint16_t v = buf[i];
         int np = v >> 8;
-        int p = parity(v & 0xff);
+        int p = av_parity(v & 0xff);
         if ((!!p ^ !!(v & 0x100)) || (np != 1 && np != 2)) {
             // Parity check failed
             return -1;



More information about the ffmpeg-cvslog mailing list