XBMC and CoreAVC (not yet)

January 8th, 2009
  • in middle of april alan nisota released two patches, which allows to use the coreavc directshow in mplayer:
    * mplayer mailinglist. patch for coreavc 0.0.4 (http://archives.free.net.ph/message/20060331.210050.da1641a9.en.html)
    * doom9 board. coreavc 1.0 (http://forum.doom9.org/showpost.php?p=813281&postcount=1114)

    like many people in the nero digital mpeg-4 avc / x264 support (http://www.xboxmediaplayer.de/cgi-bin/forums/ikonboard.pl?act=st;f=4;t=8555;st=120) thread i thought "hey that is perfect for the xbmc".
    so first, i build a custom mplayer.dll with the 0.0.4 patch applied and copied it onto the xbox.
    btw, please note that since i can't affort the 1.0 at the moment - i am quite broke - i do all the tests with the 0.0.4 which is probably illegal since it was only released for testing purposes.
    but it didn't work:
    xbmc.log (only some interesting lines)
    debug * msg:opening video decoder: [dshow] directshow video codecs
    debug loadlibrarya('coreavcdecoder.ax')
    error dll coreavcdecoder.ax was not found in path
    debug getmodulehandlea(kernel32.dll) .. looking up
    debug getmodulehandlea('kernel32.dll') => 0x6812b0
    warning unable to resolve: kernel32.dll flsalloc
    debug kernel32.dll!getprocaddress(0x6812b0, 'flsalloc') => 0x0
    :
    debug loadlibrary('coreavcdecoder.ax') returning: 0x8e07e0
    debug coreavcdecoder.ax!getprocaddress(0x8e07e0, 'dllgetclassobject') => 0x15a57d0
    debug * msg:decoder supports the following yuv formats:
    debug * msg:yuy2
    debug * msg:iyuv
    debug * msg:yv12
    debug * msg:i420
    debug * msg:decoder is capable of yuv output (flags 0x27)
    debug * msg:vdec: vo config request - 640 x 480 (preferred csp: packed yuy2)
    debug * msg:[pp] using codec's postprocessing, max q = 4.
    debug * msg:vdec: using planar yv12 as output csp (no 0)
    debug * msg:movie-aspect is undefined - no prescaling applied.
    debug * msg:vo: [directx] 640x480 => 640x480 planar yv12
    debug created yv12 texture 1
    debug created yv12 texture 0
    warning ol32.dll fake function cocreateinstance called
    error cmplayer::openfile() e:\media\video\[k-f]_one_piece_169_[e977a001].mp4 failed
    the xbmc dllloader were unable to resolve the following symbols:
    - flsalloc (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/flsalloc.asp)
    - flsgetvalue (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/flsgetvalue.asp)
    - flssetvalue (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/flssetvalue.asp)
    - flsfree (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/flsfree.asp)
    - encodepointer (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devnotes/winprog/encodepointer_func.asp)
    - decodepointer (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devnotes/winprog/decodepointer_func.asp)

    therefore, i added the missing functions to the kernel32.dll emulation (xbmc/xbmc/xbmc/cores/dllloader/exports) layer:
    xbm_exports-2006-04-28.zip (http://www.feedface.com/patrick/_tmpshare/xbm_exports-2006-04-28.zip)
    and a nice person in #xbmc build me a default.xbe with the modified files.
    debug: getmodulehandlea('kernel32.dll') => 0x8dda78
    debug: kernel32.dll!getprocaddress(0x8dda78, 'flsalloc') => 0x171674
    :
    error: cmplayer::openfile() e:\media\video\[k-f]_one_piece_169_[e977a001].mp4 failed

    unlike before, the xbmc was able to resolve the symbols, but still it did not work.

    so i guess i have to take a further look into the "cmplayer::openfile" methods...


  • coreavc codec produces about 5 to 10% improved performance in general of ffmpeg on standard xbox hardware.
    but i've have no intention on making it available to general users, since I don't feel like getting shit from corecodec when users start using pirated version of it. and this is final untill someone from corecodec tell me to go ahead and how to wish me to handle licencing information.

    not to mention the fact that a mplayer with coreavc support totally crashes xbmc when invalid or no licening info is available.


  • Thought it be interesting for you all to know that the MPlayer-developers are making good progress into implementing support for the DirectShow DLL binary version of CoreAVC into MPlayer. They are however heavily reconstructing the patch(es) so it make same a while before it makes it into MPlayer for Linux/Win32 (http://www.mplayerhq.hu), (and thus longer still before it can make it into XBMC's ported version of MPlayer, as the developers on Team-XBMC will probably not try to add it to XBMC until it has first made it into the CVS of MPlayer for Linux/Win32 (http://www.mplayerhq.hu)).

    They have also already done some benchmarks in which they decode some AVC videos to show the difference between the latest FFh264 (the MPEG-4-AVC H.264 decoder code in FFmpeg) are CoreAVC on MPlayer, and here are those result:These benchmark were done on a Linux computer with a Pentium-4 2.8GHz,
    (512K Level2 cache Intel Northwood CPU) with Hyper-Threading disabled.

    Each stream was benchmarked 3 times with the average result used
    (reproducibilty was very good)
    encoding was done using:
    mencoder -ovc x264 -oac mp3lame -vf scale=320x180 -srate 8000
    -lameopts cbr:br=48 -x264encopts xxxx

    decoding was done using:
    mplayer -vc coreavc/ffh264 -vo null -nosound -benchmark

    frame comparison was done using:
    mplayer -vc coreavc/ffh264 -vo md5sum -nosound
    every frame was different. I guess the next step would be to do a
    frame diff but let's do this one step at a time. The one thing I can
    say is that the output from CoreAVC looks very good.

    Note! CABAC / CAVLC, and loop filter / disabled loop filter was not tested!

    320x180_lo_no_b.avi: AVC: 1.6983 FFh264: 2.1397 Diff: 20.63%
    320x180_no_b.avi: AVC: 2.5720 FFh264: 3.6647 Diff: 29.82%
    320x180_2_b.avi: AVC: 3.0217 FFh264: 4.3490 Diff: 30.52%
    320x180_only_i.avi: AVC: 3.6400 FFh264: 5.5330 Diff: 34.21%

    640x360_lo_no_b.avi: AVC: 7.4727 FFh264: 9.0733 Diff: 17.64%
    640x360_no_b.avi: AVC: 11.6083 FFh264: 15.1547 Diff: 23.40%
    640x360_2_b.avi: AVC: 13.2737 FFh264: 17.6897 Diff: 24.96%
    640x360_only_i.avi: AVC: 13.9900 FFh264: 20.8660 Diff: 32.95%

    960x540_lo_no_b.avi: AVC: 16.3263 FFh264: 19.5637 Diff: 16.55%
    960x540_no_b.avi: AVC: 25.7600 FFh264: 34.7473 Diff: 25.86%
    960x540_2_b.avi: AVC: 29.5473 FFh264: 40.3160 Diff: 26.71%
    960x540_only_i.avi: AVC: 32.3753 FFh264: 47.0533 Diff: 31.19%

    1280x720_lo_no_b.avi: AVC: 28.5677 FFh264: 34.8783 Diff: 18.09%
    1280x720_no_b.avi: AVC: 46.9833 FFh264: 62.9510 Diff: 25.36%
    1280x720_2_b.avi: AVC: 51.2857 FFh264: 70.2810 Diff: 27.01%
    1280x720_only_i.avi: AVC: 56.2217 FFh264: 81.0200 Diff: 30.61%If the same 20-30% FPS speed increase also holds true for videos encoded with CABAC, CAVLC or LOOP (DEBLOCKING) then XBMC might be able to pull of decoding of 480p (720x480) H.264 AVC videos on the Xbox in the future, which would be great.

    However, those who thought they someday would see 720p (1280x720 progressive) or 1080i (1920x1080 interlanced) playback of H.264 AVC videos on the Xbox 733Mhz CPU will be disappointed by these results.


  • man, i'd love some coreavc in my xbmc... as efficient as coreavc is, it'd seem a marriage made in heaven with xbmc. keep up the good work guys!


  • I did not think of the SSE (Intel Pentium III), SSE2 (Intel Pentium 4), SSE3 (Intel Core) optimizations that CoreAVC must be using.

    So on the Xbox's 733Mhz Intel Pentium III processor CoreAVC might be able to produce what compared to FFmpeg?, 1 more FPS?


  • Yhere appears to be a lot of optimization possible for h264-video, and I guess(hope) they can make it even more efficient. I just hope it'll eventually get implemented as well as possible in xbmc. Anyways, I thought this was a core issue so I hope you won't stop trying to implement it.


  • Gamester always has some positive feedback. I'll jump on board a.s.a.p. :D


  • Maybe it would be possible to use the existing patch that allows the use of CoreAVC in mplayer linux.
    More info here:
    http://code.google.com/p/coreavc-for-linux/


  • dream on...


  • A bit OT, but is there an ETA on the next mplayer version? If it could help improve avc on xbox I'd say it's probably the only thing xbmc lacks.


  • you should also remember that the cpu in the xbox is ancient and that the coreavc devs does not focus on non-sse2 733mhz celerons with small l1/l2 caches.


  • When and if this gets ported to XBMC, will the Xbox be able to play 720p x264 encoded video?No!!! That has already been asked and answered earlier in this topic thread!!!
    CoreAVC decoder could probebely do 576p at best on an Xbox, (so 720x576).


  • yes, that is possible. but why do you want todo that?


  • Can this code help? ???

    Yesterday a new (updated) CoreAVC h264 codec patch was submitted to the MPlayer-dev-eng mailing-list (http://www.mplayerhq.hu/design7/mailing_lists.html) (that's the mailing-list for developer of MPlayer for Linux/Win32)Date: Mon, 2 Oct 2006 18:20:59 -0700
    From: "Alan Nisota"
    Subject: [MPlayer-dev-eng] [PATCH]Add support for CoreAVC h264 codec
    To: mplayer-dev-eng@mplayerhq.hu
    Cc: dbzdeath87@yahoo.com.au
    Message-ID:

    Content-Type: text/plain; charset="iso-8859-1"

    I posted a similar patch to the mplayer-cygwin list 6 months ago, but
    figured I might as well clean it up and post it here in case mplayer
    devs are interested in using it.

    What it does is to enhance the dshow codec support such that the
    CoreAVC h264 codec will run under mplayer. This codec is ~30% more
    efficient than ffh264 by my testing with mplayer.

    As this codec must be registered, it requires registry entries be
    present to use. I have added support for updating registry entries
    throgh the codecs.conf file to support this.

    There are changes to the wine code to support the codec, including
    some nasty tricks with the memory handler which may not be portable.

    There are also changes to the dshow filter code to pass correct data
    to the codec for intialization. These changes need to be tested to
    make sure they don't break other dshow codecs.

    Anyhow, the patch is built against SVN 20017.
    Install the patch, then add the following to your codecs.conf file:
    videocodec coreavc
    info "CoreAVC DShow H264 decoder for x86 - http://corecodec.org/"
    status untested
    format 0x10000005
    fourcc H264,h264
    fourcc X264,x264
    fourcc avc1,AVC1
    fourcc davc,DAVC
    fourcc VSSH
    driver dshow
    dll "CoreAVCDecoder.ax"
    regval "SOFTWARE\Licenturion GmbH\0000032D\Product Key"
    "ABCD-EFGH-IJKL-MNOP-QRST-UVWX"
    regval "SOFTWARE\Licenturion GmbH\0000032D\User ID" "Joe User"
    guid 0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c,
    0x7c, 0x31
    out YV12,IYUV,I420,YUY2

    (replace the User Id and Product Key with your registration
    key...which can be obtained via regedit or by installing under wine,
    and getting the values from the user.reg file)
    It has been tested with CoreAVC 0.0.4, 1.0, and 1.1.0.5
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: coreavc.patch
    Type: application/octet-stream
    Size: 21506 bytes
    Desc: not available
    Url :
    http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20061002/eee59c4b/coreavc.obj

    ------------------------------

    _______________________________________________
    MPlayer-dev-eng mailing list
    MPlayer-dev-eng@mplayerhq.hu
    http://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-engThe discussion can be followed here: [PATCH]Add support for CoreAVC h264 codec (link) (http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-October/thread.html#46422)


  • well that is a good thing :)

    easier to debug such stuff on windows than on the xbox.


  • would be nice if you posted a patch with the changes done, so would could atleast incorparate them in xbmc.. then if you don't work on it further somebody else might.

    on a sidenote, since the calling convention was wrong for that function, it is likely wrong for others we have too. would be nice to fixup.


  • no experiments or debugging today...
    but i just had a quick look at "c calling conventions". i always thought that the caller function handles the stack manipulation (esp) for the arguments, while the called function handles it for variables. but it seems that in some calling conventions, e.g. some win32 specific ones, where the called function is also responsible for the argument cleanup... more to follow.


  • and this is still without any hwacceleration whatsoever I take it ?


  • just another post to apreciate the effort. i guess i can't be of any help besides testing or something, so at least here's a cheer's up for all the trouble you are having. i'm very curious, if coreavc can be ported, to see how xbox handles some h264 encodes, both in avi and specially mkv that you see on some anime releases and so on.

    keep it up. :thumbsup:


  • thanks


  • i encourage to keep on working on this, i dont know how well the xbox will support the hd content, but i am highly anticipating the addition of coreavc. i dunno if this is legal to post here or not, but here is the link to 1.0.0

    pike edit: warez links are never legal

    both of those have it, the second link has the codecs seperated diffrently, but i think ull be able to figure it out.


  • While it's true that the Xbox CPU does not even have SSE2, nither did the entire Athlon XP series from AMD, like my 3200+ but CoreAVC still offers a signifigant improvement of like 25-30% on my Athlon. I think that we would still see a 25-30% increase of decoding efficency on the Xbox if CoreAVC could be wedged in.

    However I don't think this will 'Fix' the h.264 problem, merely make it less pronounced. There are cases where certian complicated h.264 480p encoded videos on the Xbox drop to about 1fps when decoding, a 30% increase in decoding speed would not eliminate these cases.


    Also, addressing something previously said in this thread about 720p and how the Xbox will never decode native 720p video sources. That's quite a lie. I've done it without dropping frames at all, you just have to use MPEG-2. :) Which, while you may laugh at it, we use XBMC to turn Xbox's into streaming video set top boxes taking feeds from a VLC server. The quality is quite nice when you considder that network bandwidth is cheaper than CPU power :)


  • http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2007-July/052959.html

    interesting :]


  • CoreAVC is faster significantly than FFmpeg at decoding H264, the guy who submitted the patches to MPlayer for it benchmarked it again recently (you can read about in "MPlayer-dev-eng" mailing-list (http://www.mplayerhq.hu/design7/mailing_lists.html)). Problem is that the code is not yet good enough to be accepted into MPlayer's SVN (http://www.mplayerhq.hu/design7/dload.html) and until it is it is not going to make it in to XBMC's SVN either.

    So if you guys want to see CoreAVC support in XBMC someday then you need to lobby it to the MPlayer developers (http://www.xboxmediacenter.com/wiki/index.php?title=Codec_and_Format_requests) first.
    http://www.xboxmediacenter.com/wiki/index.php?title=Codec_and_Format_requests
    http://code.google.com/p/coreavc-for-linux/


  • I could even accept a logo in order to have the much faster avccore in it.. but Betaboy doesn't seem like a very stand up guy exactly. I hope people would avoid buying their software, because what could he ever lose on letting his decoder run in xbmc? The gold should always be in the encoder.


  • Gamester17 schooled me good. I withdraw my previous statement.


  • As far as I know the developers of MPlayer (for Linux/UNIX/BSD/Win32) over at www.mplayerhq.hu (http://www.mplayerhq.hu) haven't even gotten the CoreAVC DLL's to with with their latest SVN tree, ...and until they do I don't see it comming to XBMC, (as XBMC 'only' uses a ported version of it). So I think you have to ask/lobby them to add support to it in their SVN before we can add it to XBMC.

    Please read this on how to do and what to expect when making a codec and format requests (link) (http://www.xboxmediacenter.com/wiki/index.php?title=Codec_and_Format_requests) :nerd:


  • here you go: patch & log (http://www.feedface.com/patrick/_tmpshare/xbmc_coreavc-2006-05-26.tar.bz2)
    the included "mplayer.patch" contains alan nisota's as well as my (small) changes.

    unlike before, xbmc now crashes - so it seems - within the coreavc decoder and not in mplayer. this makes debugging even more horrible.


  • just a though based on that log file...

    unable to resolve: kernel32.dll decodepointer
    kernel32.dll!getprocaddress(0x1113968, 'decodepointer') => 0x0

    same with encodepointer.. that could easily lead to an exception if it tries to do something on that pointer..

    will add the xbmc changes later this week (including enc/dec pointer) the mplayer changes are still abit too much hackish to put in cvs.


  • elupus, then how about doing something similar to what GogoAckman did with the fba-xxx emulator. Instead of including the latest drivers, he made a batch document that'd do the patching for us and allow us to play these latter games. Maybe you can do something similar and create a batch document, where it'd register an entry for coreavc to be useable on the xbmc. Betaboy then can't do anything to you, because you only create a leeway. You can also refer to emulation, where developers only applies the emulator, but not the actual rom/isos :grin:


  • its not, 90% of coreavc's speed comes from its multithreading (i.e. ability to use multiple cores..)


  • continuation ... seems the post above was to long...
    so what happens? coreavcdecoder.ax calls "dllcocreateinstance" and this calls "mplayer_memalloc(..)" if coreavc requests the allocator, what it does:debug: * msg: memallocator_createallocator(...) called
    debug: * msg: memallocatorcreate() called -> 01229010
    error: cmplayer::openfile() e:\media\video\[k-f]_one_piece_169_[e977a001]___hd.mp4 failed
    but it still doesn't work :sniffle: guess i'll add some additional debug messages to the mplayer.dll as i have no windows pc -> no debugging on the xbox.


  • ok, i did some additional - unsuccessful - tests...

    the mplayer from the xbmc-cvs still works in windows. all you got to do is to remove the "ad_aiffpcm.c" from libmpcodecs/makefile. the just run "configure" - without "-d_xbox", etc.. while this build plays h264 files using ffmpeg, it crashs with coreavc :-(


  • ^-- no longer necessary to answer this post, but i am still curious how mplayer would call an xbmc method...

    mplayer:loader/dshow/allocator.c- static long memallocator_createallocator(guid* clsid, const guid* iid, void** ppv)
    + long memallocator_createallocator(guid* clsid, const guid* iid, void** ppv)
    {
    *:
    + *debug printf("memallocator_createallocator(...) called\n");
    mplayer:mplayer.def+ memallocator_createallocator @ 65;
    xbmc:xbmc/xbmc/cores/mplayer/mplayer.cpp:+ long (__cdecl* pmemallocatorcreateallocator)(void* clsid, const void* iid, void** ppv);
    + * long mplayer_memallocator_createallocator(void* clsid, const void* iid, void** ppv)
    + *{
    + * *if (pmemallocatorcreateallocator)
    + * * *return pmemallocatorcreateallocator(clsid, iid, ppv);
    + * *return -1;
    + *}
    + *dll.resolveexport("memallocator_createallocator", (void**)&pmemallocatorcreateallocator);
    xbmc:xbmc/xbmc/cores/dllloader/exports/emu_ole32.cpp+ #include <guiddef.h>
    + #include "..\..\mplayer\mplayer.h"

    + const guid clsid_memoryallocator={0x1e651cc0, 0xb199, 0x11d0,
    + * *{0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45}};

    - extern "c" hresult dllcocreateinstance( refclsid rclsid, lpunknown punkouter, dword dwclscontext, refiid riid)
    + extern "c" hresult dllcocreateinstance( refclsid rclsid, lpunknown punkouter, dword dwclscontext, refiid riid, lpvoid * ppv)
    {
    + *if (!memcmp((void*)&rclsid, (void*)&clsid_memoryallocator, sizeof(guid)))
    + * *return mplayer_memallocator_createallocator((void*)&rclsid, (void*)&riid, ppv);
    *return regdb_e_classnotreg;


  • My Dream... Offloading decoding on GPU resulting in true 720p decoding of HD content. Then replacing drive with a HD-DVD(/Bluray) drive playing back what the Xbox 360 can. Ofcourse all the menu code for DVD cannot be used. Now code must be implemented.
    The Xbox1 can live for many more years :)


  • the mplayer.dll contains a function (loader/dshow/allocator.c: memallocator_createallocator) which creates a memory-allocator. what i want to do is to pass the address of this function to an xbmc function called "registercomclass" (xbmc/cores/dllloader/exports/emu_ole32.cpp), store it in a variable and then call the mplayer-function at some later time.

    mplayer:allocator.c: int memallocator_createallocator(/*args*/) { /* .. do something */}
    registercomclass(&memallocator_createallocator);
    xbmc:emu_ole32.cpp:typedef int (*comfunction)(/*args*/);

    static comfunction func;
    void registercomclass(comfunction newfunc) {
    * func = newfunc;
    }
    void someotherfunction() {
    * func(/*args*/);
    }
    ((edit: couldn't resist ))

    mplayer * * * * * * * * * * * * * * * * *xbmc
    *| * * * * * * * * * * * * * * * * * * * *|
    *|---( registercomclass: * * * * * * )--->|
    *| * ( &memallocator_createallocator ) * *|
    *| * * * * * * * * * * * * * * * * * * * *|
    *|<--( memallocator_createallocator: )----|
    *| * ( /*args */ * * * * * * * * * * ) * *|


  • Lol


  • ravemax, pm me about the 1.0 version. ill supply you with the one i bought.


  • No post editing? Curious.

    Anyway, i've just found registry.dat in the mplayer codecs folder, think I will give this a try.


  • I recall loads of people complaining about how buggy CoreAVC is on Doom9 forums.
    Also, isnt development halted?


  • i think its better to wait after 2.0 release. Maybe then we can use mplayer pre8. That could help.

    Sollie.


  • so, there's nothing of new?


  • Bump, is there noone that can test the above request?


  • I'm the last post, but this is a big issue in xbmc. So I just want to know if there's any work on this at all anymore?


  • You guys are getting off-topic!


  • still trying.. i don't give up yet.
    i enabled the output of the directshow messages and compared the logs of the win32 and the xbox version:
    videodecoder::setextattr: registry failure only on win32, but it doesn't matter because it's for the old divx filter anyway.
    selected video codec: [coreavc] (..) only shows up on win32, while xbmc gives a cmplayer::openfile() (..) failed
    so what happens between those two lines? mplayer starts the decoder (ds_videodecoder_startinternal : memallocator_commit, cmediasample_create).
    what's weird is that all functions are called within "init_best_video_codec" - every quitting is accompanied by a log-message, e.g. "selected" like above. but their ain't a message on the xbox??

    [edit] forgot to mention that the logs are otherwise equal, e.g. the "filter-wiring" seems to be correct.

    [edit2] debug ol32.dll fake function cocreateinstance called <- forgot this one. message before the ".. failed".

    [edit3] hmm i just read microsofts cocreateinstance (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/html/7295a55b-12c7-4ed0-a7a4-9ecee16afdec.asp) documentation and it seems that its actually quite important. time to replace the "fake" with a real emulation.


  • @spiff, that is not entirely true; yes the CoreAVC decoder does support multi-threading for (much) faster decoding on a dual-core/CPU machine but CoreAVC will also run faster on a single-core/CPU machine (including non-HyperThreaded processors) than FFmpeg's own open source H.264 decoder. Remember that CoreAVC is a commersial codec from a development-house that have full access to the H.264 specification and paid employees that have spent a lot of time optimizing the CoreAVC code.

    @Diontae16, I think Nuka is wanting someone to to test/benchmark his samples on a Linux computer (a PC, not an Xbox) using MPlayer with an without this patch http://code.google.com/p/coreavc-for-linux/ and to stay true both test/benchmark when comparing to standard MPlayer you should test it all on a single-core/CPU machine (that does not even have Hyper-Threaded enabled).


  • i did some investigation in respects of cocreateinstance.

    i added some lines of code, which write the rclsid (class identifier) and the riid (interface identifier) passed to the -fake- cocreateinstance (dllloader/exports/emu_ole32.cpp) to the log.
    - rclsid = 1e651cc0, b199, 11d0 - 82 12 00 c0 4f c3 2c 45
    - riid * = 56a8689c, 0ad4, 11ce - b0 3a 00 20 af 0b a7 70
    just for curiosity, i disassembled coreavcdecoder.ax with ida and found the corresponding cocreateinstance call at address 10022dca. maybe this is useful later on.

    now to the interesting part: the rclsid/riid isn't a special class, but the normal memory-allocator:
    both are defined in "mplayer/loader/dshow/guids.c":
    - clsid_memoryallocator (rclsid)
    - iid_imemallocator (riid)

    so what's missing? borrow some code from "mplayer/loader/win32.c" to have a proper cocreateinstance emulation. plus maybe a call to "registercomclass", as found in "dshow/allocator.c".

    @elupus: do you think that "xobjbase.h" could be useful, or should i just "upgrade" emu_ole32.cpp?


  • I couldn't find any later info on this, but have you given up? Coreavc should be interesting for x264 on xbmc. Please, this is an important part, please don't give up!!!


  • I'm the last post, but this is a big issue in xbmc. So I just want to know if there's any work on this at all anymore?

    YES, if XBMC had HD capabilities, just imagine how much value and life our Xbox's would have!

    Keep up the good work devs.


  • awesome. i can help you out with testing if you like - i've got over a decade of experience testing software professionally and an interest in digital media.

    being able to do full pal resolution anamorphic encodes using high profile avc like in sharktooth's profiles really would be excellent.

    maybe we can get donations going to help you get the 1.0 license?


  • Nuka1195, are you looking for someone who has coreavc, I mean I do, but don't know how to use it on the xbox.


  • Would someone that is using this try some apple movie trailers at 480p. There is quite a difference in quality between high and 480p.

    Here are a couple links, you should download them first.

    http://movies.apple.com/movies/wb/300/300-tlr2_h480p.mov
    http://movies.apple.com/movies/rogue_pictures/balls_of_fury/balls_of_fury-tlr2_h480p.mov

    Some 480p play fine with DVD player, but these two drop frames bad with both mplayer and dvdplayer.

    Thank you


  • Now that a new mplayer.dll is being cooked, are there any news about CoreAVC decoder running on XBMC?

    What is the status on this issue?


  • it could potentially be usefull to use that header. if there is help to do the emulation in the xdk, please use that.. the xdk does have very much in common with normal windows.

    sound like you are on the right track thou. you probably need that allocator, as the mplayer we use expect that to exist in the system already since we try to behave as much as normal windows as possible. so the loader in our version of mplayer is pretty much disabled if i remember correctly.

    those stuff could be usefull if we want to add support for more directshow stuff for the dvdplayer for example


  • ravemax, plz continue to work on it!

    really want this for the xbox.


  • yes, i don't have it, just wondered if it was worth it.


  • My Dream, hd-dvd and bluyray hacked so we can backup our new hddvd and blueray disks. I will use divx or xvid at at least hr-hdtv resolution thats 960x540. xbmc plays wonderfully at this resolution...


  • so i finally was able to debug xbmc. did i mention that debugging mplayer is a "p... in the a.." because visual studio doesn't support the fstabs format?

    ok, last time i exported the "memallocate" function, which was successfully called from coreavcdecoder, but somehow it still didn't work.
    coreavcdecoder requesting the allocator-instance:0x10022dca *push 0x10048350; rcls-guid
    0x10022dcf *call cocreateinstance
    0x10022dd5 *retn
    what's happening is that the "retn" returns to "0x10048350" - an address in the data-segment, an exception is thrown and it is catched by cmplayer::openfile. why? the stack is messed up - the stack-pointer still points to the rcls-guid after the call, before the "retn". the "retn" fetchs the -wrong- return address from the stack and *boom*.

    thanks to elupus & pike for their help.


  • noticed something very odd too.. dllisprocessorfeaturepresent returns abit odd information.. it says that sse2 is available for example which it really isn't.. wich very much could crash coreavc.

    also abit funny, that extended memory operations is enabled (ie larger than 4gb ram :)


    somebody did a evil copy paste, will fixup later too


  • @any dev:
    i wonder if it possible to call an xbmc function from mplayer.dll - and if then how?


  • ravemax, i see you are devoting a lot of time to this. thanks, i really appreciate it. i'm sorry of not being able to help in any way. :)


  • some more info.. pro version is horribly ridden with gui dependencies it would seem. i'm assuming you are using the beta version. can't get it to load properly.. also has an evil hibit of using up thread local storage slots wich we don't track on dll load/unload..


  • So has anyone tried this? Given that there's a working patch for mplayer, what are the chances of it working against the XBMC SVN?

    I'm happy to spend this afternoon giving it a go, but I'd like to know if anyone's had any luck with the current code, or if it's at least technically possible, before I lay down $15 for a licence. The main stumbling block is the registry key, is there anything like this on the Xbox?


  • well, from one point of view, it's sad, because being CoreAVC the most efficient decoder out there, it would be our best shot at playing h264 files without problems on xbox. From another point of view, it's also good to know that maybe one day it will be possible....


  • When and if this gets ported to XBMC, will the Xbox be able to play 720p x264 encoded video?


  • after reading the calling conventions (http://www.google.com/url?sa=u&start=1&q=http://www.codeproject.com/cpp/calling_conventions_demystified.asp&e=9797) article at codeproject and looking at the disassembling again, i found the error: cocreateinstance has be "__stdcall" instead of "cdecl". so i added the "winapi" to "emu_ole32.cpp/.h". mplayer finally accepts the codec:
    msg: selected video codec: [coreavc] vfm:dshow (coreavc dshow h264 decoder for x86 - http://corecodec.org/)
    but it still doesn't work: playback has started
    msg: ds_videodecoder_decodeinternal(01411980,015207b0,1 472,0,01e36030)
    :
    *msg: cmediasample_getsize(013c7c70) called -> 460800
    mm: page fault touching 01ea7000, trap frame d04d067c, eip 01fea212
    first-chance exception at 0x01fea212 in xbmcd.xbe: 0xc0000005: access violation reading location 0x01ea7000.
    dsound: cmcpxstream::servicevoiceinterrupt: warning: the stream is starving
    not sure if i will waste any further time on a closed source product...


  • Izumi, Xbox/XBMC does 720p OAR MPEG4 (divx/xvid) just fine if digital audio decoding is used and/or plugh's xvid modifications are used. But you'll find that most CHD releases play without drops too - even streamed from a NAS/server. So there is no real reason for using MPEG2


  • I don't think that coreavc will be that much better than the mplayer.dll elupus currently has. The benefits of adding coreavc are not nearly as great now as they once were.


  • 90% of coreavc's speed comes from its multithreading (i.e. ability to use multiple cores..)OFF-TOPIC for XBMC for Xbox version, but ON-TOPIC only for XBMC for Linux port version:

    FYI; the very latest FFmpeg SVN (http://ffmpeg.mplayerhq.hu) (so not in the XBMC SVN yet!) now supports multi-threading decoding of H.264 (or to be more specific "slice-based parallel H.264 decoding") in order to to speed up H.264 decoding on multiple processors (CPUs). Though this will not help playing x264/h264 encoded video on the Xbox, it will help future versions of XBMC Linux port to better handle playback of such material (on dual-core and SMP computers). And this is just the first level in decoding parallelzation in FFmpeg (http://ffmpeg.mplayerhq.hu), bringing it one step closer to becoming up-to-par with the CoreAVC decoder.

    NOTE! Again, this does will not increase the decoding speed on the Xbox as the Xbox processor (CPU) only support one thread.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about XBMC and CoreAVC (not yet) , Please add it free.