Re: 720p and 1080p video playback.

Tech-Archive recommends: Fix windows errors by optimizing your registry



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".
.



Relevant Pages

  • Re: Critique on my solution for an exercise. (check if a date is valid)
    ... simplify anything, when done in Forth. ... N times the allocation of one fixed sized object through dynamic memory. ... Thus you rely on general memory allocator, which isn't written in Forth way ... scalability problems, which is bullshit. ...
    (comp.lang.forth)
  • Re: [PATCH] change gen_pool allocator to not touch managed memory
    ... The following patch modifies the gen_pool allocator to ... change is to eliminate the touching of the actual memory being allocated. ... + * Add a new chunk of memory to the specified pool. ... starting address of memory chunk to add to pool ...
    (Linux-Kernel)
  • [PATCH] [0/13] General DMA zone rework
    ... Traditionally it was designed only for ISA dma which is limited to ... On 32bit i386 with its limited virtual memory space the next zone is ... cannot actually be used for ISA or any other device with <32bit DMA mask. ... I chose to implement a new "maskable memory" allocator to solve these ...
    (Linux-Kernel)
  • Re: 720p and 1080p video playback.
    ... IMediaSample's given by Overlay Mixer using "memcpy". ... Define "default allocator", because there is no such thing. ... What allocator are you using and where is the memory ... If your source is in video memory, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: [RFC] genalloc != generic DEVICE memory allocator
    ... > Andrey> idea of which is a cute nice thing. ... > Keep in mind that genalloc was meant to be simple for basic memory ... generic allocator for both short-live strictly aligned blocks and ... So far I don't see any reason for changing to ...
    (Linux-Kernel)