mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavu: rename and move ff_parity to av_parity
av_popcount is not defined in intmath.h. Reviewed-by: ubitux Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
a1136ca973
commit
28d5a3a74a
@ -202,10 +202,10 @@ static int validate_cc_data_pair(uint8_t *cc_data_pair)
|
|||||||
|
|
||||||
// if EIA-608 data then verify parity.
|
// if EIA-608 data then verify parity.
|
||||||
if (cc_type==0 || cc_type==1) {
|
if (cc_type==0 || cc_type==1) {
|
||||||
if (!ff_parity(cc_data_pair[2])) {
|
if (!av_parity(cc_data_pair[2])) {
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
if (!ff_parity(cc_data_pair[1])) {
|
if (!av_parity(cc_data_pair[1])) {
|
||||||
cc_data_pair[1]=0x7F;
|
cc_data_pair[1]=0x7F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -472,7 +472,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
|||||||
|
|
||||||
ac_index = get_bits(&gb, format->ac_index_bits[i]);
|
ac_index = get_bits(&gb, format->ac_index_bits[i]);
|
||||||
if(!i && format->parity_bit)
|
if(!i && format->parity_bit)
|
||||||
bad_pitch = ff_parity(ac_index >> 2) == get_bits1(&gb);
|
bad_pitch = av_parity(ac_index >> 2) == get_bits1(&gb);
|
||||||
fc_indexes = get_bits(&gb, format->fc_indexes_bits);
|
fc_indexes = get_bits(&gb, format->fc_indexes_bits);
|
||||||
pulses_signs = get_bits(&gb, format->fc_signs_bits);
|
pulses_signs = get_bits(&gb, format->fc_signs_bits);
|
||||||
gc_1st_index = get_bits(&gb, format->gc_1st_index_bits);
|
gc_1st_index = get_bits(&gb, format->gc_1st_index_bits);
|
||||||
|
@ -331,6 +331,11 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
|
|||||||
return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32));
|
return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static av_always_inline av_const int av_parity_c(uint32_t v)
|
||||||
|
{
|
||||||
|
return av_popcount(v) & 1;
|
||||||
|
}
|
||||||
|
|
||||||
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
|
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
|
||||||
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
|
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
|
||||||
|
|
||||||
@ -517,3 +522,6 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
|
|||||||
#ifndef av_popcount64
|
#ifndef av_popcount64
|
||||||
# define av_popcount64 av_popcount64_c
|
# define av_popcount64 av_popcount64_c
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef av_parity
|
||||||
|
# define av_parity av_parity_c
|
||||||
|
#endif
|
||||||
|
@ -153,16 +153,10 @@ static av_always_inline av_const unsigned ff_clz_c(unsigned x)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ff_parity
|
#if AV_GCC_VERSION_AT_LEAST(3,4)
|
||||||
#define ff_parity ff_parity_c
|
#ifndef av_parity
|
||||||
static av_always_inline av_const int ff_parity_c(uint32_t v)
|
#define av_parity __builtin_parity
|
||||||
{
|
|
||||||
#if HAVE_PARITY
|
|
||||||
return __builtin_parity(v);
|
|
||||||
#else
|
|
||||||
return av_popcount(v) & 1;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define LIBAVUTIL_VERSION_MAJOR 55
|
#define LIBAVUTIL_VERSION_MAJOR 55
|
||||||
#define LIBAVUTIL_VERSION_MINOR 12
|
#define LIBAVUTIL_VERSION_MINOR 13
|
||||||
#define LIBAVUTIL_VERSION_MICRO 100
|
#define LIBAVUTIL_VERSION_MICRO 100
|
||||||
|
|
||||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||||
|
Loading…
Reference in New Issue
Block a user