 |
|
 |
Posted: Tue Nov 01, 2005 11:23 am |
|
|
| Scott Larson |
|
|
| |
| Joined: 15 Oct 2003 |
| Posts: 713 |
| Location: Portland, OR |
|
|
 |
 |
 |
|
So this proof of concept didn't quite work all the time. It worked fine with 1080i stations with reduced bit rates (yeah, almost all of them these days). It had no problem keeping up with any film-source material and had no problem keeping up with SNL and Leno and the horse racing on NBC.
It totally failed with any 1080i video at full ATSC bitrate like CBS football (my affiliate turns off subchannels during sports). The problem was that the decode_video() call was taking too long processing all the data. XvMC speeds up the displaying of MPEG but it doesn't making processing MPEG-2 any faster (and there's a lot of stuff you have to do before XvMC can help you). Often decode_video() would take more than 1/60th of a second to finish which is too long for 59.97 fps. Once you add the flip_page and other overhead, it would get hopelessly out of sync with the audio and start dropping frames like crazy. Even though decode_video() was skipped every other time it looped (every frame contains both odd and even fields so the second field is already decoded), the time saved in the second loop doesn't help because every loop has to complete in 1/60th of a second otherwise the frames will display unevenly (mplayer doesn't like this). So I've found it's more reliable to run the loop at 29.97 fps and let flip_page() take a longer time displaying both fields with two XvMCPutSurface() calls than running the loop at 59.97 fps and hope that decode_video() will complete fast enough all the time.
I think the flip_page with the two XvMCPutSurface calls is taking lots of time because the second call is waiting for the first call to finish displaying the surface. It might be possible to use two separate surfaces so the calls won't have to share the same surface.
I also noticed that my system just barely keeps up with 720p at full ATSC bitrate. It usually drops a frame every three or four seconds. What keeps it going is that flip_page() (which calls XvMCPutSurface()) can display 1280x720 just fast enough to avoid trouble, while displaying one field of 1920x1080 takes about 50ms longer. Dropping a 720p frame is less noticable because it's just 1/60th of a second, a tiny blip. Dropping a 1080i frame takes out 1/30th of a second of video which is much more noticable. |
|
|
|
|
 |
 |
|
 |
Posted: Sun Nov 06, 2005 12:58 pm |
|
|
| dorphell |
|
|
| |
| Joined: 01 Feb 2005 |
| Posts: 71 |
|
|
|
 |
 |
 |
|
| Scott Larson wrote: | Ooops, I bet I put "torndr" in to debug something at some point. Above the flip_page function, put this line in:
| Code: | xvmc_render_state_t * torndr;
|
I think that will link to the global "torndr". If not lemme know.
|
I put it in libvo/vo_xvmc.c at the top of the file and now whenever I try to start mplayer with deinterlace on it dies right away.. are you forgetting something? |
|
|
|
|
Posted: Sun Nov 06, 2005 6:56 pm |
|
|
| Scott Larson |
|
|
| |
| Joined: 15 Oct 2003 |
| Posts: 713 |
| Location: Portland, OR |
|
|
 |
 |
 |
|
Instead of using torndr->display_flags, try getting rid of torndr and changing the if to use "p_render_surface->display_flags":
| Code: |
if (p_render_surface->display_flags) {
first_field = XVMC_TOP_FIELD;
second_field = XVMC_BOTTOM_FIELD;
} else {
first_field = XVMC_BOTTOM_FIELD;
second_field = XVMC_TOP_FIELD;
} |
|
|
|
|
|
Posted: Sun Nov 06, 2005 7:39 pm |
|
|
| dorphell |
|
|
| |
| Joined: 01 Feb 2005 |
| Posts: 71 |
|
|
|
 |
 |
 |
|
|
|
|
|
 |
 |
|
 |
Posted: Wed Dec 07, 2005 12:02 pm |
|
|
| Scott Larson |
|
|
| |
| Joined: 15 Oct 2003 |
| Posts: 713 |
| Location: Portland, OR |
|
|
 |
 |
 |
