Mercurial > libavcodec.hg
comparison mpegaudiodec.c @ 5513:9f8219a3b86f libavcodec
use get_bits1(..) instead get_bits(.., 1)
author | alex |
---|---|
date | Thu, 09 Aug 2007 00:13:31 +0000 |
parents | 94c3f01c243c |
children | d2ef80f5fd7e |
comparison
equal
deleted
inserted
replaced
5512:28dcc5cd79d2 | 5513:9f8219a3b86f |
---|---|
2000 g->global_gain -= 2; | 2000 g->global_gain -= 2; |
2001 if (s->lsf) | 2001 if (s->lsf) |
2002 g->scalefac_compress = get_bits(&s->gb, 9); | 2002 g->scalefac_compress = get_bits(&s->gb, 9); |
2003 else | 2003 else |
2004 g->scalefac_compress = get_bits(&s->gb, 4); | 2004 g->scalefac_compress = get_bits(&s->gb, 4); |
2005 blocksplit_flag = get_bits(&s->gb, 1); | 2005 blocksplit_flag = get_bits1(&s->gb); |
2006 if (blocksplit_flag) { | 2006 if (blocksplit_flag) { |
2007 g->block_type = get_bits(&s->gb, 2); | 2007 g->block_type = get_bits(&s->gb, 2); |
2008 if (g->block_type == 0){ | 2008 if (g->block_type == 0){ |
2009 av_log(NULL, AV_LOG_ERROR, "invalid block type\n"); | 2009 av_log(NULL, AV_LOG_ERROR, "invalid block type\n"); |
2010 return -1; | 2010 return -1; |
2011 } | 2011 } |
2012 g->switch_point = get_bits(&s->gb, 1); | 2012 g->switch_point = get_bits1(&s->gb); |
2013 for(i=0;i<2;i++) | 2013 for(i=0;i<2;i++) |
2014 g->table_select[i] = get_bits(&s->gb, 5); | 2014 g->table_select[i] = get_bits(&s->gb, 5); |
2015 for(i=0;i<3;i++) | 2015 for(i=0;i<3;i++) |
2016 g->subblock_gain[i] = get_bits(&s->gb, 3); | 2016 g->subblock_gain[i] = get_bits(&s->gb, 3); |
2017 /* compute huffman coded region sizes */ | 2017 /* compute huffman coded region sizes */ |
2079 g->long_end = 22; | 2079 g->long_end = 22; |
2080 } | 2080 } |
2081 | 2081 |
2082 g->preflag = 0; | 2082 g->preflag = 0; |
2083 if (!s->lsf) | 2083 if (!s->lsf) |
2084 g->preflag = get_bits(&s->gb, 1); | 2084 g->preflag = get_bits1(&s->gb); |
2085 g->scalefac_scale = get_bits(&s->gb, 1); | 2085 g->scalefac_scale = get_bits1(&s->gb); |
2086 g->count1table_select = get_bits(&s->gb, 1); | 2086 g->count1table_select = get_bits1(&s->gb); |
2087 dprintf(s->avctx, "block_type=%d switch_point=%d\n", | 2087 dprintf(s->avctx, "block_type=%d switch_point=%d\n", |
2088 g->block_type, g->switch_point); | 2088 g->block_type, g->switch_point); |
2089 } | 2089 } |
2090 } | 2090 } |
2091 | 2091 |