Re: 720p and 1080p video playback.
- From: Edwin Kwan <eykN05pAm@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 04 Jun 2008 16:35:41 -0700
Alessandro Angeli wrote:
From: "Edwin Kwan"
Overlay Mixer, I copied the data from IMediaSample's I
allocated myself using the default allocator to the
IMediaSample's given by Overlay Mixer using "memcpy()".
I found that this "memcpy()" actually IS the bottleneck.
On my rather old computer it takes about 20ms to copy one
720p frame (1280*720*1.5 bytes).
Define "default allocator", because there is no such thing.
What allocator are you using and where is the memory
allocated? If your source is in video memory, then memcpy()
is expected to be slow, otherwise copying 1.3MiB of system
memory should be very quick.
By "default allocator" I meant the object obtained from the following call:
CoCreateInstance(CLSID_MemoryAllocator, 0, CLSCTX_INPROC_SERVER,
IID_IMemAllocator, (void **) &result_alloc)
I suppose the memory offered by this allocator is regular RAM in the
process space. I also suspect the memory from Overlay Mixer's
allocator, which Overlay Mixer insists on using, is not regular RAM
because writing to that is so slow.
Is there a faster way to send frames to the Overlay
Mixer, or any other renderer? I was hoping that there
would be some DMA mechanism so that the transfer could
happen between the system RAM and the video card while
the CPU could continue to decode the next frame.
That is beyond your control. Just make sure your source is
in system memory, not video memory, and the drivers will
take care of the rest. Of course, if you really want to make
the data transfer asynchronous, you can execute it on a
different thread (but then the synchronization and
context-switching overhead may take longer than the copy
itself).
I have not dealt with DirectX or DirectShow before this
project, so please pardon my ignorance. Needing a
dual-core to play HD video files because we need one core
just doing the "memcpy()'s" doesn't sound very clever.
You need a lot of processing power to perform the decoding
and post-processing and multiple cores don't even help
unless the decoder is multi-threaded, which is not always
the case.
--
E-mail: Remove "N05pAm" from username. ISP is "comcast".
.
- Follow-Ups:
- Re: 720p and 1080p video playback.
- From: Alessandro Angeli
- Re: 720p and 1080p video playback.
- References:
- Re: 720p and 1080p video playback.
- From: Tim Roberts
- Re: 720p and 1080p video playback.
- From: joseph
- Re: 720p and 1080p video playback.
- From: Alessandro Angeli
- Re: 720p and 1080p video playback.
- From: Edwin Kwan
- Re: 720p and 1080p video playback.
- From: Alessandro Angeli
- Re: 720p and 1080p video playback.
- Prev by Date: Re: 720p and 1080p video playback.
- Next by Date: DVB/ATSC Sample Code
- Previous by thread: Re: 720p and 1080p video playback.
- Next by thread: Re: 720p and 1080p video playback.
- Index(es):
Relevant Pages
|