[MPlayer-dev-eng] IMGTYPE's

Arpi arpi at thot.banki.hu
Sun Mar 3 19:57:27 CET 2002


Hi,

> 	Okay A'rpi, I'm getting a grip on this mp_image structure
> thing. Next, I want to implement a video decoder that outputs both YV12
> and has motion compensation. This tells me that I'm going to need this
> IMGTYPE:
> // I+P type, requires 2+ independent static R/W buffers
> #define MP_IMGTYPE_IP 3
yes

> And I trust that MPlayer will take care of allocating the 2 YUV frames
> for me to render to and swap between. I'm just not clear on how I access
yes

> both frames. There only seems to be 1 mp_image structure and it only
> provides for one video frame. Is this a case where the skeleton framework
> is in place, but not the underlying support code?
your code should save the pointer of previous frame.
so, let's make
mp_image_t* prev_image;

and use this in MC code. then, when you're done with next frame, replace
it's value with current image pointer.

> 	I thought you also mentioned something about how if I want to
> write a motion compensated decoder, that I should just add it directly to
> libavcodec?
yes. libavcodec is a well-desigend collection of DCT+MC codecs. there is
well optimized (thx to Michael and Nick) DCT, MC framework and everything
else you may need, including fast bitsteram handler etc.
You just have to implement the bitstream parser (VLC tables) and pass the
decoded MB data (dct block + MC vectors) to the core and it will render the
macroblock for you. I just can't see anys ense of duplicating many of
libavcodec code in mplayer and optimize them again...

When kabi asked about moving your RGB codecs (msvc, cvid, etc) to libavcodec,
I was the one saying NO, as libavcodec is not the right place for them.
But it is the BEST place for YV12 DCT+MC codecs to add.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list