[MPlayer-dev-eng] [PATCH] vf_bmovl2, complete and documented

Jason Tackaberry tack at auc.ca
Wed Jan 14 03:38:26 CET 2004


Greetings all,

It has been several months since I first posted my initial bmovl2 patch
to the list for comments.  I've received much helpful feedback and
advice, and having made significant chances since the first post, I
submit this final patch for consideration of inclusion into MPlayer.

EXECUTIVE SUMMARY: WHAT IS VF_BMOVL2?

vf_bmovl2 is a video filter which reads bitmaps from a fifo and overlays
them onto the video.  It is, by and large, a ground-up rewrite of the
original bmovl video filter, written by Per Wigren.  It provides
significant enhancements over the original bmovl:

      * Is a superset of original bmovl in terms of functionality
        (however the protocol is different).
      * Allows an arbitrary number of images to be stored.  Data
        allocated is only as large as it needs to be, so when used as a
        bmovl replacement, memory consumption is lower.
      * MMX-optimized.  For non-MMX systems, bmovl2 still performs
        better than bmovl.
      * Can move images to different positions efficiently.  (Original
        bmovl required retransmitting the image bitmap over the fifo.)
      * Multiple commands can be atomized and performed between frames,
        allowing smooth transition effects, such as OSD output sliding
        and fading in from off-screen.
      * Works properly even when Mplayer is paused, allowing for a
        working menu system controlled by an external application.
      * Fixes a number of correctness issues.  (Blending computations
        are more accurate.)

WHY NOT JUST FIX BMOVL?

The original bmovl filter was designed around the concept of holding a
single image equal in resolution to the video frame.  Most operations
would have needed to be rewritten almost completely.  The result would
have been nearly the same as a rewrite anyway.

SCOPE OF IMPACT

This patch creates libmpcodecs/vf_bmovl2.c and updates vf.c and Makefile
to properly build and load the filter.  The man page is updated with a
brief description of what the filter does, and a reference to
DOCS/tech/vf_bmovl2.txt, where the full documentation is provided,
including a brief example.

In order to accommodate the requirement that bmovl2 respond while
MPlayer is paused, a small number of changes were made to mplayer.c.  (8
lines of code were affected: 6 added, 2 lines modified.)  Specifically,
during the pause loop, mplayer now invokes vf_bmovl2_pause_update().  
The largest impact to this code is that the timing within the pause loop
has been adjusted -- the usleep delay has been decreased from 20000 usec
to 5000 usec, and the time for mp_input_get_cmd() was decreased from 20
to 3.  This allows for bmovl2 transitions to remain smooth while
paused.  On the systems I tested (Athlon 1400, P3 800, P4 2.6), I have
not noticed any additional CPU usage incurred, or any other adverse
effects.

SO WHAT?

Several projects, such as Freevo and RVE, have expressed interest in
bmovl2's additional features.  Although bmovl2 has 35% more LOC than the
original bmovl, it provides much more functionality, significantly
faster operation on MMX-capable processors, and cleaner, more robust
code.  There is a concern about increasing bloat in MPlayer, the result
of feature creep, however vf_bmovl2 is a logical successor to vf_bmovl,
and, at a suitable time, vf_bmovl can be marked as deprecated and
eventually removed.

Let me know if any additional changes are needed.

Cheers,
Jason.

-- 
Jason Tackaberry  ::  tack at auc.ca  :: 705-949-2301 x330
Academic Computing Support Specialist
Information Technology Services
Algoma University College  ::  www.auc.ca
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mplayer-bmovl2-2004-01-13.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040113/8f2b7d90/attachment.txt>


More information about the MPlayer-dev-eng mailing list