|
Here's an update on what I've been doing. Please note that these diff fragments might depend on changes I've made in header files and might not compile. If that's the case, let me know. I'm mostly illustrating changes, not posting a patch.
I'll review the basics here... the method of having put_xvmc_image() display both fields works, no doubt about it. While my Nvidia card is only using bob deinterlacing, it looks just as good as my cable STB (which probably also uses bob deinterlacing!). If you've ever seen smooth 1080i video, you know you want this.
The problem is that mplayer maintains A/V sync by dropping frames. With 720p this isn't a big deal because one missing 720p frame isn't too noticable. Dropping a 1080i frame on the other hand is actually dropping two fields -- much more ugly. It's also more likely to happen since displaying 1080i takes more CPU and the call to XvMCPutSurface() to display the second field will block until the next vertical refresh.
My idea of having the mplayer main loop run at 60 fps so it wouldn't be blocked when displaying the second field? Forget it. The mplayer main loop wasn't really designed to display fields and the overhead of spinning the loop twice as often was more than XvMCPutSurface() waiting for the vertical refresh, so I went back to handing the dirty work to put_xvmc_image().
The best method I found was to have the main mplayer loop tell put_xvmc_image() via an ugly global variable to skip displaying the second field when it needs to adjust the A/V sync. If the video continues to fall out of sync with the audio, it will start dropping entire frames. Here's the global in mplayer.c plus a new static variable to keep track of how many fields have been dropped:
| Code: | int verbose=0;
int identify=0;
int quiet=0;
+int field_dropping=0; /* drop second fields */ |
| Code: | static int total_time_usage_start=0;
static int total_frame_cnt=0;
static int drop_frame_cnt=0; // total number of dropped frames
+static int drop_field_cnt=0; // total number of dropped fields |
In the main loop, the original code starts dropping frames when the video is 1/10th of a second behind the audio. I changed this to drop fields when the video is 1/18th of second behind and frames when it's 1/20th behind (I've found that 1/10th dropped frames too often):
| Code: | // we should avoid dropping to many frames in sequence unless we
// are too late. and we allow 100ms A-V delay here:
- if(d<-dropped_frames*frame_time-0.100 && osd_function != OSD_PAUSE){
+ if (d<-dropped_frames*frame_time-0.180 && osd_function != OSD_PAUSE) {
+ field_dropping = 1;
+ ++drop_field_cnt;
+ } else
+ field_dropping = 0;
+ if(d<-dropped_frames*frame_time-0.200 && osd_function != OSD_PAUSE){
drop_frame=frame_dropping;
++drop_frame_cnt;
|
The correct way to do this without using a global variable (I think) would be to give decode_video() an option to mark a frame so that only one field will be displayed from it.
The code in libavcodec/xvmcvideo.c is almost what I had before. It passes which field is the top field as specified in the MPEG header but now it passes the interlaced flag from the header too. That means that mplayer will automatically turn on deinterlacing so you don't need to specify it on the command line:
| Code: | render->picture_structure = s->picture_structure;
render->flags = (s->first_field)? 0: XVMC_SECOND_FIELD;
+ render->display_flags = 0;
+ if (!s->progressive_frame) render->display_flags |= INTERLACED;
+ if (s->top_field_first) render->display_flags |= TOP_FIELD_FIRST; |
So in libvo/vo_xvmc.c, put_xvmc_image() now has these changes:
| Code: | if(benchmark)
return; +
+ if (p_render_surface->display_flags & INTERLACED) deinterlace = 1;
- rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
+ if (!deinterlace) {
+ rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
vo_window,
0, 0, image_width, image_height,
clipX, clipY, clipW, clipH,
3);//p_render_surface_to_show->display_flags);
+ } else {
+ unsigned int first_field, second_field;
+
+ if (p_render_surface->display_flags & TOP_FIELD_FIRST) {
+ first_field = XVMC_TOP_FIELD;
+ second_field = XVMC_BOTTOM_FIELD;
+ } else {
+ first_field = XVMC_BOTTOM_FIELD;
+ second_field = XVMC_TOP_FIELD;
+ }
+
+ rez = XvMCPutSurface(mDisplay, p_render_surface_to_show->p_surface,
+ vo_window, 0, 0, image_width, image_height,
+ clipX, clipY, clipW, clipH, first_field);
+
+ if (!field_dropping)
+ rez = XvMCPutSurface(mDisplay, p_render_surface_to_show->p_surface,
+ vo_window, 0, 0, image_width, image_height,
+ clipX, clipY, clipW, clipH, second_field | XVMC_SECOND_FIELD);
+ field_dropping = 0;
+ }
if(rez != Success){
printf("vo_xvmc: PutSurface failer, critical error %d!\n",rez);
assert(0);
|
Note that I'm now displaying the second field with the XVMC_SECOND_FIELD flag set. As far as I can tell, it doesn't do a damn thing but the API says I should do that.
I've been using this method for almost a month and it works excellently. It's still very dependent on system load and process scheduling so it might not work as well on some kernels. Dropping a field in 1080i to maintain A/V sync is actually more subtle than dropping a frame in 720p. I guess that's because the deinterlacing will cover up the missing field.
You can see the worst possible effects of bob deinterlacing by downloading this mpeg clip and playing it with XvMC turned on. Note how the upper band flickers like crazy? Then play it with Xv instead. No flicker. This might be an issue if you have a 1080p display but I rarely see any deinterlacing artifacts on my 768p display and my cable STB doesn't look any better. |
|
|
|
|
 |
 |
|
 |
Posted: Fri Aug 04, 2006 3:54 am |
|
|
| ubikdood |
|
|
| |
| Joined: 24 Jan 2006 |
| Posts: 18 |
|
|
|
 |
 |
 |
|
Hi Scott,
I've been looking for something like this for quite a while.
A simple "thank you" is not enough to express my gratitute to you for sharing your knowledge on such a hard subject.
Too bad we don't have more people trying to improve HDTV displaying in mplayer
Your changes for smooth interlace display were right on the spot.
The following is a patch to be applied on MPlayer-1.0pre8, with slight changes to avoid compilation errors and lirc detection on newer kernels.
Out of curiosity, what vertical display rate do you use to play 1080i streams bob-deinterlaced with your method ?
I can play 1080i bob-deinterlaced streams at 60 Hz, but CPU usage is near 100% when I use a GeForce FX 5500. If I increase the vertical display rate to 70 Hz, CPU usage gets low to around 30% (but bob is not so smooth ). This "CPU struggling" also happens when I play 720p streams (59.94 fps) using any "vanilla" mplayer (1.0pre7, 1.0pre8).
When I switch to a GeForce 6600 GT, CPU is around 40-75% (varies a lot).
Seems like an obscure "timing" issue. Geez...
Anyways, thanks again.
The patch follows, for anyone who's interested. I sure recommend it to anyone who needs deinterlacing.
Hugo
| Code: |
diff -rc MPlayer-1.0pre8/configure MPlayer-1.0pre8-SL/configure
*** MPlayer-1.0pre8/configure 2006-06-11 19:35:47.000000000 +0100
--- MPlayer-1.0pre8-SL/configure 2006-07-22 16:01:57.000000000 +0100
***************
*** 7318,7324 ****
echocheck "lirc"
if test "$_lirc" = auto ; then
_lirc=no
! if test -c /dev/lirc -o -c /dev/lirc/0 ; then
cat > $TMPC <<EOF
#include <lirc/lirc_client.h>
int main(void) { return 0; }
--- 7318,7324 ----
echocheck "lirc"
if test "$_lirc" = auto ; then
_lirc=no
! if test -c /dev/lirc -o -c /dev/lirc/0 -o -c /dev/lirc0 ; then
cat > $TMPC <<EOF
#include <lirc/lirc_client.h>
int main(void) { return 0; }
diff -rc MPlayer-1.0pre8/libavcodec/xvmcvideo.c MPlayer-1.0pre8-SL/libavcodec/xvmcvideo.c
*** MPlayer-1.0pre8/libavcodec/xvmcvideo.c 2006-06-11 19:35:48.000000000 +0100
--- MPlayer-1.0pre8-SL/libavcodec/xvmcvideo.c 2006-08-04 11:08:35.000000000 +0100
***************
*** 85,90 ****
--- 85,94 ----
render->picture_structure = s->picture_structure;
render->flags = (s->first_field)? 0: XVMC_SECOND_FIELD;
+ render->display_flags = 0;
+ if (!s->progressive_frame) render->display_flags |= INTERLACED;
+ if (s->top_field_first) render->display_flags |= TOP_FIELD_FIRST;
+
//make sure that all data is drawn by XVMC_end_frame
assert(render->filled_mv_blocks_num==0);
diff -rc MPlayer-1.0pre8/libvo/vo_xvmc.c MPlayer-1.0pre8-SL/libvo/vo_xvmc.c
*** MPlayer-1.0pre8/libvo/vo_xvmc.c 2006-06-11 19:35:43.000000000 +0100
--- MPlayer-1.0pre8-SL/libvo/vo_xvmc.c 2006-08-04 11:32:40.000000000 +0100
***************
*** 83,88 ****
--- 83,89 ----
static xvmc_render_state_t * show_queue[MAX_SURFACES];
static int free_element;
+ extern int field_dropping;
static void (*draw_osd_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
static void (*clear_osd_fnc)(int x0,int y0, int w,int h);
***************
*** 1013,1018 ****
--- 1014,1020 ----
static void put_xvmc_image(xvmc_render_state_t * p_render_surface, int draw_ck){
int rez;
int clipX,clipY,clipW,clipH;
+ int deinterlace = 0;
if(p_render_surface == NULL)
return;
***************
*** 1028,1038 ****
if(benchmark)
return;
! rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
! vo_window,
! 0, 0, image_width, image_height,
! clipX, clipY, clipW, clipH,
! 3);//p_render_surface_to_show->display_flags);
if(rez != Success){
printf("vo_xvmc: PutSurface failer, critical error %d!\n",rez);
assert(0);
--- 1030,1066 ----
if(benchmark)
return;
! if (p_render_surface->display_flags & INTERLACED) deinterlace = 1;
!
! if (!deinterlace) {
! rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
! vo_window,
! 0, 0, image_width, image_height,
! clipX, clipY, clipW, clipH,
! 3);//p_render_surface_to_show->display_flags);
! } else {
! unsigned int first_field, second_field;
!
! if (p_render_surface->display_flags & TOP_FIELD_FIRST) {
! first_field = XVMC_TOP_FIELD;
! second_field = XVMC_BOTTOM_FIELD;
! } else {
! first_field = XVMC_BOTTOM_FIELD;
! second_field = XVMC_TOP_FIELD;
! }
!
! rez = XvMCPutSurface(mDisplay, p_render_surface_to_show->p_surface,
! vo_window, 0, 0, image_width, image_height,
! clipX, clipY, clipW, clipH, first_field);
!
! if (!field_dropping)
! rez = XvMCPutSurface(mDisplay, p_render_surface_to_show->p_surface,
! vo_window, 0, 0, image_width, image_height,
! clipX, clipY, clipW, clipH, second_field | XVMC_SECOND_FIELD);
!
! field_dropping = 0;
! }
!
if(rez != Success){
printf("vo_xvmc: PutSurface failer, critical error %d!\n",rez);
assert(0);
diff -rc MPlayer-1.0pre8/loader/ldt_keeper.c MPlayer-1.0pre8-SL/loader/ldt_keeper.c
*** MPlayer-1.0pre8/loader/ldt_keeper.c 2006-06-11 19:35:46.000000000 +0100
--- MPlayer-1.0pre8-SL/loader/ldt_keeper.c 2006-07-07 12:44:00.000000000 +0100
***************
*** 33,39 ****
#include <asm/ldt.h>
// 2.5.xx+ calls this user_desc:
#include <linux/version.h>
! #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47)
#define modify_ldt_ldt_s user_desc
#endif
/* prototype it here, so we won't depend on kernel headers */
--- 33,39 ----
#include <asm/ldt.h>
// 2.5.xx+ calls this user_desc:
#include <linux/version.h>
! #if ( (LINUX_VERSION_CODE>=KERNEL_VERSION(2,5,47)) && LINUX_VERSION_CODE<KERNEL_VERSION(2,6,6) )
#define modify_ldt_ldt_s user_desc
#endif
/* prototype it here, so we won't depend on kernel headers */
diff -rc MPlayer-1.0pre8/mplayer.c MPlayer-1.0pre8-SL/mplayer.c
*** MPlayer-1.0pre8/mplayer.c 2006-06-11 19:35:47.000000000 +0100
--- MPlayer-1.0pre8-SL/mplayer.c 2006-08-04 11:19:14.000000000 +0100
***************
*** 91,96 ****
--- 91,97 ----
int player_idle_mode=0;
extern int verbose;
int quiet=0;
+ int field_dropping=0; /* drop second fields */
#ifdef WIN32
char * proc_priority=NULL;
***************
*** 214,219 ****
--- 215,221 ----
static int total_time_usage_start=0;
static int total_frame_cnt=0;
static int drop_frame_cnt=0; // total number of dropped frames
+ static int drop_field_cnt=0; // total number of dropped fields
int benchmark=0;
// options:
***************
*** 3706,3712 ****
float d=delay-sh_audio->delay;
// we should avoid dropping too many frames in sequence unless we
// are too late. and we allow 100ms A-V delay here:
! if(d<-dropped_frames*frame_time-0.100 && osd_function != OSD_PAUSE){
drop_frame=frame_dropping;
++drop_frame_cnt;
++dropped_frames;
--- 3708,3720 ----
float d=delay-sh_audio->delay;
// we should avoid dropping too many frames in sequence unless we
// are too late. and we allow 100ms A-V delay here:
! if (d<-dropped_frames*frame_time-0.180 && osd_function != OSD_PAUSE) {
! field_dropping = 1;
! ++drop_field_cnt;
! } else
! field_dropping = 0;
!
! if(d<-dropped_frames*frame_time-0.200 && osd_function != OSD_PAUSE){
drop_frame=frame_dropping;
++drop_frame_cnt;
++dropped_frames;
diff -rc MPlayer-1.0pre8/xvmc_render.h MPlayer-1.0pre8-SL/xvmc_render.h
*** MPlayer-1.0pre8/xvmc_render.h 2006-06-11 19:35:47.000000000 +0100
--- MPlayer-1.0pre8-SL/xvmc_render.h 2006-08-04 11:19:41.000000000 +0100
***************
*** 15,20 ****
--- 15,24 ----
// 1337 IDCT MCo
#define MP_XVMC_RENDER_MAGIC 0x1DC711C0
+ // Display flags
+ #define TOP_FIELD_FIRST 1
+ #define INTERLACED 2
+
typedef struct{
//these are not changed by decoder!
int magic;
|
UPDATE:
After further examination I noticed that the high cpu usage comes from X itself. I'm using xorg 6.8.2, but will now try different xorg versions and different nvidia driver versions. If I eventually find a solution or workaround for this, I'll post it here. |
|
Last edited by ubikdood on Sun Aug 13, 2006 8:54 am; edited 1 time in total |
|
|
|
 |
 |
|
 |
Posted: Tue Aug 08, 2006 4:46 pm |
|
|
| Scott Larson |
|
|
| |
| Joined: 15 Oct 2003 |
| Posts: 713 |
| Location: Portland, OR |
|
|
 |
 |
 |
|
| ubikdood wrote: | Hi Scott,
I've been looking for something like this for quite a while.
A simple "thank you" is not enough to express my gratitute to you for sharing your knowledge on such a hard subject.
Too bad we don't have more people trying to improve HDTV displaying in mplayer  |
Someone implemented this same method to mplayer a couple of months ago. It should be in their svn repository. The only feature that implementation didn't have is field dropping so that code has to throw away an entire frame if the video gets behind. With my code, it can skip displaying the second fields of frames to catch up which looks more subtle than throwing away entire frames.
| Quote: | | Out of curiosity, what vertical display rate do you use to play 1080i streams bob-deinterlaced with your method ? |
My monitor is 60 Hz.
| Quote: | I can play 1080i bob-deinterlaced streams at 60 Hz, but CPU usage is near 100% when I use a GeForce FX 5500. If I increase the vertical display rate to 70 Hz, CPU usage gets low to around 30% (but bob is not so smooth ). |
I think you may be skipping frames in this mode. Remember that the second field display waits for the vertical refresh so if you're trying to display 60 fields on a 70Hz display, something has to go wrong eventually.
| Quote: | This "CPU struggling" also happens when I play 720p streams (59.94 fps) using any "vanilla" mplayer (1.0pre7, 1.0pre8).
When I switch to a GeForce 6600 GT, CPU is aroun to 40-75% (varies a lot). |
I'm using an old FX5200 and I don't see more than 50% CPU using on the highest 1080i bitrate streams. Were you using the same driver? I'm stuck using an old old OLD Nvidia driver since it's the only one that will work with my 1366x768 display and I've noticed it spends a lot of time waiting in spinlocks. They've probably improved that in recent drivers. |
|
|
|
|
 |
 |
|
 |
Posted: Fri Aug 11, 2006 1:28 pm |
|
|
| ubikdood |
|
|
| |
| Joined: 24 Jan 2006 |
| Posts: 18 |
|
|
|
 |
 |
 |
|
| Scott Larson wrote: |
Someone implemented this same method to mplayer a couple of months ago. It should be in their svn repository. The only feature that implementation didn't have is field dropping so that code has to throw away an entire frame if the video gets behind. With my code, it can skip displaying the second fields of frames to catch up which looks more subtle than throwing away entire frames.
|
Last time I checked the mplayer's svn repository was 2 weeks ago.
The algorithm being used is the same as always (one PutSurface only).
| Quote: | | My monitor is 60 Hz. |
Okay. I tried 60 Hz and also 59.94 Hz. Seems that around these rates, some kind of race occurs in the system. Maybe it's something between Xorg and the nVidia's driver, I don't know. Perhaps it's yet another loop (with no delay in it) pooling on the status of something.
Also tried using Xorg 7.0, but this problem was still there. What I can see is that X is dragging a lot of CPU.
Since I wanted to stop this pooling madness, here's what I did to fix what seems to be a waste of CPU cycles : insert a sleep(x) in check_events (called before flipping page), where x can be something in the range of 10000 to 12000 microseconds (specified as another -vo xvmc custom suboption, to make testing easier).
No frames or fields are dropped, as mplayer's field and frame counters (and my eyes) can tell, and the total CPU usage is now steadily at 40%. It's not perfect, since one can feel a slight "jump" in the motion every 10 seconds or so, but it's very good so far.
| Quote: | | I'm using an old FX5200 and I don't see more than 50% CPU using on the highest 1080i bitrate streams. Were you using the same driver? I'm stuck using an old old OLD Nvidia driver since it's the only one that will work with my 1366x768 display and I've noticed it spends a lot of time waiting in spinlocks. They've probably improved that in recent drivers. |
I'm using nvidia's 8762 (latest at this date). |
|
Last edited by ubikdood on Sun Aug 13, 2006 9:14 am; edited 1 time in total |
|
|
|
 |
 |
|
 |
Posted: Sun Aug 13, 2006 4:09 am |
|
|
| Ryan |
|
|
| |
| Joined: 12 Aug 2006 |
| Posts: 3 |
|
|
|
 |
 |
 |
|
ubikdood: Using an Athlon XP 3000/400fsb with a Geforce 5900xt, and I don't get 100% cpu usage although I may be getting what you described with 720p if top isn't lying to me when I make it update more quickly.
BTW. your patch as posted doesn't apply cleanly thanks to the wonders of whitespace. Had to remove spaces from empty lines, add the odd extraneous space, and a hunk from mplayer.c actually needs a mix of tabs and spaces. :/ |
|
|
|
|
 |
 |
|
 |
Posted: Sun Aug 13, 2006 9:08 am |
|
|
| ubikdood |
|
|
| |
| Joined: 24 Jan 2006 |
| Posts: 18 |
|
|
|
 |
 |
 |
|
| Ryan wrote: | ubikdood: Using an Athlon XP 3000/400fsb with a Geforce 5900xt, and I don't get 100% cpu usage although I may be getting what you described with 720p if top isn't lying to me when I make it update more quickly.
|
If you're really using a display at 59.94 or 60Hz and you're using the above patch and you're not getting 100% cpu with 1080i streams then you should consider youself lucky.
The problem arises with 720p because those streams have 59.94 fps, instead of 29.97 fps in 1080i. It seems that the closer the movie's fps gets to the vertical refresh rate, the worst.
| Ryan wrote: |
BTW. your patch as posted doesn't apply cleanly thanks to the wonders of whitespace. Had to remove spaces from empty lines, add the odd extraneous space, and a hunk from mplayer.c actually needs a mix of tabs and spaces. :/
|
Argh! That's what I feared before posting the patch. Too bad this forum does not support attachments. I guess posting patches using text inside html is not a good idea. |
|
|
|
|
 |
 |
|
 |
Posted: Sun Aug 13, 2006 8:57 pm |
|
|
| Ryan |
|
|
| |
| Joined: 12 Aug 2006 |
| Posts: 3 |
|
|
|
 |
 |
 |
|
| I use an LCD monitor that's set at 60 Hz, so I SHOULD be affected by whatever it is you're seeing. |
|
|
|
|
 |
 |
|
 |
Posted: Sun Aug 13, 2006 9:18 pm |
|
|
| Scott Larson |
|
|
| |
| Joined: 15 Oct 2003 |
| Posts: 713 |
| Location: Portland, OR |
|
|
 |
 |
 |
|
If the sleep helps things that perhaps the driver does an active wait on the vertical refresh. I know my old version of the driver doesn't do that but who knows what crazy things Nvidia is doing with their drivers these days.
You're correct that these changes haven't been accepted by the mplayer folks yet. The maintainer of this code has been having discussions with author about details of the changes and it's been going back and forth for weeks. He believes the code to set the first_field and top_field_first flags are too complicated thus there must be "a simpler way." He has no suggestions on what that simpler way might be but perhaps he's communicated this to the author in more detail.
He's also not convinced that the second XvMCPutSurface() is doing anything even though anyone who has applied this code can easily see the frame rate doubling and both fields being displayed deinterlaced properly. It's hard to convince someone who has never seen it.
He suggested that they rewrite mplayer to loop at double the frame rate to support software deinterlacing too. I thought he actually tried this once and the code was rejected. It's an interesting idea but it would require a lot of recoding and adds a lot of overhead which is wasted in XvMC because the frame with the second field is already sitting there waiting to be displayed after the first field is displayed. It would allow the code to treat field-dropping as the same as frame-dropping but I've found it's better to treat them differently. My code starts dropping fields if the video gets slightly behind the audio (dropping fields is barely visible) and only drops complete frames if the field-dropping doesn't sync things up again.
I'd like to thank Tomas Janousek for submitting these changes to the mplayer development list. I would never have the patience to deal with the incomplete and hypothetical requests they're asking of him to get this change accepted!  |
|
|
|
|
 |
 |
|
 |
Posted: Mon Aug 14, 2006 4:34 am |
|
|
| ubikdood |
|
|
| |
| Joined: 24 Jan 2006 |
| Posts: 18 |
|
|
|
 |
 |
 |
|
| Ryan wrote: | | I use an LCD monitor that's set at 60 Hz, so I SHOULD be affected by whatever it is you're seeing. |
Meanwhile, I did some further testing on this issue.
Reproducing this is not trivial.
Using either a FX 5500 or a FX 5200 I can see the CPU top at 100%, but as the clip moves forward a few minutes, cpu usage may progressively lower to 50%, then suddenly go up to 100%. The graph on gkrellm is something like this bad ascii art:
|\|\|\ (a saw-tooth).
I observed this in two different motherboards, one nForce2 with an Athlon 3200 and the other using a Via KT800 with an Athlon 64 3700.
When using a 6600 GT the cpu usage varies from 50% to 75%. The graph shape can be anything.
I need to test this with more interlaced sources. |
|
|
|
|
 |
 |
|
 |
Posted: Mon Aug 14, 2006 4:44 am |
|
|
| ubikdood |
|
|
| |
| Joined: 24 Jan 2006 |
| Posts: 18 |
|
|
|
 |
 |
 |
|
| Scott Larson wrote: | If the sleep helps things that perhaps the driver does an active wait on the vertical refresh. I know my old version of the driver doesn't do that but who knows what crazy things Nvidia is doing with their drivers these days.
|
I'm willing to try your old version. Please tell me which one you're using.
And your 60Hz Modeline could also be handy for my tests (even being a 1366x768 one).
| Scott Larson wrote: |
He's also not convinced that the second XvMCPutSurface() is doing anything even though anyone who has applied this code can easily see the frame rate doubling and both fields being displayed deinterlaced properly. It's hard to convince someone who has never seen it.
|
Agree. SDTV interlaced sources are rare.
| Scott Larson wrote: |
He suggested that they rewrite mplayer to loop at double the frame rate to support software deinterlacing too. |
I thought mplayer already supported this. See : -vf tfields
EDIT:
| Scott Larson wrote: |
I'd like to thank Tomas Janousek for submitting these changes to the mplayer development list. I would never have the patience to deal with the incomplete and hypothetical requests they're asking of him to get this change accepted!
|
I just read the thread at mplayer-dev-eng...
IMHO, the maintainer of the code should have a minimum level of knowledge over general aspects of the software and, therefore, should provide us an indication of where changes should be done in order to achieve our goal in a "simpler" way.
*sigh* And that's all I have to say, otherwise I'm being negative and that won't help us. (google could catch my words easily) |
|
|
|
|
 |
 |
|
 |
Posted: Mon Aug 14, 2006 1:09 pm |
|
|
| Scott Larson |
|
|
| |
| Joined: 15 Oct 2003 |
| Posts: 713 |
| Location: Portland, OR |
|
|
 |
 |
 |
|
| ubikdood wrote: | I'm willing to try your old version. Please tell me which one you're using.
And your 60Hz Modeline could also be handy for my tests (even being a 1366x768 one). |
I'm using version 4496 from way back in 2003. I've never been able to get any other version to work. I'll load the new driver, my display will say "unsupported resolution" or something. I'll go back to 4496 and everything's fine.
The modeline is:
1368x768_60.00" 85.86 1368 1440 1584 1800 768 769 772 795 -HSync +Vsync
| Quote: | | Agree. SDTV interlaced sources are rare. |
And I get the impression that they're focused on playing movies, not video or content from interlaced sources.
| Quote: | | I thought mplayer already supported this. See : -vf tfields |
Well mplayer supports lots of things from the command line. I think he may have been talking about making mplayer do this by default for truly interlaced content but it's not clear.
| Quote: | I just read the thread at mplayer-dev-eng...
IMHO, the maintainer of the code should have a minimum level of knowledge over general aspects of the software and, therefore, should provide us an indication of where changes should be done in order to achieve our goal in a "simpler" way.
*sigh* And that's all I have to say, otherwise I'm being negative and that won't help us. (google could catch my words easily) |
I'm hoping that there is some positive off-list communication taking place between the maintainer and the developer otherwise I don't expect this to go into mplayer anytime soon.
I'm regularly disappointed at how simple questions or moments of confusion on the list result in unprovoked insults. I work with lots of C applications programmers at work and at times they ask shockingly naive coding questions, but I'd rather have them ask a stupid question than do something wrong (which I've done myself of course). Insulting their knowledge doesn't promote a positive work environment and I don't think it encourages people to work on open source projects. |
|
|
|
|
 |
pcHDTV Forum Index -> General pcHDTV topics
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT - 7 Hours
Page 2 of 5
Goto page Previous 1, 2, 3, 4, 5 Next
|
|
|
|
|