diff options
author | Alex Converse <alex.converse@gmail.com> | 2012-03-04 17:24:38 -0800 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2012-03-05 11:22:11 -0800 |
commit | b70feb405386cda5ea7a7d2a9921a7f2f17976a4 (patch) | |
tree | 550a5288f44c952e5116e79a5c281d55e0eba205 /libavcodec/amrwbdec.c | |
parent | 94cf64b81fa129a92c92450521eced6bf6d9801e (diff) | |
download | ffmpeg-b70feb405386cda5ea7a7d2a9921a7f2f17976a4.tar.gz |
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/amrwbdec.c')
-rw-r--r-- | libavcodec/amrwbdec.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index b9ae9ece66..8bbc31c9bd 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -27,7 +27,6 @@ #include "libavutil/lfg.h" #include "avcodec.h" -#include "get_bits.h" #include "lsp.h" #include "celp_math.h" #include "celp_filters.h" @@ -120,14 +119,9 @@ static av_cold int amrwb_decode_init(AVCodecContext *avctx) */ static int decode_mime_header(AMRWBContext *ctx, const uint8_t *buf) { - GetBitContext gb; - init_get_bits(&gb, buf, 8); - /* Decode frame header (1st octet) */ - skip_bits(&gb, 1); // padding bit - ctx->fr_cur_mode = get_bits(&gb, 4); - ctx->fr_quality = get_bits1(&gb); - skip_bits(&gb, 2); // padding bits + ctx->fr_cur_mode = buf[0] >> 3 & 0x0F; + ctx->fr_quality = (buf[0] & 0x4) != 0x4; return 1; } |