[MPlayer-dev-eng] A question about MPEG-2 XvMC

Cooper Yuan cooperyuan at gmail.com
Sat Jun 20 03:00:05 CEST 2009


No, actually I am going to develop a XvMC driver on a modern graphics card
which has a video enginee and corresponding to DXVA spec.
for example, if I use mplayer to playback a MPEG-II video clip. I shall use
following commands:
mplayer -vo xvmc -vc ffmpeg12mc MPEG2_FILE_NAME

so mplayer will send macroblock, coefficient data to driver, but coefficient
data are in raster-scan order, that means, there are many zero values in one
block. please see the attachment 1, driver should zig-zag the coefficient
data as attachment 2.
this conversion is a complicated and cpu consumption task. why we must
conver them from raster-scan order to zig-zag order is that hardware only
allow following 3 types according to DXVA specification.
‘00’ = Zig-zag scan         (MPEG-2 Figure 7-2),
‘01’ = Alternate-vertical        (MPEG-2 Figure 7-3),
‘10’ = Alternate-horizontal     (H.263 Figure I.2 Part a),

but when hardware gets these coefficient data, it will convert them back to
raster-scan order, so-called de-zigzag.

I want to say, the coefficient data go through raster-scan --> zig-zag -->
raster-scan. rarely redundant.

Am I right? is there improvement for MPEG-II XvMC acceleration on modern
graphics card?
at lease on my side, CPU occupation is 30% when playback MPEG-II with my
driver.

On Fri, Jun 12, 2009 at 5:57 PM, Ivan Kalvachev <ikalvachev at gmail.com>wrote:

>  On 6/2/09, Cooper Yuan <cooperyuan at gmail.com> wrote:
> > Hi,
> >
> > I have a question about MPEG-2 XvMC acceleration.
> > Current mainstream graphics cards are following microsoft DXVA
> > specification, that means, the IDCT coefficient data should be zig-zag
> order
> > before being sent to hardware.
> > If I use -vo xvmc, does mplayer will pack IDCT coefficient data to
> zig-zag
> > order and then send them to driver?
> >
> > After review mplayer code, especially vo_xvmc.c, I can't find the
> function
> > which convert raster scan order to zig-zag order. it seems Mplayer send
> > raster scan order IDCT data to driver.
> >
> > so anyone can do me a favor to tell me it's who converts the IDCT
> > coefficient data's order?
>
> Not sure what you mean by zig-zag order.
> The code that does the coefficient decoding is in ffmpeg/libavcodec
> afair coefficients are placed in their respective position
> needed for simple matrix IDCT.
> (aka de-zigzag is done while reading the coefficients from the bitstream).
> Keeping them in the bitstream order, means that you'd have to pass the type
> of zig-zag to the IDCT routine.
>
> I hardly think that DXVA is relevant to the hardware implementations
> of the card.
> Are you trying to do XvMC emulation on windows using DXVA?
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.jpg
Type: image/jpeg
Size: 10950 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090620/1ab2ada5/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.jpg
Type: image/jpeg
Size: 4363 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090620/1ab2ada5/attachment-0001.jpg>


More information about the MPlayer-dev-eng mailing list