[MPlayer-dev-eng] PATCH [0/12] CoreAVCDecoder support

Alan Nisota alannisota at gmail.com
Thu Feb 8 22:57:35 CET 2007

It has been a while, but I've been requested to post an updated set of 
patches for CoreAVC support.
This patch set adds support for the (non-free) CoreAVC Professional 
H.264/AVC1 codec.
It supports CoreAVC 0.0.4 - 1.2.0
Performance is much better than with the previous patches on multi-cpu 
systems, as I have enabled multi-CPU support, and CoreAVC is capable of 
taking advantage of it.
CoreAVC supports MBAFF, PAFF and PAFF+MBAFF (the latter 2 aren't 
supported at all by mplayer today)

I have tried to break the patches down as much as possible to keep 
functionality separate.
There was a lot of resistance to this last time around, and I expect no 
difference now, so mostly I'm just posting for posterity, though I'll be 
happy to clean up any issues people see.

apply all patches and make mplayer
build regedit with:
gcc -o regedit -I. loader/modify_reg.c

make sure you have CoreAVCDecoder.ax installed properly (normally to 
add registry entries for the codec:
For 1.2:
regedit -r ~/.mplayer/registry -k 
"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProductID" -v 
"<Product ID from Windows where registered>"
regedit -r ~/.mplayer/registry -k "HKCU\Software\CoreCodec\CoreAVC 
Pro\Serial" -v "<Serial number (from windows registry)>"
For 1.0-1.1:
regidit -r ~/.mplayer/registry -k "HKLM\\SOFTWARE\\Licenturion 
GmbH\\0000032D\\User ID" -v "<user id CoreAVC was registered with>"
regidit -r ~/.mplayer/registry -k "HKLM\\SOFTWARE\\Licenturion 
GmbH\\0000032D\\Product Key" -v "<product key (from windows registry)>"

Note that to my knowledge 1.2 must be registered on a real windows 
machine and then transfered, while 1.0-1.1 can be installed via Wine.

Add the following to codecs.conf:
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"
  guid 0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c, 
0x7c, 0x31
  out YV12,IYUV,I420,YUY2

It should be used automatically, but you can force it to work using '-vc 
coreavc' on the mplayer commandline.

Patch descriptions:
001mpg2fmt.patch: This adds support for sending the input format in a 
MPEG2Video header, which is required by CoreAVC for AVC1 decoding as it 
seem sto only support this format for retrieving the quantization coeffs.

002srcdestfmt.patch: Use YV12 as the output format, and ensure that a 
width/height are specified.  CoreAVC uses the width/height to allocate 
buffers at initialization apparently, so this can't be postponed until a 
final fmt is selected.

003dshowchkfmt.patch: This is just an optional patch which queries the 
input format of the codec before connecting.  It provides more info in 
the case that the filter fails to connect.

004avc1mov.patch: allow both 'avc1' and 'AVC1' streams to be processed

005pecompact2.patch: adds support for the PECompact2 dll compression 
tool.  We need to hook SIGSEGV because PECompact2 uses this to swap from 
the compressed to uncompressed image on the fly.

006cpu.patch: adds support for multiple CPUs.  It enables Semaphores and 
Mutexes to work properly as well.

007widereg.patch: adds support for Querying registry items as wide 
strings.  the strings are always stored as standard char strings, so it 
just converts back-and-forth

008newfunc.patch: adds several support for several new functions to 
win32.c  Note the 'UNDEFF' macro is used to prevent certain functions 
from being stubbed.  If they are, stubbed, the codec doesn't work properly.

009threaddisp.patch: an optional patch that shows the threadid in win32 
debug messages.  It also changes the return of CreateThread from a 
pointer to the pthread_t element to the element itself (making it easier 
to see which threads are created where)

010win32stub.patch: This is just a hack to revert the function stub code 
in win32.c back to the way it used to work.  the new code doesn't work 
with CoreAVC, and I haven't spent any time figuring out why.

011avchack.patch: Another hack to force 'avc1' to be fourcc 'AVC1'  Some 
versions of CoreAVC only support 'AVC1'

012regedit.patch: Adds a new file 'modify_reg.c' that can be used to add 
items to the registry.
build as: gcc -o regedit -I. loader/modify_reg.c

series (for quilt users):
001mpg2fmt.patch -p0
002srcdstfmt.patch -p0
003dshowchkfmt.patch -p0
004avc1mov.patch -p0
005pecompact2.patch -p0
006cpu.patch -p0
007widereg.patch -p0
008newfunc.patch -p0
009threaddisp.patch -p0
010win32stub.patch -p0
011avchack.patch -p0
012regedit.patch -p0

More information about the MPlayer-dev-eng mailing list