mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 21:20:41 +00:00
avdevice/decklink_dec: Used av_parity instead of duplicated function
This commit is contained in:
parent
54ce880a46
commit
9e271e3fa3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user