diff options
author | Alex Converse <alex.converse@gmail.com> | 2012-03-05 05:24:38 +0400 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2012-03-05 23:22:11 +0400 |
commit | b70feb405386cda5ea7a7d2a9921a7f2f17976a4 (patch) | |
tree | 550a5288f44c952e5116e79a5c281d55e0eba205 /libavcodec/amrnbdec.c | |
parent | 94cf64b81fa129a92c92450521eced6bf6d9801e (diff) |
amrnb/amrwb: Remove get_bits usage.
It is used to parse fixed sized fields out of a single octet. The code
is simpler without it.
Diffstat (limited to 'libavcodec/amrnbdec.c')
-rw-r--r-- | libavcodec/amrnbdec.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index a7d0b4e337..0eeda6d843 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -44,7 +44,6 @@ #include <math.h> #include "avcodec.h" -#include "get_bits.h" #include "libavutil/common.h" #include "celp_math.h" #include "celp_filters.h" @@ -189,16 +188,11 @@ static av_cold int amrnb_decode_init(AVCodecContext *avctx) static enum Mode unpack_bitstream(AMRContext *p, const uint8_t *buf, int buf_size) { - GetBitContext gb; enum Mode mode; - init_get_bits(&gb, buf, buf_size * 8); - // Decode the first octet. - skip_bits(&gb, 1); // padding bit - mode = get_bits(&gb, 4); // frame type - p->bad_frame_indicator = !get_bits1(&gb); // quality bit - skip_bits(&gb, 2); // two padding bits + mode = buf[0] >> 3 & 0x0F; // frame type + p->bad_frame_indicator = (buf[0] & 0x4) != 0x4; // quality bit if (mode >= N_MODES || buf_size < frame_sizes_nb[mode] + 1) { return NO_DATA; |