Mercurial > hg > easaier-soundaccess
comparison sv/videoio/SDL_ffmpeg.cpp @ 169:269562a2b89c
- be sure we create a picture multiple of 4 when resizing,
- change interpolation from BI_CUBIC to FAST_BILINEAR to imporove speed.
author | lbarthelemy |
---|---|
date | Mon, 19 Nov 2007 16:11:02 +0000 |
parents | 2ac52ea3c1c4 |
children | caaddda5477c |
comparison
equal
deleted
inserted
replaced
168:00ab90498dcc | 169:269562a2b89c |
---|---|
609 // if new timestamp is from future, we proceed | 609 // if new timestamp is from future, we proceed |
610 // if(buf->timestamp >= SDL_ffmpegGetPosition(file)) | 610 // if(buf->timestamp >= SDL_ffmpegGetPosition(file)) |
611 // { | 611 // { |
612 int w=(int)(zoomFivan*320+0.5); | 612 int w=(int)(zoomFivan*320+0.5); |
613 int h=(int)(zoomFivan*240+0.5); | 613 int h=(int)(zoomFivan*240+0.5); |
614 | |
615 if ((w>file->vs[file->videoStream]->width)||(h>file->vs[file->videoStream]->height)){ | 614 if ((w>file->vs[file->videoStream]->width)||(h>file->vs[file->videoStream]->height)){ |
616 w=file->vs[file->videoStream]->width; | 615 w=file->vs[file->videoStream]->width; |
617 h=file->vs[file->videoStream]->height; | 616 h=file->vs[file->videoStream]->height; |
618 } | 617 } |
618 // Be sure we have a multiple of 4 | |
619 w &= 0xFFFFFFFC; | |
620 h &= 0xFFFFFFFC; | |
619 if (img_convert_ctx == NULL) { | 621 if (img_convert_ctx == NULL) { |
622 | |
620 img_convert_ctx = sws_getContext(file->vs[file->videoStream]->width, file->vs[file->videoStream]->height, | 623 img_convert_ctx = sws_getContext(file->vs[file->videoStream]->width, file->vs[file->videoStream]->height, |
621 ((AVCodecContext*)file->vs[file->videoStream]->_ffmpeg)->pix_fmt, | 624 ((AVCodecContext*)file->vs[file->videoStream]->_ffmpeg)->pix_fmt, |
622 w,h, | 625 w,h, |
623 file->vs[file->videoStream]->pixFmt, | 626 file->vs[file->videoStream]->pixFmt, |
624 sws_flags, NULL, NULL, NULL); | 627 SWS_FAST_BILINEAR, NULL, NULL, NULL); |
625 if (img_convert_ctx == NULL) { | 628 if (img_convert_ctx == NULL) { |
626 fprintf(stderr, "Cannot initialize the conversion context\n"); | 629 fprintf(stderr, "Cannot initialize the conversion context\n"); |
627 exit(1); | 630 exit(1); |
628 } | 631 } |
629 } | 632 } |