aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-01-03 20:14:57 +0100
committerClément Bœsch <u@pkh.me>2016-01-07 22:51:36 +0100
commita1136ca973e3b216804d05bbf64fcc19ad0f14da (patch)
tree14ecdfbdadd5a74876de68426864a3c6850a7f66 /libavcodec
parent00e96613f3e09bff21126814dbfc0dccdfc4159f (diff)
downloadffmpeg-a1136ca973e3b216804d05bbf64fcc19ad0f14da.tar.gz
lavc/g729dec: use ff_parity()
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/g729dec.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 99053add43..7265883b0e 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -181,14 +181,6 @@ static inline uint16_t g729_prng(uint16_t value)
}
/**
- * Get parity bit of bit 2..7
- */
-static inline int get_parity(uint8_t value)
-{
- return (0x6996966996696996ULL >> (value >> 2)) & 1;
-}
-
-/**
* Decodes LSF (Line Spectral Frequencies) from L0-L3 (3.2.4).
* @param[out] lsfq (2.13) quantized LSF coefficients
* @param[in,out] past_quantizer_outputs (2.13) quantizer outputs from previous frames
@@ -480,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]);
if(!i && format->parity_bit)
- bad_pitch = get_parity(ac_index) == get_bits1(&gb);
+ bad_pitch = ff_parity(ac_index >> 2) == get_bits1(&gb);
fc_indexes = get_bits(&gb, format->fc_indexes_bits);
pulses_signs = get_bits(&gb, format->fc_signs_bits);
gc_1st_index = get_bits(&gb, format->gc_1st_index_bits);