Mercurial > libavcodec.hg
comparison mpeg12.c @ 1587:b69b086f5570 libavcodec
100l (SAR is written as height/width instead of width/height in the MPEG1 standard)
author | michael |
---|---|
date | Thu, 30 Oct 2003 19:55:44 +0000 |
parents | 628bf341e099 |
children | 932d306bf1dc |
comparison
equal
deleted
inserted
replaced
1586:3d1d0490e5a6 | 1587:b69b086f5570 |
---|---|
221 put_bits(&s->pb, 12, s->height); | 221 put_bits(&s->pb, 12, s->height); |
222 | 222 |
223 for(i=1; i<15; i++){ | 223 for(i=1; i<15; i++){ |
224 float error= aspect_ratio; | 224 float error= aspect_ratio; |
225 if(s->codec_id == CODEC_ID_MPEG1VIDEO || i <=1) | 225 if(s->codec_id == CODEC_ID_MPEG1VIDEO || i <=1) |
226 error-= mpeg1_aspect[i]; | 226 error-= 1.0/mpeg1_aspect[i]; |
227 else | 227 else |
228 error-= av_q2d(mpeg2_aspect[i])*s->height/s->width; | 228 error-= av_q2d(mpeg2_aspect[i])*s->height/s->width; |
229 | 229 |
230 error= ABS(error); | 230 error= ABS(error); |
231 | 231 |
2276 | 2276 |
2277 width = get_bits(&s->gb, 12); | 2277 width = get_bits(&s->gb, 12); |
2278 height = get_bits(&s->gb, 12); | 2278 height = get_bits(&s->gb, 12); |
2279 s->aspect_ratio_info= get_bits(&s->gb, 4); | 2279 s->aspect_ratio_info= get_bits(&s->gb, 4); |
2280 if(s->codec_id == CODEC_ID_MPEG1VIDEO){ | 2280 if(s->codec_id == CODEC_ID_MPEG1VIDEO){ |
2281 aspect= mpeg1_aspect[s->aspect_ratio_info]; | 2281 aspect= 1.0/mpeg1_aspect[s->aspect_ratio_info]; |
2282 if(aspect!=0.0) avctx->sample_aspect_ratio= av_d2q(aspect, 255); | 2282 if(aspect!=0.0) avctx->sample_aspect_ratio= av_d2q(aspect, 255); |
2283 } | 2283 } |
2284 | 2284 |
2285 s->frame_rate_index = get_bits(&s->gb, 4); | 2285 s->frame_rate_index = get_bits(&s->gb, 4); |
2286 if (s->frame_rate_index == 0) | 2286 if (s->frame_rate_index == 0) |