2008年12月25日 星期四

計算發動率

// Coverage.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include


int _tmain(int argc, _TCHAR* argv[])
{

const int Range = 6000;
int Lasting = 1500;
const int TotalTest = 20000;
const int TotalProc = 3;

unsigned char* valueArray;
valueArray = (unsigned char*)malloc(Range);

int totalCount = 0;
for ( int k = 0; k < TotalTest; k++ )
{
int r;
memset( valueArray, 0, Range );
srand( GetTickCount() + rand());
for ( int i = 0; i < TotalProc; i++ )
{
r = rand() % Range;

/*
if ( i == 3 )
Lasting = 1000;
else
Lasting = 1500;
*/


for ( int j = 0; j < Lasting; j++ )
valueArray[(r+j)%Range] = 0xAA;
}
int count = 0;
for ( int i = 0; i < Range; i++ )
if ( valueArray[i] == 0xAA )
count++;

wprintf(L" %d / %d\r\n", count, Range);
totalCount += count;
}

free( valueArray );
wprintf( L" Average %d coverage %f\r\n", totalCount / TotalTest, (double)totalCount / TotalTest /Range );
Sleep(15000);
return 0;
}

2008年11月26日 星期三

計算各部位的差異

Total 頭、頸、肩膀、披風、胸、手腕、手套、腰帶、褲子、鞋子、戒指x2、飾品x2
主武、副武、投擲
共17個部位

1‧

2008年7月15日 星期二

Build WINCE 6 R2 from start

裝好 WINCE 6 & Updates 還有RMI BSP之後
開始build

會遇到下面問題
1. Warning C4819

UILD: [01:0000000030:ERRORE] C:\WINCE600\PLATFORM\DB1200\src\drivers\WAVEMDD\.\common.c : error C2220: warning treated as error - no 'object' file generated
BUILD: [01:0000000031:WARNN ] C:\WINCE600\PLATFORM\DB1200\src\drivers\WAVEMDD\.\common.c : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss

把Common.c Save 成Unicode (File->Advance Save Option) 可以解決這個問題
起因應該是某個common.c 的character (new line?) 在codepage 950 (Big5)之下 為亂碼
所以compile failed (實在不太了解這個檔為什麼會有問題 剛好某個字元被當成big5 code? (好像在註解中))
而且codepage 是950?

2. fmerge nlssrc.txt problem

在build bsp 時 常會出現以下錯誤

makeimg: run command: fmerge -txt E:\wince6Wasp1\RelDir\DB1200_MIPSII_Debug\postproc\nlssrc.txt C:\WINCE600\public\common\oak\files\locale.txt E:\wince6Wasp1\RelDir\DB1200_MIPSII_Debug\nlssrc.txt


fmerge for Windows CE (Release) (Built on Apr 5 2006 11:32:16)
makeimg: FATAL ERROR: Command returned non-zero exit code 1 (dec).
makeimg: FATAL ERROR: Command returned non-zero exit code 1 (dec).


因為 fmerge 第三個參數 E:\wince6Wasp1\RelDir\DB1200_MIPSII_Debug\nlssrc.txt 不存在

可是為什麼會不存在呢? 那個是release dir

經過爬文 http://groups.google.co.yu/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/42e5396933c17be0/641e77f039427012

應該在buildrel phase 出了問題

把project property --> build options --> Use Xcopy instead of links.. 打勾就行了

再下copy files to release directory 命令



3. AC97.c 缺少以下定義



#define ZONE_AC97_ERROR 1
#define ZONE_ERROR 1
#define ZONE_AC97_FUNC 1
#define ZONE_AC97_DMA 1
#define ZONE_FUNCTION 1

可設 0 或 1 或條件式


4. display\16bpp.h 32bpp.h

#define DEBUG 0

DEBUG redefinition

BUILD: [01:0000000177:WARNN ] c:\wince600\platform\db1200\src\drivers\display\16Bpp.h(3) : warning C4005: 'DEBUG' : macro redefinition



在尋找solution的時候 找了以下一些資訊

Info

Make Binary Image Tool

http://msdn.microsoft.com/en-us/library/aa908853.aspx

http://jusweny.spaces.live.com/Blog/cns!88C641BFCCD350D4!2202.entry



2008年7月4日 星期五

MAC MPEG2 problem

http://rodfathermobile.com/2008/04/09/encoding-to-h264-with-vlc-using-sendto/

