Commit a1136ca9 authored by Clément Bœsch's avatar Clément Bœsch

lavc/g729dec: use ff_parity()

parent 00e96613
...@@ -180,14 +180,6 @@ static inline uint16_t g729_prng(uint16_t value) ...@@ -180,14 +180,6 @@ static inline uint16_t g729_prng(uint16_t value)
return 31821 * value + 13849; return 31821 * value + 13849;
} }
/**
* 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). * Decodes LSF (Line Spectral Frequencies) from L0-L3 (3.2.4).
* @param[out] lsfq (2.13) quantized LSF coefficients * @param[out] lsfq (2.13) quantized LSF coefficients
...@@ -480,7 +472,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, ...@@ -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]); ac_index = get_bits(&gb, format->ac_index_bits[i]);
if(!i && format->parity_bit) 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); 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment