Thread: mplayer vdpau
View Single Post
Old 11-26-08, 12:50 PM   #164
Registered User
Join Date: Aug 2004
Location: Portland, OR
Posts: 31
Default Re: mplayer vdpau

Originally Posted by AdamW View Post
Particularly the following response, from Reimar D÷ffinger:

"Too bad they based it (probably) on vo_xvmc which makes it a horribly bloated monster and quadruplicates the code (I think at least 70 lines are identically duplicated in vo_x11, vo_xv and vo_xvmc and possibly x11_common.c, too, of course all with minor differences and their wholly own set of bugs)."
I wouldn't take what some people on that list say too seriously. Many developers there value any clever technique that eliminates as many characters in the source code as possible regardless of how unreadable it makes the code. My favorite is their XvMCPutSurface code:

for (i = 1; i <= bob_deinterlace + 1; i++) {
   int field = top_field_first ? i : i ^ 3;
   rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface, 
                        0, 0, image_width, image_height,
                        clipX, clipY, clipW, clipH,
                        bob_deinterlace ? field : 3);
Of course this code makes rigid mathematical assumptions on what the correct values of the flags to XvMCPutSurface are (i ^ 3???) but at least it isn't "bloated" by defining them explicitly with screen-wasting hogs like "XVMC_TOP_FIELD" that might tell you what it's actually doing.
scowl is offline   Reply With Quote