WINCE Keyboard

最近又為了客戶的需求,又要加入French的Keyboard
雖然之前有做過German的Keyboard,不過又全部忘記了... ~~
當初是怎麼做出那個DLL的 @@

重新複習了一下

首先 先用kbdgen (在 \wince500\public\common\oak\bin\i386下面)
然後把 Windows下的 kbdfr.dll ( \Windows\system32) copy 到kbdgen 的目錄下

下kbdgen的 command
法國區碼為 040C
結果如下


c:\wince500\public\common\oak\bin\i386\kbdgen kbdfr.dll -o cekbdfr -i 0000040C
kbdgen for Windows CE (Release) (Built on Dec 30 2003 15:22:20)
Warning - Generating desktop VK to CE VK conversions for the Input Language:
Warning -   Desktop VK_OEM_6         assigned to CE VK_RBRACKET
Warning -   Desktop VK_OEM_5         assigned to CE VK_BACKSLASH
Warning -   Desktop VK_OEM_4         assigned to CE VK_LBRACKET
Warning -   Desktop VK_OEM_PLUS      assigned to CE VK_EQUAL
Warning -   Desktop VK_OEM_1         assigned to CE VK_SEMICOLON
Warning -   Desktop VK_OEM_7         assigned to CE VK_APOSTROPHE
Warning -   Desktop VK_OEM_3         assigned to CE VK_BACKQUOTE
Warning -   Desktop VK_OEM_COMMA     assigned to CE VK_COMMA
Warning -   Desktop VK_OEM_PERIOD    assigned to CE VK_PERIOD
Warning -   Desktop VK_OEM_2         assigned to CE VK_SLASH
Warning -   Desktop VK_OEM_8         assigned to CE VK_OFF
Warning - Generating VKeyToXTScanCodeTable:
Warning -   The following duplicate entries have been ignored
Warning -   Virtual key VK_CLEAR             (0x0C) - Scan code 0x59
Warning -   Virtual key VK_TAB               (0x09) - Scan code 0x7C
Warning -   Virtual key VK_RETURN            (0x0D) - Scan code 0xE01C
Warning - Generating desktop VK to CE VK conversions for the Device Layout:
Warning -   Desktop VK_OEM_4         assigned to CE VK_LBRACKET
Warning -   Desktop VK_OEM_PLUS      assigned to CE VK_EQUAL
Warning -   Desktop VK_OEM_6         assigned to CE VK_RBRACKET
Warning -   Desktop VK_OEM_1         assigned to CE VK_SEMICOLON
Warning -   Desktop VK_OEM_3         assigned to CE VK_BACKQUOTE
Warning -   Desktop VK_OEM_7         assigned to CE VK_APOSTROPHE
Warning -   Desktop VK_OEM_5         assigned to CE VK_BACKSLASH
Warning -   Desktop VK_OEM_COMMA     assigned to CE VK_COMMA
Warning -   Desktop VK_OEM_PERIOD    assigned to CE VK_PERIOD
Warning -   Desktop VK_OEM_2         assigned to CE VK_SLASH
Warning -   Desktop VK_OEM_8         assigned to CE VK_OFF
Warning -   Desktop VK_OEM_WSCTRL    no CE match
Warning -   Desktop VK_OEM_FINISH    assigned to CE VK_DBE_KATAKANA
Warning -   Desktop VK_OEM_JUMP      no CE match
Warning -   Desktop VK_OEM_BACKTAB   assigned to CE VK_DBE_ROMAN
Warning -   Desktop VK_OEM_AUTO      assigned to CE VK_DBE_SBCSCHAR
Warning -   Desktop VK_OEM_PA3       no CE match
Warning -   Desktop VK_OEM_RESET     no CE match
Warning -   Desktop VK_ABNT_C1       no CE match
Warning -   Desktop VK_OEM_PA1       no CE match
Warning -   Desktop VK_ABNT_C2       no CE match
Warning -   Desktop VK_OEM_8         assigned to CE VK_OFF

會產生3個檔案

cekbdfr.reg
cekbdfrIL.cpp
cekbdfrDL.cpp
主要要export 2個函式出去 IL_0000040C
PS2_AT_0000040c




在platform builder help 中
How to Migrate a Keyboard Driver to Conform to the Layout Manager Interface
這個topic就是我們所要的

基本上 這個DLL要輸出以下一些函式
.def 的內容如下


LIBRARY LAYOUTMANAGER

EXPORTS

KeybdDriverInitializeEx
KeybdDriverPowerHandler
KeybdDriverGetInfo
KeybdDriverSetMode
KeybdDriverInitStates
KeybdDriverVKeyToUnicode
KeybdDriverMapVirtualKey

LayoutMgrGetKeyboardType
LayoutMgrGetKeyboardLayout
LayoutMgrGetKeyboardLayoutName
LayoutMgrGetKeyboardLayoutList
LayoutMgrLoadKeyboardLayout
LayoutMgrActivateKeyboardLayout

IL_0000040C
PS2_AT_0000040C

重點要Link的Library如下
LayoutManager.lib Required
Kbdmscommon.lib, or the library representing your keyboard PDD Required
Kbdpddlist.lib, or the library representing your PDD list Required
KeybdIst.lib Required if you are using the generic IST from %_WINCEROOT%\Public\Common\Oak\Drivers\Keybd\Ist
InputLang_0409.lib, or the library representing the input languages Required unless the input language is in a separate DLL
PS2_AT_00000409.lib, or the library representing the device layouts Required unless the device layout is in a separate DLL
NumPadRmp.lib Required if any of the device layout remapping functions use this library


在nop (非8042) 下為

SOURCELIBS=\
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Nop_KbdCommon.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Nop_PddList.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\LayoutManager.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\kbdfr_lib.lib \ <---ps2_at_0000040c br=""> $(_COMM
ONOAKROOT)\lib\$(_CPUINDPATH)\NumPadRmp.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\InputLang_040C.lib \

在dll目錄下照抄 KbdnopUS的 sources 這個檔案
把名字US的部份改成FR
把DOSYSGEN=1這行刪掉
才能build dll 否則會build出 kbdnopfr_lib.lib


2014新增
之前法文鍵盤沒有處理到 accents 的部份
http://french.about.com/od/pronunciation/a/accents.htm

French accents 有四種
accent aigu ´ (acute accent) can only be on an E
accent grave ` (grave accent) can be found on an AE, or U
accent circonflexe ˆ (circumflex) can be on anAEIO, or U
accent tréma ¨ (dieresis or umlaut) can be on an EI, or U.

在WINCE 處理的部份, 稱為 DeadKey

In laymgr.cpp

PFN_KEYBD_DRIVER_MAP_VIRTUAL_KEY   KeybdDriverMapVirtualKey

call
PFN_KEYBD_DRIVER_VKEY_TO_UNICODE KeybdDriverVKeyToUnicode

call
static VKeyToUnicode

call
static GetCharacters

call
static ProcessLigature

call
static ProcessDeadKeys


Euro problem
在Unicode 中, euro sign 為 0x20AC
或者是 0x80 (depend on code page, 如 cp1252 )
要打出歐元 "應該"(未測試) 要在registry 內加上
[HKEY_LOCAL_MACHINE\nls]
    "ExtraCurrency"=dword: 20ac

但是這個需要NLS support

所以用0x80 或許是另一個替代方法
但0x80 在某些非歐系國家中 不一定是euro sign
但Unicode 0x80 是euro sign
http://msdn.microsoft.com/en-us/library/aa448398.aspx









2008年6月27日 星期五

MAC WINCE File Share

http://msdn.microsoft.com/zh-cn/library/aa459150.aspx

search keyword
smbserver
wince smbserver
file server
ValidationErrorString


後來發現 可能與認證方式有關
LM, NTLM, NTLM v2
http://support.microsoft.com/kb/823659

http://msdn.microsoft.com/en-us/library/aa921092.aspx
是重要的 registry setting

Authentication 在MAC & Vista中失敗
所以試著用Kerberos 並且更新WINCE最新的Update
但是這裡又出現了一個bug
http://blogs.msdn.com/cenet/archive/2008/05/16/kerberos-cannot-resolve-netapi32-dll-in-ce5-0-after-qfe-updates.aspx

也就是在更新最近的update之後 (2008年 4? 5?月)
在build 的時候會出現以下訊息
"Warning: Unable to do imports from kerberos.dll to NETAPI32.dll - will late bind"
在run的時候則是看起來像
DoImport Failed! Unable to import Library 'NETAPI32.dll' for 'kerberos.dll'

簡單來說 更新的Kerberos depend on NETAPI32
所以要 SYSGEN_NETAPI32=1
在Catalog 中 也就是 Network features下的 "Domain Discovery"
把這個加進來就行了

2008年6月24日 星期二

WINCE Kiosk

在處理WINCE Kiosk 方面的問題的時候
最近又修改了一些地方 順便也Review了一遍


Summary
1. HKEY_LOCAL_MACHINE\Init
"Launch30"="gwes.exe"
"Depend30"=hex:14,00


LaunchXX XX 是啟動順序
DependXX = hex:14,00 表示 要等 Launch20 和 Launch00 "結束"之後才會Launch

2. 怎知道LaunchXX 結束了呢? (程式怎麼通知系統說 I'm ready?)
就是在程式裏呼叫 SignalStarted(xx)
一般的寫法是 SignalStarted(_wtol(lpCmdLine));
由這邊可以看到,由 WinMain傳進來的第三個參數 LPWSTR lpCmdLine 就是LaunchXX的 XX

3. ShellExecuteEx
ShellExecuteEx 用來載入程式
假如找不到該路徑下的程式 會顯示一個dialogbox 按ok 會回傳0 (Error)
假如找到該程式並執行 會一直往下run(Non-block)

4. 今天如果要等程式執行完才做下個動作(如回到桌面...)
要用 WaitForSingleObject( sei.hProcess, INFINTE );
並且在呼叫 ShellExecuteEx之前 sei.fMask 要設定 SEE_MASK_NOCLOSEPROCESS
不然 sei.hProcess 會是NULL

WaitForSingleObject( hProcess, xx );
hProcess是NULL時 會signaled

5. ProcessStartupFolder()
這個是Explorer (WINCE 的Shell) 處理 startup folder 的 routine
Source Code 在 \WINCE500\PUBLIC\SHELL\OAK\HPC\EXPLORER\MAIN\EXPLORER.CPP 裏,很有參考的價值

其中一段

// Process the items in the start up folder
if (!GetAsyncKeyState(VK_SHIFT))
{
DoStartupTasks();
}
else
{
DEBUGMSG(ZONE_WARNING, (TEXT("Bypassing startup files.\r\n")));

DWORD dw = 0;
if (ERROR_SUCCESS != RegQueryValueEx(HKEY_LOCAL_MACHINE,
TEXT("CalibrationData"),
(LPDWORD) TEXT("HARDWARE\\DEVICEMAP\\TOUCH"),
NULL, NULL, &dw))
{
TouchCalibrate();
}

}

可以看出 在啟動的時候 按住shift鍵 就不會去處理 start up folder裡面的東西
上面 也可以看到 Touch Panel 的 Calibration 流程 如果bapass startup file 之後
會去讀 HKLM\HARDWARE\\DEVICEMAP\\TOUCH
然後做 Calibration 的動作


Lyg.p: Layout Manager successfully initialized to 1
這個message 在 public\common\oak\drivers\keybd\LayMgr\LayMgr.cpp 裏
Lyg.p 應該 是 LayMgr.cpp (但是因為 unicode output , bug )


Explorer(V2.0) taskbar thread started.
在 public\shell\oak\hpc\explorer\taskbar\taskbar.cpp 裏

Fuck, 假如在 build image 的時候沒有用 DCOM (用COM不行)
在 explorer.exe 會停住

2008年6月16日 星期一

LIBTIFF

這裏列出 build libtiff 的完整步驟 (用VC 2008)






1. 下載libtiff 3.8.2



2. 解開ZIP檔 如 E:\tiff-3.8.2



3. Delete 或備份 \tiff-3.8.2\libtiff\tiffconf.h



(build 的動作會自動的把 libtiff 目錄下的 *.vc copy 成正常的版本 所以只要delete 原來的tiffconf.h就行了)






copy tif_config.h.vc tif_config.h



copy tiffconf.h.vc tiffconf.h






4. 然後在 tiff-3.8.2 下 nmake /f makefile.vc



(把JPEG_SUPPORT, PIXARLOG_SUPPORT, and ZIP_SUPPORT 關掉可以省掉一些麻煩,



不然的話 要自己先build zlib 和 jpeg6b也行)








build jpegv6b (for windows)


1. Extract jpegv6bsrc


2. copy jconfig.vc jconfig.h


3. nmake /f makefile.vc




build zlib 1.2.3


1. Extract


2. in zlib directory, nmake /f win32/Makefile.msc




modify tiff-3.8.2 nmake.opt




## Uncomment and edit following lines to enable JPEG support.


#


JPEG_SUPPORT = 1


JPEGDIR = ../../jpeg-6b


JPEG_INCLUDE = -I$(JPEGDIR)


JPEG_LIB = $(JPEGDIR)/libjpeg.lib




## Uncomment and edit following lines to enable ZIP support# (required for Deflate compression and Pixar log-format)


#


ZIP_SUPPORT = 1


ZLIBDIR = ../../zlib-1.2.3


ZLIB_INCLUDE = -I$(ZLIBDIR)


ZLIB_LIB = $(ZLIBDIR)/zlib.lib




## Uncomment following line to enable Pixar log-format algorithm# (Zlib required).


#


PIXARLOG_SUPPORT = 1



build libtiff link 時會出錯,應該是連結方式不同(libtiff, libjpeg, zlib)


動態和靜態




然後build libtiff


雖然可以link, 但是會出現 warning LNK4098


LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library


這個必須解決


應該是使用的版本不對 (如一個是multithread, 一個是single thread, debug和非debug)


查了一下 發現 libtiff和zlib 都是用 /md (multithreaded dll, use msvcrt.lib)選項編譯的 而libjpeg 預設是用 /MTd


所以會有問題


要修改 jpeg-6b\makefile.vc


CFLAGS= $(cflags) $(cdebug) $(cvars) -I.


改成


CFLAGS= $(cflags) $(cdebug) $(cvarsdll) -I.


然後make的時候 要下


nmake nodebug=1 /f makefile.vc


就會以/MD選項編譯


還有tiff-3.8.2\nmake.opt 中 OPTFLAGS /GX 選項改成/EHsc 免得一堆


depreciated warning 跑出來



完美的Compile!!



!! 新增 Build Libtiff under WINCE (for MIPS)
以上所Build 出來的是Windows 的版本
忘了講到重點 如何build WinCE 的版本

1. 使用Embedded Visual C++ 4.0
打開 Command Prompt window
進入 \Program Files\Microsoft eMbedded C++ 4.0\EVC\wce500\bin
set SDKROOT=C:\Program Files\Windows CE Tools ( Standard SDK for WINCE 安裝的地方)
run WCEMIPSII.BAT

設定好環境, 再來修改nmake.opt 這個檔案
設定 CC=clmips, Linker 的選項加 /SUBSYSTEM:WINDOWSCE
Compiler option 加入 /D _MIPS_ /D UNICODE
就可以編譯 libtiff了, happy compiling!

2. 使用Visual Studio 2008







2008年6月15日 星期日

DMO, ATL & DisableThreadLibraryCalls

在觀摩AMD 的 BSP for mpeg2 decoder的時候




AMD使用DMO (DirectX Media Object)


而這個DMO又使用了ATL




以下為 sample code




CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)


OBJECT_ENTRY(CLSID_AMDMPVDMO, CAmdMpvDmo)


END_OBJECT_MAP()




/////////////////////////////////////////////////////////////////////////////


// DLL Entry Point


extern "C"


BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID /*lpReserved*/)


{


if (dwReason == DLL_PROCESS_ATTACH)


{


_Module.Init(ObjectMap, reinterpret_cast(hDllHandle)); DisableThreadLibraryCalls(reinterpret_cast(hDllHandle));


} else if (dwReason == DLL_PROCESS_DETACH)


_Module.Term();
return TRUE;




}




其中DisableThreadLibraryCalls 就是用來 disable DLL_THREAD_ATTACH 和


DLL_THREAD_DETACH 的 notification


(如果這個DLL會link to static C run time library, 就不能使用 DisableThreadLibraryCalls


因為The static CRT requires DLL_THREAD_ATTACH and DLL_THREAD_DETATCH notifications to function properly. )






關於ATL


什麼是ATL 呢? 它用來做什麼的?


ATL is the Active Template Library, a set of template-based C++ classes with which you can easily create small, fast Component Object Model (COM) objects.


DMO, DMO 也是COM


DirectX Media Objects (DMOs) are COM-based multimedia and data-streaming components.



DMO 的 sample implementation


在 WINCE500\PUBLIC\DIRECTX\SDK\INC\dmobase.h



ATL_NO_VTABLE,


ATL_NO_VTABLE 巨集會展開為__declspec(novtable).


在基類中初始化虛函數表是沒有用的,因為它會被派生類覆蓋掉,所以我們可以對它使用ATL_NO_VTABLE, 免得它產生虛函數表



當您建置專案時,連結器 (Linker) 會排除 vtable 指向的 vtable 和所有函式。
您必須只在不是直接可建的基底函式上使用 ATL_NO_VTABLE 並接著使用 declspec(novtable)。您無法在專案中衍生程度最高的類別上使用 declspec(novtable),因為這個類別 (通常是 CComObjectCComAggObjectCComPolyObject) 會為專案初始化 vtable 指標。
您無法從任何使用 declspec(novtable) 物件之建構函式呼叫 Virtual 函式。您必須將這些呼叫移至 FinalConstruct 方法。




WINCE DVR

在找有關WINCE DVR的時候 發現了下面一篇文章



GPL MPEG1/2 DirectShow Decoder filter

和VirtualDub 都是不錯的東東

值得一記


Windows CE 5.0 NMD feature pack -- formerly codenamed "Tomatin"

... 原來NMD的codename 叫 Tomatin

2008年6月12日 星期四

2008年6月11日 星期三

列了一大堆該做或想做的事 (Project)


得開始下手了


就從最簡單的TIFF開始吧


目標是 寫一個WINCE 5 下的TIFF Imaging API codec

(WINCE 5的Imaging API還沒支援TIFF的格式 WINCE 6有包含進TIFF了)

有了這個codec之後 在WINCE 5下面 可以用標準的Imaging API來操作

讀寫TIFF圖檔


關於TIFF方面的code 當然要藉助最有名的 libtiff 囉

2008年6月10日 星期二

USB Camera Driver

USB Camera Driver for WINCE 6

This device driver adds support for USB cameras to Windows Embedded CE 6.0. It enables still and video capture from cameras which comply with USB Video Class version 1.1.

This driver implements the camera driver interface introduced in Windows Mobile 5.0, and now available in CE 6.0. In other words, the driver is meant to be used as the source filter in a DirectShow capture graph, rather than as a stand-alone stream-based driver.

The driver supports both USB 1.x and 2.0 (high-speed) cameras. The driver will expose both uncompressed and MJPEG modes, if supported by the camera. MJPEG mode generally requires pairing the driver with a DirectShow transform filter (jpeg2rgb.dll) which is also included in this download. For more information see the included release notes.In the future, additional information and sample code may be posted to the Windows CE Base Team blog.


Important Download Details:
• Setup will install the source code files under %_WINCEROOT%\public\ThirdParty\Catalog\USBCam.
• Setup will not replace or modify files in your Windows Embedded CE Platform Builder installation.





http://msdn.microsoft.com/en-us/library/aa924811.aspx

http://msdn.microsoft.com/en-us/library/ms803117.aspx



http://support.microsoft.com/kb/828756/en-us



H.264&MP4

http://tech.digitimes.com.tw/ShowNews.aspx?zCatId=C13&zNotesDocId=EF9FC195DA1E88C24825714100421F6D

Jserv

又一如往常地看了一下 jserv 的twitter

哇塞 竟然發現jserv的生日跟我是同一天(6月11日?)

My god


Jserv加油

2008年6月9日 星期一

.MXF

在研究Sony PDW-70MD的時候

找到以下文章


據說 HD 相關的影片,檔案都很大,所以很多剪輯軟體都是使用代理影片檔來剪輯,才能解決即時預覽 RealTime 的問題,也就是擷取時同時產生兩種畫素的影片,一個是原來的畫素影片檔,另一個是較低畫素的代理影片檔 Proxy,剪輯時使用畫素低的代理影片,剪完之後輸出才使用真正的畫質,由於每一家軟體自己使用的 Proxy 不盡相同,所以自然沒法跟別的剪輯軟體共用。建議你擷取到剪輯都使用相同的軟體,EX1-FCP 作業流程,請看小弟的舊文...Sony PMW-EX1 實拍心得- 類紀錄片作業

2008年6月4日 星期三

IOCTL_SCSI_PASSTHROUGH

IMAPI


Image Mastering API




MAPI enables the creation of optical media using a variety of file systems.
Features
IMAPI supports the following formats. For more details, see Disc Formats.
ISO9660 image format (includes Redbook Audio).
Joliet format.
Universal Disk Format (UDF).


growisofs (Unix 下的command)


SCSI Multimedia Commands - 4 (MMC-4)

SCSI commands are sent in a Command Descriptor Block (CDB).


SPTI/ASPI

SPTI( SCSI PassThrough Interface by Microsoft)

ASPI( Advanced SCSI Programming Interface by Adaptec )



CD/ATAPI 以SFF-8020為標準

DVD/ATAPI 是以SFF-8090為標準

Amiga Forever

在搜尋ioctl scsi passthrough 的時候
發現了一個網站
Amiga Forever 2008
商業化的模擬器?
看起來好像蠻有趣的

改天想辦法弄個一份

2008年6月2日 星期一

EABI

在download CodeSourcery 的ARM toolchain 時


有許多的版本




有EABI, uClinux, Linux, Symbain 四種版本


不知差異在哪




用wikipedia差了一下EABI


其中的描述是


The main differences of an EABI with respect an ABI for general purpose operating systems are that privileged instructions are allowed in application code, dynamic linking is not required (sometimes it is completely disallowed), and a more compact stack frame organization to save memory.




gcc 好像從 4.1.0 之後支援 EABI


還有查到Linux 從2.6.16之後都支援EABI了 好像對浮點數的處理速度會快很多






Why ARM's EABI matters?


結果快了20倍以上

還有

RealView MDK 從3.21版之後開始支援gnu toolchain

可以完美配合CodeSourcery

構想的Project

最近想做2Project


USB Osciiliscope


USB JTAG OCD


MP3 Player ++








注意到ARM的新MCU Cortex-M3


發現STM32F103 真是好東西


符合我的需求




72MHz


12bit ADC - 1us 16channel


USB Full Speed 12Mbit/s ( not high speed)


CAN bus(目前比較用不到)


一堆timer 一堆interface


是個很好的平台




大小6x6 ~ 10x10mm


內建了Flash memory和SRAM (Embedded)


32-128K Flash


6-20K SRAM


還有內建一些clock






Hardware CRC calculation unit






不足的地方


Future family enhancements


Further developments of the STM32F103xx performance line will see an expansion of thecurrent options. Larger packages will soon be available with up to 512 KB Flash, 64 KBSRAM and with extended features such as flexible static memory controller (FSMC)support, SDIO, I2S, DAC and additional timers and USARTS.






在找datasheet的時候 發現很棒的網站


2008年5月31日 星期六

在讀 C++ Templates: The complete guide 時, page 107講到function template 的 overload時

有所謂的SFINAE原則(替換失敗並非錯誤) 舉出了2個例子


template void f(int (&)[24/(4-I)]);

template void f(int (&)[24/(4+I)]);


int main()

{

&f<4>; <-- error C2568: 'identifier' : unable to resolve function overload

}


//在VC9 (VS2008)是ok的 會顯示錯誤



template int g() { return N; }

template int g() { return *P; }


int main()

{

return g<1>();


}


// 在VC9 一樣無法過關

出現以下錯誤訊息

error C2440: 'specialization' : cannot convert from 'int' to 'int *const '

error C2973: 'g' : invalid template argument 'int'

error C2668: 'g' : ambiguous call to overloaded function

2008年5月30日 星期五

extern "C" 大不同

extern "C" func();

和 extern "C"

{

func();

}


完全不一樣


extern "C" func(); 宣告而已 有這個函數

extern "C" { func(); } 是定義 採用C Linking ( C decoration )

C/C++ Mixed 的小問題 C2275


error C2275 ( illegal use of this type as an expression ) 是變數宣告沒放在開頭的問題 ...

DLL Viewer

在做JTAG的實驗時 如果以Windows XP和Parallel port cable開發程式

第一步就是要克服在Win XP下對port Direct I/O 的問題


Google了一下 發現Inpout32.dll 這個函式庫

但是要看它到底輸出了哪些函式 函式的確切型別和名稱

就需要一個好用的DLL Viewer了 ;-)

(雖然在VS2008 Console 下dumpbin之類的utility也可以做到)



不過好像看不到Export Function的參數

不知道要如何才能得知 Export funtion 的參數

VS2008的問題

今天用VS2008編譯了一個小程式 看到Output 視窗中多了一個Generating manifest的東西

就跑到Project Property Page裏面去把它關掉 問題來了 關掉之後就無法debug或run 程式

Visual Studio 2008 會出現mfc90ud.dll 無法載入的錯誤 後來又把manifest打開才回復正常


用了偉大的G神查了一下 原來在VS2008 manifest是必備的 無法移除的