Commit 7ae7300e authored by Alex Beregszaszi's avatar Alex Beregszaszi

use skip_bits where appropriate

Originally committed as revision 10004 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 7f95d9f6
......@@ -201,9 +201,9 @@ static void bastardized_rice_decompress(ALACContext *alac,
if (extrabits > 1) {
x += extrabits - 1;
get_bits(&alac->gb, k);
skip_bits(&alac->gb, k);
} else
get_bits(&alac->gb, k - 1);
skip_bits(&alac->gb, k - 1);
}
}
......@@ -250,9 +250,9 @@ static void bastardized_rice_decompress(ALACContext *alac,
if (extrabits < 2) {
x = 1 - extrabits;
block_size += x;
get_bits(&alac->gb, k - 1);
skip_bits(&alac->gb, k - 1);
} else {
get_bits(&alac->gb, k);
skip_bits(&alac->gb, k);
}
}
......@@ -484,9 +484,9 @@ static int alac_decode_frame(AVCodecContext *avctx,
/* 2^result = something to do with output waiting.
* perhaps matters if we read > 1 frame in a pass?
*/
get_bits(&alac->gb, 4);
skip_bits(&alac->gb, 4);
get_bits(&alac->gb, 12); /* unknown, skip 12 bits */
skip_bits(&alac->gb, 12); /* unknown, skip 12 bits */
/* the output sample size is stored soon */
hassize = get_bits1(&alac->gb);
......
......@@ -2288,7 +2288,7 @@ static int mp_decode_frame(MPADecodeContext *s,
/* skip error protection field */
if (s->error_protection)
get_bits(&s->gb, 16);
skip_bits(&s->gb, 16);
dprintf(s->avctx, "frame %d:\n", s->frame_count);
switch(s->layer) {
......
......@@ -200,7 +200,7 @@ int rv_decode_dc(MpegEncContext *s, int n)
else
code = (int8_t)(get_bits(&s->gb, 8));
} else if (code == 0x7f) {
get_bits(&s->gb, 11);
skip_bits(&s->gb, 11);
code = 1;
}
} else {
......@@ -216,7 +216,7 @@ int rv_decode_dc(MpegEncContext *s, int n)
} else if (code == 0x1fd) {
code = -128 + get_bits(&s->gb, 7);
} else if (code == 0x1fe) {
get_bits(&s->gb, 9);
skip_bits(&s->gb, 9);
code = 1;
} else {
av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n");
......
......@@ -299,7 +299,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
}
}
init_get_bits(&s->gb, buf, buf_size*8);
get_bits(&s->gb, s->bitindex);
skip_bits(&s->gb, s->bitindex);
if (!s->blocksize)
{
int maxnlpc = 0;
......
......@@ -201,7 +201,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
if(get_bits1(gb)) {
smacker_decode_tree(gb, &tmp1, 0, 0);
get_bits1(gb);
skip_bits1(gb);
res = init_vlc(&vlc[0], SMKTREE_BITS, tmp1.length,
tmp1.lengths, sizeof(int), sizeof(int),
tmp1.bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
......@@ -214,7 +214,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
}
if(get_bits1(gb)){
smacker_decode_tree(gb, &tmp2, 0, 0);
get_bits1(gb);
skip_bits1(gb);
res = init_vlc(&vlc[1], SMKTREE_BITS, tmp2.length,
tmp2.lengths, sizeof(int), sizeof(int),
tmp2.bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
......@@ -250,7 +250,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
huff.values = av_mallocz(huff.length * sizeof(int));
smacker_decode_bigtree(gb, &huff, &ctx);
get_bits1(gb);
skip_bits1(gb);
if(ctx.last[0] == -1) ctx.last[0] = huff.current++;
if(ctx.last[1] == -1) ctx.last[1] = huff.current++;
if(ctx.last[2] == -1) ctx.last[2] = huff.current++;
......@@ -601,9 +601,9 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
h[i].bits = av_mallocz(256 * 4);
h[i].lengths = av_mallocz(256 * sizeof(int));
h[i].values = av_mallocz(256 * sizeof(int));
get_bits1(&gb);
skip_bits1(&gb);
smacker_decode_tree(&gb, &h[i], 0, 0);
get_bits1(&gb);
skip_bits1(&gb);
if(h[i].current > 1) {
res = init_vlc(&vlc[i], SMKTREE_BITS, h[i].length,
h[i].lengths, sizeof(int), sizeof(int),
......
......@@ -729,7 +729,7 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) {
}
for(j=0;j<mapping_setup->submaps;++j) {
get_bits(gb, 8); // FIXME check?
skip_bits(gb, 8); // FIXME check?
mapping_setup->submap_floor[j]=get_bits(gb, 8);
mapping_setup->submap_residue[j]=get_bits(gb, 8);
......
......@@ -780,7 +780,7 @@ static int wma_decode_superframe(AVCodecContext *avctx,
if (s->use_bit_reservoir) {
/* read super frame header */
get_bits(&s->gb, 4); /* super frame index */
skip_bits(&s->gb, 4); /* super frame index */
nb_frames = get_bits(&s->gb, 4) - 1;
bit_offset = get_bits(&s->gb, s->byte_offset_bits + 3);
......
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