ABOUT LIBMPEG2 libmpeg2 is a free library for decoding mpeg-2 and mpeg-1 video streams. It is released under the terms of the GPL license. The main goals in libmpeg2 development are: * Conformance - libmpeg2 is able to decode all mpeg streams that conform to certain restrictions: "constrained parameters" for mpeg-1, and "main profile" for mpeg-2. In practice, this is what most people are using. For streams that follow these restrictions, we believe libmpeg2 is 100% conformant to the mpeg standards - and we have a pretty extensive test suite to check this. * Speed - there has been huge efforts there, and we believe libmpeg2 is the fastest library around for what it does. Please tell us if you find a faster one ! With typical video streams as found on DVD's, and doing only decoding with no display, you should be able to get about 110 fps on a PIII/666, or 150 fps on an Athlon/950. This is less than 20 cycles per output pixel. In a real player program, the display routines will probably take as much time as the actual decoding ! * Portability - most of the code is written in C, and when we use platform-specific optimizations (typically assembly routines, currently used for the motion compensation and the inverse cosine transform stages) we always have a generic C routine to fall back on. This should be portable to all architectures - at least we have heard reports from people running this code on x86, ppc, sparc, arm and sh4. Assembly-optimized implementations are available on x86 (MMX) and ppc (altivec) architectures. Ultrasparc (VIS) is probably the next on the list - we'll see. * Reuseability - we do not want libmpeg2 to include any project-specific code, but it should still include enough features to be used by very diverse projects. We are only starting to get there - the best way to help here is to give us some feedback ! The project homepage is at http://libmpeg2.sourceforge.net/ MPEG2DEC mpeg2dec is a test program for libmpeg2. It decodes mpeg-1 and mpeg-2 video streams, and also includes a demultiplexer for mpeg-1 and mpeg-2 program streams. It is purposely kept simple : it does not include features like reading files from a DVD, CSS, fullscreen output, navigation, etc... The main purpose of mpeg2dec is to have a simple test bed for libmpeg2. The libmpeg2 source code is always distributed in the mpeg2dec package, to make it easier for people to test it. The basic usage is to just type "mpeg2dec file" where file is a demultiplexed mpeg video file. The "-s" option must be used for multiplexed (audio and video) mpeg files using the "program stream" format. These files are usualy found on the internet or on unencrypted DVDs. The "-t" option must be used for multiplexed (audio and video) mpeg files using the "transport stream" format. These files are usualy found in digital TV applications. The "-o" option is used to select a given output module - for example to redirect the output to a file. This is also used for performance testing and conformance testing. The "-c" option is used to disable all optimizations. OTHER PROJECTS USING LIBMPEG2 libmpeg2 is being used by various other projects, including: * xine (http://xine.sourceforge.net/) - started as a simple mpeg-2 audio and video decoder, but it since became a full-featured DVD and video media player. * VideoLAN (http://www.videolan.org/) - video streaming over an ethernet network, can also be used as a standalone player. * MPlayer (http://www.MPlayerHQ.hu) - another good player, it is also very robust against damaged streams. * movietime (http://movietime.sourceforge.net/) - still quite young, but it looks very promising ! * mpeg2decX (http://homepage1.nifty.com/~toku/software_en.html) - a graphical interface for mpeg2dec for macintosh osX. * TCVP (http://tcvp.sf.net) - video and music player for unix. * drip (http://drip.sourceforge.net/) - a DVD to DIVX transcoder. * PoMP (http://www.dmclab.hanyang.ac.kr/research/project/PoDS/PoDS_sw.htm) - a research player optimized to minimize disk power consumption. * OMS (http://www.linuxvideo.org/oms/) * XMPS (http://xmps.sourceforge.net/) * GStreamer (http://www.gstreamer.net/) - a framework for streaming media; it has an mpeg2 decoding plugin based on libmpeg2. * mpeglib (http://mpeglib.sourceforge.net/) - a video decoding library that usess libmpeg2 when decoding mpeg streams. * daphne (http://daphne.rulecity.com/) - a laserdisc arcade game simulator. * GOPchop (http://outflux.net/unix/software/GOPchop/) - a GOP-accurate editor for MPEG2 streams. If you use libmpeg2 in another project, let us know ! TASKS There are several places where we could easily use some help: * Documentation: libmpeg2 still has no documentation. Every proj/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id: rbfont.cpp 27301 2010-07-05 22:15:17Z bieber $ * * Copyright (C) 2010 Robert Bieber * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #include "rbtext.h" #include <QPainter> RBText::RBText(QImage* image, int maxWidth, QGraphicsItem *parent) :QGraphicsItem(parent), image(image), maxWidth(maxWidth), offset(0) { } QRectF RBText::boundingRect() const { if(image->width() < maxWidth) return QRectF(0, 0, image->width(), image->height()); else return QRectF(0, 0, maxWidth, image->height()); } void RBText::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { /* Making sure the offset is within bounds */ if(image->width() > maxWidth) if(offset > image->width() - maxWidth) offset = image->width() - maxWidth; if(image->width() < maxWidth) painter->drawImage(0, 0, *image, 0, 0, image->width(), image->height()); else painter->drawImage(0, 0, *image, offset, 0, maxWidth, image->height()); }