Mercurial > libavcodec.hg
comparison g729dec.c @ 7773:272a13ae94c0 libavcodec
Parity bit calculation routine for G.729
author | voroshil |
---|---|
date | Tue, 02 Sep 2008 17:15:28 +0000 |
parents | dc309e45a671 |
children | b35486af268e |
comparison
equal
deleted
inserted
replaced
7772:834a8f89b75e | 7773:272a13ae94c0 |
---|---|
69 static inline uint16_t g729_random(uint16_t value) | 69 static inline uint16_t g729_random(uint16_t value) |
70 { | 70 { |
71 return 31821 * value + 13849; | 71 return 31821 * value + 13849; |
72 } | 72 } |
73 | 73 |
74 /** | |
75 * Get parity bit of bit 2..7 | |
76 */ | |
77 static inline int g729_get_parity(uint8_t value) | |
78 { | |
79 return (0x6996966996696996ULL >> (value >> 2)) & 1; | |
80 } | |
81 | |
74 AVCodec g729_decoder = | 82 AVCodec g729_decoder = |
75 { | 83 { |
76 "g729", | 84 "g729", |
77 CODEC_TYPE_AUDIO, | 85 CODEC_TYPE_AUDIO, |
78 CODEC_ID_G729, | 86 CODEC_ID_G729, |