Mercurial > libavcodec.hg
comparison h263dec.c @ 1548:dd544554ed42 libavcodec
AVRational
sample_aspect_ratio
aspect ratio in JPEG JFIF is SAR not DAR !
removed nonsense SAR guessing code
various related cleanups
bugs?
author | michael |
---|---|
date | Mon, 20 Oct 2003 20:23:46 +0000 |
parents | 576861d6343a |
children | 3d1d0490e5a6 |
comparison
equal
deleted
inserted
replaced
1547:0183874861fd | 1548:dd544554ed42 |
---|---|
391 uint8_t *buf, int buf_size) | 391 uint8_t *buf, int buf_size) |
392 { | 392 { |
393 MpegEncContext *s = avctx->priv_data; | 393 MpegEncContext *s = avctx->priv_data; |
394 int ret; | 394 int ret; |
395 AVFrame *pict = data; | 395 AVFrame *pict = data; |
396 float new_aspect; | |
397 | 396 |
398 #ifdef PRINT_FRAME_TIME | 397 #ifdef PRINT_FRAME_TIME |
399 uint64_t time= rdtsc(); | 398 uint64_t time= rdtsc(); |
400 #endif | 399 #endif |
401 #ifdef DEBUG | 400 #ifdef DEBUG |
600 | 599 |
601 /* After H263 & mpeg4 header decode we have the height, width,*/ | 600 /* After H263 & mpeg4 header decode we have the height, width,*/ |
602 /* and other parameters. So then we could init the picture */ | 601 /* and other parameters. So then we could init the picture */ |
603 /* FIXME: By the way H263 decoder is evolving it should have */ | 602 /* FIXME: By the way H263 decoder is evolving it should have */ |
604 /* an H263EncContext */ | 603 /* an H263EncContext */ |
605 if(s->aspected_height) | 604 |
606 new_aspect= s->aspected_width*s->width / (float)(s->height*s->aspected_height); | 605 if ( s->width != avctx->width || s->height != avctx->height) { |
607 else | |
608 new_aspect=0; | |
609 | |
610 if ( s->width != avctx->width || s->height != avctx->height | |
611 || ABS(new_aspect - avctx->aspect_ratio) > 0.001) { | |
612 /* H.263 could change picture size any time */ | 606 /* H.263 could change picture size any time */ |
613 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat | 607 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat |
614 s->parse_context.buffer=0; | 608 s->parse_context.buffer=0; |
615 MPV_common_end(s); | 609 MPV_common_end(s); |
616 s->parse_context= pc; | 610 s->parse_context= pc; |
617 } | 611 } |
618 if (!s->context_initialized) { | 612 if (!s->context_initialized) { |
619 avctx->width = s->width; | 613 avctx->width = s->width; |
620 avctx->height = s->height; | 614 avctx->height = s->height; |
621 avctx->aspect_ratio= new_aspect; | |
622 | 615 |
623 goto retry; | 616 goto retry; |
624 } | 617 } |
625 | 618 |
626 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)) | 619 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)) |