Mercurial > libavcodec.hg
comparison mdec.c @ 7151:4b1c14a839a7 libavcodec
Remove commented-out code.
author | astrange |
---|---|
date | Fri, 27 Jun 2008 18:51:01 +0000 |
parents | 23f0a0b1b4f5 |
children | 7801d83ba2c8 |
comparison
equal
deleted
inserted
replaced
7150:23f0a0b1b4f5 | 7151:4b1c14a839a7 |
---|---|
28 */ | 28 */ |
29 | 29 |
30 #include "avcodec.h" | 30 #include "avcodec.h" |
31 #include "dsputil.h" | 31 #include "dsputil.h" |
32 #include "mpegvideo.h" | 32 #include "mpegvideo.h" |
33 | |
34 //#undef NDEBUG | |
35 //#include <assert.h> | |
36 | 33 |
37 typedef struct MDECContext{ | 34 typedef struct MDECContext{ |
38 AVCodecContext *avctx; | 35 AVCodecContext *avctx; |
39 DSPContext dsp; | 36 DSPContext dsp; |
40 AVFrame picture; | 37 AVFrame picture; |
88 break; | 85 break; |
89 } else if(level != 0) { | 86 } else if(level != 0) { |
90 i += run; | 87 i += run; |
91 j = scantable[i]; | 88 j = scantable[i]; |
92 level= (level*qscale*quant_matrix[j])>>3; | 89 level= (level*qscale*quant_matrix[j])>>3; |
93 // level= (level-1)|1; | |
94 level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1); | 90 level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1); |
95 LAST_SKIP_BITS(re, &a->gb, 1); | 91 LAST_SKIP_BITS(re, &a->gb, 1); |
96 } else { | 92 } else { |
97 /* escape */ | 93 /* escape */ |
98 run = SHOW_UBITS(re, &a->gb, 6)+1; LAST_SKIP_BITS(re, &a->gb, 6); | 94 run = SHOW_UBITS(re, &a->gb, 6)+1; LAST_SKIP_BITS(re, &a->gb, 6); |
190 | 186 |
191 a->last_dc[0]= | 187 a->last_dc[0]= |
192 a->last_dc[1]= | 188 a->last_dc[1]= |
193 a->last_dc[2]= 128; | 189 a->last_dc[2]= 128; |
194 | 190 |
195 // printf("qscale:%d (0x%X), version:%d (0x%X)\n", a->qscale, a->qscale, a->version, a->version); | |
196 | |
197 for(a->mb_x=0; a->mb_x<a->mb_width; a->mb_x++){ | 191 for(a->mb_x=0; a->mb_x<a->mb_width; a->mb_x++){ |
198 for(a->mb_y=0; a->mb_y<a->mb_height; a->mb_y++){ | 192 for(a->mb_y=0; a->mb_y<a->mb_height; a->mb_y++){ |
199 if( decode_mb(a, a->block) <0) | 193 if( decode_mb(a, a->block) <0) |
200 return -1; | 194 return -1; |
201 | 195 |
231 AVFrame *p= (AVFrame*)&a->picture; | 225 AVFrame *p= (AVFrame*)&a->picture; |
232 | 226 |
233 mdec_common_init(avctx); | 227 mdec_common_init(avctx); |
234 init_vlcs(); | 228 init_vlcs(); |
235 ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_zigzag_direct); | 229 ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_zigzag_direct); |
236 /* | 230 |
237 for(i=0; i<64; i++){ | |
238 int index= ff_zigzag_direct[i]; | |
239 a->intra_matrix[i]= 64*ff_mpeg1_default_intra_matrix[index] / a->inv_qscale; | |
240 } | |
241 */ | |
242 p->qstride= a->mb_width; | 231 p->qstride= a->mb_width; |
243 p->qscale_table= av_mallocz( p->qstride * a->mb_height); | 232 p->qscale_table= av_mallocz( p->qstride * a->mb_height); |
244 avctx->pix_fmt= PIX_FMT_YUV420P; | 233 avctx->pix_fmt= PIX_FMT_YUV420P; |
245 | 234 |
246 return 0; | 235 return 0; |