Mercurial > libavcodec.hg
comparison mimic.c @ 6652:1aa282868038 libavcodec
Rename vlc1 to vlc.
There is no vlc2, so there is no point in numbering it.
author | ramiro |
---|---|
date | Sat, 19 Apr 2008 12:28:32 +0000 |
parents | 48759bfbd073 |
children | 4421d9c976d0 |
comparison
equal
deleted
inserted
replaced
6651:abc8176ddf88 | 6652:1aa282868038 |
---|---|
47 DECLARE_ALIGNED_16(DCTELEM, dct_block[64]); | 47 DECLARE_ALIGNED_16(DCTELEM, dct_block[64]); |
48 | 48 |
49 GetBitContext gb; | 49 GetBitContext gb; |
50 ScanTable scantable; | 50 ScanTable scantable; |
51 DSPContext dsp; | 51 DSPContext dsp; |
52 VLC vlc1; | 52 VLC vlc; |
53 } MimicContext; | 53 } MimicContext; |
54 | 54 |
55 static const uint32_t huffcodes[] = { | 55 static const uint32_t huffcodes[] = { |
56 0x0000000a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | 56 0x0000000a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
57 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | 57 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
107 MimicContext *ctx = avctx->priv_data; | 107 MimicContext *ctx = avctx->priv_data; |
108 | 108 |
109 ctx->prev_index = 0; | 109 ctx->prev_index = 0; |
110 ctx->cur_index = 15; | 110 ctx->cur_index = 15; |
111 | 111 |
112 if(init_vlc(&ctx->vlc1, 8, sizeof(huffbits)/sizeof(huffbits[0]), | 112 if(init_vlc(&ctx->vlc, 8, sizeof(huffbits)/sizeof(huffbits[0]), |
113 huffbits, 1, 1, huffcodes, 4, 4, 0)) { | 113 huffbits, 1, 1, huffcodes, 4, 4, 0)) { |
114 av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n"); | 114 av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n"); |
115 return -1; | 115 return -1; |
116 } | 116 } |
117 dsputil_init(&ctx->dsp, avctx); | 117 dsputil_init(&ctx->dsp, avctx); |
169 for(pos = 1; pos < num_coeffs; pos++) { | 169 for(pos = 1; pos < num_coeffs; pos++) { |
170 uint32_t vlc, num_bits; | 170 uint32_t vlc, num_bits; |
171 int value; | 171 int value; |
172 int coeff; | 172 int coeff; |
173 | 173 |
174 vlc = get_vlc2(&ctx->gb, ctx->vlc1.table, ctx->vlc1.bits, 4); | 174 vlc = get_vlc2(&ctx->gb, ctx->vlc.table, ctx->vlc.bits, 4); |
175 if(!vlc) /* end-of-block code */ | 175 if(!vlc) /* end-of-block code */ |
176 return 1; | 176 return 1; |
177 if(vlc == -1) | 177 if(vlc == -1) |
178 return 0; | 178 return 0; |
179 | 179 |
378 | 378 |
379 av_free(ctx->swap_buf); | 379 av_free(ctx->swap_buf); |
380 for(i = 0; i < 16; i++) | 380 for(i = 0; i < 16; i++) |
381 if(ctx->buf_ptrs[i].data[0]) | 381 if(ctx->buf_ptrs[i].data[0]) |
382 avctx->release_buffer(avctx, &ctx->buf_ptrs[i]); | 382 avctx->release_buffer(avctx, &ctx->buf_ptrs[i]); |
383 free_vlc(&ctx->vlc1); | 383 free_vlc(&ctx->vlc); |
384 | 384 |
385 return 0; | 385 return 0; |
386 } | 386 } |
387 | 387 |
388 AVCodec mimic_decoder = { | 388 AVCodec mimic_decoder = { |