9.1.2. cx2341x 驅動程式¶
9.1.2.1. cx2341x 晶片上的記憶體¶
本節介紹 cx2341x 記憶體對映並記錄一些暫存器空間。
注意
記憶體長字是小端(“intel 格式”)。
警告
此資訊是透過搜尋記憶體和暫存器來確定的,此資訊可能不正確,肯定不完整,並且並非來自任何比使用類似命令搜尋記憶體空間更多的東西
ivtvctl -O min=0x02000000,max=0x020000ff
因此,請按原樣理解,我總是在尋找更多東西,這是一個很大的暫存器空間 :-)。
9.1.2.1.1. 記憶體對映¶
cx2341x 透過 PCI BAR0(基地址暫存器 0)將其整個 64M 記憶體空間暴露給 PCI 主機。這裡的地址是相對於 BAR0 中儲存的地址的偏移量。
0x00000000-0x00ffffff Encoder memory space
0x00000000-0x0003ffff Encode.rom
???-??? MPEG buffer(s)
???-??? Raw video capture buffer(s)
???-??? Raw audio capture buffer(s)
???-??? Display buffers (6 or 9)
0x01000000-0x01ffffff Decoder memory space
0x01000000-0x0103ffff Decode.rom
???-??? MPEG buffers(s)
0x0114b000-0x0115afff Audio.rom (deprecated?)
0x02000000-0x0200ffff Register Space
9.1.2.1.2. 暫存器¶
暫存器佔據從 BAR0 偏移 0x02000000 開始的 64k 空間。所有這些暫存器都是 32 位寬。
DMA Registers 0x000-0xff:
0x00 - Control:
0=reset/cancel, 1=read, 2=write, 4=stop
0x04 - DMA status:
1=read busy, 2=write busy, 4=read error, 8=write error, 16=link list error
0x08 - pci DMA pointer for read link list
0x0c - pci DMA pointer for write link list
0x10 - read/write DMA enable:
1=read enable, 2=write enable
0x14 - always 0xffffffff, if set any lower instability occurs, 0x00 crashes
0x18 - ??
0x1c - always 0x20 or 32, smaller values slow down DMA transactions
0x20 - always value of 0x780a010a
0x24-0x3c - usually just random values???
0x40 - Interrupt status
0x44 - Write a bit here and shows up in Interrupt status 0x40
0x48 - Interrupt Mask
0x4C - always value of 0xfffdffff,
if changed to 0xffffffff DMA write interrupts break.
0x50 - always 0xffffffff
0x54 - always 0xffffffff (0x4c, 0x50, 0x54 seem like interrupt masks, are
3 processors on chip, Java ones, VPU, SPU, APU, maybe these are the
interrupt masks???).
0x60-0x7C - random values
0x80 - first write linked list reg, for Encoder Memory addr
0x84 - first write linked list reg, for pci memory addr
0x88 - first write linked list reg, for length of buffer in memory addr
(|0x80000000 or this for last link)
0x8c-0xdc - rest of write linked list reg, 8 sets of 3 total, DMA goes here
from linked list addr in reg 0x0c, firmware must push through or
something.
0xe0 - first (and only) read linked list reg, for pci memory addr
0xe4 - first (and only) read linked list reg, for Decoder memory addr
0xe8 - first (and only) read linked list reg, for length of buffer
0xec-0xff - Nothing seems to be in these registers, 0xec-f4 are 0x00000000.
編碼器緩衝區 0x700-0x7ff 的記憶體位置
這些暫存器顯示與用於編碼的每個緩衝區區域相關的記憶體位置的偏移量,必須首先將它們移動 <<1。
0x07F8:編碼器 SDRAM 重新整理
0x07FC:編碼器 SDRAM 預充電
解碼器緩衝區 0x800-0x8ff 的記憶體位置
這些暫存器顯示與用於解碼的每個緩衝區區域相關的記憶體位置的偏移量,必須首先將它們移動 <<1。
0x08F8:解碼器 SDRAM 重新整理
0x08FC:解碼器 SDRAM 預充電
其他記憶體位置
0x2800:影片顯示模組控制
0x2D00:AO(音訊輸出?)控制
0x2D24:已重新整理的位元組數
0x7000:LSB I2C 寫時鐘位(反轉)
0x7004:LSB I2C 寫入資料位(反轉)
0x7008:LSB I2C 讀取時鐘位
0x700c:LSB I2C 讀取資料位
0x9008:GPIO 獲取輸入狀態
0x900c:GPIO 設定輸出狀態
0x9020:GPIO 方向(Bit7 (GPIO 0..7) - 0:輸入,1:輸出)
0x9050:SPU 控制
0x9054:復位硬體塊
0x9058:VPU 控制
0xA018:Bit6:中斷掛起?
0xA064:APU 命令
9.1.2.1.3. 中斷狀態暫存器¶
中斷狀態暫存器 0x0040 和中斷掩碼 0x0048 中的位的定義。如果在掩碼中清除了一個位,那麼我們希望我們的 ISR 執行。
bit 31 編碼器啟動捕獲
bit 30 編碼器 EOS
bit 29 編碼器 VBI 捕獲
bit 28 編碼器影片輸入模組復位事件
bit 27 編碼器 DMA 完成
bit 24 解碼器音訊模式更改檢測事件(透過事件通知)
bit 22 解碼器資料請求
bit 20 解碼器 DMA 完成
bit 19 解碼器 VBI 重新插入
bit 18 解碼器 DMA 錯誤(連結串列錯誤)
9.1.2.2. 缺少文件¶
編碼器 API post(?)
解碼器 API post(?)
解碼器 VTRACE 事件
9.1.2.3. cx2341x 韌體上傳¶
本文件介紹如何將 cx2341x 韌體上傳到卡。
9.1.2.3.1. 如何查詢¶
有關如何獲取韌體的資訊,請參閱使用此晶片的各種專案的網頁。
可以按如下方式檢測儲存在 Windows 驅動程式中的韌體
每個韌體映像為 256k 位元組。
編碼器映像的第一個 32 位字是 0x0000da7
解碼器映像的第一個 32 位字是 0x00003a7
兩個映像的第二個 32 位字都是 0xaa55bb66
9.1.2.3.2. 如何載入¶
如果編碼器正在執行,則發出 FWapi 命令以停止編碼器。等待命令完成。
如果解碼器正在執行,則發出 FWapi 命令以停止解碼器。等待命令完成。
向數字化儀發出 I2C 命令以停止發出 VSYNC 事件。
發出 FWapi 命令以停止編碼器的韌體。
睡眠 10 毫秒。
發出 FWapi 命令以停止解碼器的韌體。
睡眠 10 毫秒。
將 0x00000000 寫入暫存器 0x2800 以停止影片顯示模組。
將 0x00000005 寫入暫存器 0x2D00 以停止 AO(音訊輸出?)。
將 0x00000000 寫入暫存器 0xA064 以 ping? APU。
將 0xFFFFFFFE 寫入暫存器 0x9058 以停止 VPU。
將 0xFFFFFFFF 寫入暫存器 0x9054 以復位硬體塊。
將 0x00000001 寫入暫存器 0x9050 以停止 SPU。
睡眠 10 毫秒。
將 0x0000001A 寫入暫存器 0x07FC 以初始化編碼器 SDRAM 的預充電。
將 0x80000640 寫入暫存器 0x07F8 以初始化編碼器 SDRAM 的重新整理為 1us。
將 0x0000001A 寫入暫存器 0x08FC 以初始化解碼器 SDRAM 的預充電。
將 0x80000640 寫入暫存器 0x08F8 以初始化解碼器 SDRAM 的重新整理為 1us。
睡眠 512 毫秒。(建議使用 600 毫秒)
將編碼器的韌體映像傳輸到編碼器記憶體空間中的偏移量 0。
將解碼器的韌體映像傳輸到解碼器記憶體空間中的偏移量 0。
使用讀取-修改-寫入操作清除暫存器 0x9050 的位 0 以重新啟用 SPU。
睡眠 1 秒。
使用讀取-修改-寫入操作清除暫存器 0x9058 的位 3 和 0 以重新啟用 VPU。
睡眠 1 秒。
發出狀態 API 命令以驗證兩個韌體映像。
9.1.2.4. 如何呼叫韌體 API¶
首選呼叫約定稱為韌體郵箱。郵箱基本上是一個固定長度的陣列,用作呼叫堆疊。
可以透過在編碼器和解碼器記憶體中搜索 16 位元組簽名來定位韌體郵箱。該簽名將位於 256 位元組邊界上。
簽名
0x78, 0x56, 0x34, 0x12, 0x12, 0x78, 0x56, 0x34,
0x34, 0x12, 0x78, 0x56, 0x56, 0x34, 0x12, 0x78
韌體實現了 20 個郵箱,每個郵箱包含 20 個 32 位字。前 10 個保留用於 API 呼叫。後 10 個由韌體用於事件通知。
索引
名稱
0
標誌
1
命令
2
返回值
3
超時
4-19
引數/結果
標誌在下表中定義。方向是從韌體的角度來看的。
位
方向
目的
2
O
韌體已處理該命令。
1
I
驅動程式已完成引數設定。
0
I
驅動程式正在使用此郵箱。
該命令是一個 32 位列舉器。API 規範可以在本章中找到。
返回值是一個 32 位列舉器。目前只定義了兩個值
0=成功
-1=命令未定義。
有 16 個引數/結果 32 位欄位。驅動程式使用呼叫所需的所有引數的值填充這些欄位。驅動程式使用呼叫返回的結果值覆蓋這些欄位。
超時值可保護卡免受掛起的驅動程式執行緒的影響。如果驅動程式未在指定的超時時間內處理完成的呼叫,則韌體將重置該郵箱。
要進行 API 呼叫,驅動程式會迭代每個郵箱,查詢第一個可用的郵箱(位 0 已被清除)。驅動程式設定該位,填寫命令列舉器、超時值和任何必需的引數。然後,驅動程式設定引數就緒位(位 1)。韌體掃描郵箱以查詢掛起的命令,處理它們,設定結果程式碼,使用該呼叫的返回值填充結果值陣列,並設定呼叫完成位(位 2)。一旦設定了位 2,驅動程式應檢索結果並清除所有標誌。如果驅動程式未在超時暫存器中設定的時間內執行此任務,則韌體將重置該郵箱。
事件通知從韌體傳送到主機。主機透過 API 呼叫告訴韌體它對哪些事件感興趣。該呼叫告訴韌體使用哪個通知郵箱。韌體透過中斷向主機發出訊號。僅使用 16 個結果欄位,而不使用標誌、命令、返回值和超時字。
9.1.2.5. OSD 韌體 API 描述¶
注意
此 API 是解碼器韌體的一部分,因此僅適用於 cx23415。
9.1.2.5.1. CX2341X_OSD_GET_FRAMEBUFFER¶
列舉:65/0x41
9.1.2.5.1.1. 描述¶
返回連續 OSD 記憶體的基址和長度。
9.1.2.5.1.2. 結果[0]¶
OSD 基址
9.1.2.5.1.3. 結果[1]¶
OSD 長度
9.1.2.5.2. CX2341X_OSD_GET_PIXEL_FORMAT¶
列舉:66/0x42
9.1.2.5.2.1. 描述¶
查詢 OSD 格式
9.1.2.5.2.2. 結果[0]¶
0=8 位索引 1=16 位 RGB 5:6:5 2=16 位 ARGB 1:5:5:5 3=16 位 ARGB 1:4:4:4 4=32 位 ARGB 8:8:8:8
9.1.2.5.3. CX2341X_OSD_SET_PIXEL_FORMAT¶
列舉:67/0x43
9.1.2.5.3.1. 描述¶
分配畫素格式
9.1.2.5.3.2. Param[0]¶
0=8 位索引
1=16 位 RGB 5:6:5
2=16 位 ARGB 1:5:5:5
3=16 位 ARGB 1:4:4:4
4=32 位 ARGB 8:8:8:8
9.1.2.5.4. CX2341X_OSD_GET_STATE¶
列舉:68/0x44
9.1.2.5.4.1. 描述¶
查詢 OSD 狀態
9.1.2.5.4.2. 結果[0]¶
位 0 0=關閉,1=開啟
位 1:2 alpha 控制
位 3:5 畫素格式
9.1.2.5.5. CX2341X_OSD_SET_STATE¶
列舉:69/0x45
9.1.2.5.5.1. 描述¶
OSD 開關
9.1.2.5.5.2. Param[0]¶
0=關閉,1=開啟
9.1.2.5.6. CX2341X_OSD_GET_OSD_COORDS¶
列舉:70/0x46
9.1.2.5.6.1. 描述¶
檢索與影片混合的 OSD 區域的座標
9.1.2.5.6.2. 結果[0]¶
OSD 緩衝區地址
9.1.2.5.6.3. 結果[1]¶
畫素步幅
9.1.2.5.6.4. 結果[2]¶
OSD 緩衝區中的行數
9.1.2.5.6.5. 結果[3]¶
緩衝區中的水平偏移
9.1.2.5.6.6. 結果[4]¶
緩衝區中的垂直偏移
9.1.2.5.7. CX2341X_OSD_SET_OSD_COORDS¶
列舉:71/0x47
9.1.2.5.7.1. 描述¶
分配要與影片混合的 OSD 區域的座標
9.1.2.5.7.2. Param[0]¶
緩衝區地址
9.1.2.5.7.3. Param[1]¶
畫素緩衝區步幅
9.1.2.5.7.4. Param[2]¶
緩衝區中的行數
9.1.2.5.7.5. Param[3]¶
水平偏移
9.1.2.5.7.6. Param[4]¶
垂直偏移
9.1.2.5.8. CX2341X_OSD_GET_SCREEN_COORDS¶
列舉:72/0x48
9.1.2.5.8.1. 描述¶
檢索 OSD 螢幕區域座標
9.1.2.5.8.2. 結果[0]¶
左上角水平偏移
9.1.2.5.8.3. 結果[1]¶
左上角垂直偏移
9.1.2.5.8.4. 結果[2]¶
右下角水平偏移
9.1.2.5.8.5. 結果[3]¶
右下角垂直偏移
9.1.2.5.9. CX2341X_OSD_SET_SCREEN_COORDS¶
列舉:73/0x49
9.1.2.5.9.1. 描述¶
分配與影片混合的螢幕區域的座標
9.1.2.5.9.2. 引數[0]¶
左上角水平偏移
9.1.2.5.9.3. 引數[1]¶
左上角垂直偏移
9.1.2.5.9.4. 引數[2]¶
左下角水平偏移
9.1.2.5.9.5. 引數[3]¶
左下角垂直偏移
9.1.2.5.10. CX2341X_OSD_GET_GLOBAL_ALPHA¶
列舉:74/0x4A
9.1.2.5.10.1. 描述¶
檢索 OSD 全域性 Alpha 值
9.1.2.5.10.2. 結果[0]¶
全域性 Alpha 值:0=關閉,1=開啟
9.1.2.5.10.3. 結果[1]¶
位 0:7 全域性 Alpha 值
9.1.2.5.11. CX2341X_OSD_SET_GLOBAL_ALPHA¶
列舉:75/0x4B
9.1.2.5.11.1. 描述¶
更新全域性 Alpha 值
9.1.2.5.11.2. 引數[0]¶
全域性 Alpha 值:0=關閉,1=開啟
9.1.2.5.11.3. 引數[1]¶
全域性 Alpha 值(8 位)
9.1.2.5.11.4. 引數[2]¶
區域性 Alpha 值:0=開啟,1=關閉
9.1.2.5.12. CX2341X_OSD_SET_BLEND_COORDS¶
列舉:78/0x4C
9.1.2.5.12.1. 描述¶
移動顯示緩衝區內混合區域的起始位置
9.1.2.5.12.2. 引數[0]¶
緩衝區中的水平偏移
9.1.2.5.12.3. 引數[1]¶
緩衝區中的垂直偏移
9.1.2.5.13. CX2341X_OSD_GET_FLICKER_STATE¶
列舉:79/0x4F
9.1.2.5.13.1. 描述¶
檢索閃爍減少模組狀態
9.1.2.5.13.2. 結果[0]¶
閃爍狀態:0=關閉,1=開啟
9.1.2.5.14. CX2341X_OSD_SET_FLICKER_STATE¶
列舉:80/0x50
9.1.2.5.14.1. 描述¶
設定閃爍減少模組狀態
9.1.2.5.14.2. 引數[0]¶
狀態:0=關閉,1=開啟
9.1.2.5.15. CX2341X_OSD_BLT_COPY¶
列舉:82/0x52
9.1.2.5.15.1. 描述¶
BLT 複製
9.1.2.5.15.2. 引數[0]¶
'0000' zero
'0001' ~destination AND ~source
'0010' ~destination AND source
'0011' ~destination
'0100' destination AND ~source
'0101' ~source
'0110' destination XOR source
'0111' ~destination OR ~source
'1000' ~destination AND ~source
'1001' destination XNOR source
'1010' source
'1011' ~destination OR source
'1100' destination
'1101' destination OR ~source
'1110' destination OR source
'1111' one
9.1.2.5.15.3. 引數[1]¶
最終的 Alpha 混合
“01” source_alpha
“10” destination_alpha
“11” source_alpha*destination_alpha+1(如果源和目標 Alpha 值都為零,則為零)
9.1.2.5.15.4. 引數[2]¶
'00' output_pixel = source_pixel
'01' if source_alpha=0:
output_pixel = destination_pixel
if 256 > source_alpha > 1:
output_pixel = ((source_alpha + 1)*source_pixel +
(255 - source_alpha)*destination_pixel)/256
'10' if destination_alpha=0:
output_pixel = source_pixel
if 255 > destination_alpha > 0:
output_pixel = ((255 - destination_alpha)*source_pixel +
(destination_alpha + 1)*destination_pixel)/256
'11' if source_alpha=0:
source_temp = 0
if source_alpha=255:
source_temp = source_pixel*256
if 255 > source_alpha > 0:
source_temp = source_pixel*(source_alpha + 1)
if destination_alpha=0:
destination_temp = 0
if destination_alpha=255:
destination_temp = destination_pixel*256
if 255 > destination_alpha > 0:
destination_temp = destination_pixel*(destination_alpha + 1)
output_pixel = (source_temp + destination_temp)/256
9.1.2.5.15.5. 引數[3]¶
寬度
9.1.2.5.15.6. 引數[4]¶
高度
9.1.2.5.15.7. 引數[5]¶
目標畫素掩碼
9.1.2.5.15.8. 引數[6]¶
目標矩形起始地址
9.1.2.5.15.9. 引數[7]¶
目標跨距,以雙字為單位
9.1.2.5.15.10. 引數[8]¶
源跨距,以雙字為單位
9.1.2.5.15.11. 引數[9]¶
源矩形起始地址
9.1.2.5.16. CX2341X_OSD_BLT_FILL¶
列舉:83/0x53
9.1.2.5.16.1. 描述¶
BLT 填充顏色
9.1.2.5.16.2. 引數[0]¶
與 API 0x52 上的引數[0] 相同
9.1.2.5.16.3. 引數[1]¶
與 API 0x52 上的引數[1] 相同
9.1.2.5.16.4. 引數[2]¶
與 API 0x52 上的引數[2] 相同
9.1.2.5.16.5. 引數[3]¶
寬度
9.1.2.5.16.6. 引數[4]¶
高度
9.1.2.5.16.7. 引數[5]¶
目標畫素掩碼
9.1.2.5.16.8. 引數[6]¶
目標矩形起始地址
9.1.2.5.16.9. 引數[7]¶
目標跨距,以雙字為單位
9.1.2.5.16.10. 引數[8]¶
顏色填充值
9.1.2.5.17. CX2341X_OSD_BLT_TEXT¶
列舉:84/0x54
9.1.2.5.17.1. 描述¶
用於 8 位 Alpha 文字源的 BLT
9.1.2.5.17.2. 引數[0]¶
與 API 0x52 上的引數[0] 相同
9.1.2.5.17.3. 引數[1]¶
與 API 0x52 上的引數[1] 相同
9.1.2.5.17.4. 引數[2]¶
與 API 0x52 上的引數[2] 相同
9.1.2.5.17.5. 引數[3]¶
寬度
9.1.2.5.17.6. 引數[4]¶
高度
9.1.2.5.17.7. 引數[5]¶
目標畫素掩碼
9.1.2.5.17.8. 引數[6]¶
目標矩形起始地址
9.1.2.5.17.9. 引數[7]¶
目標跨距,以雙字為單位
9.1.2.5.17.10. 引數[8]¶
源跨距,以雙字為單位
9.1.2.5.17.11. 引數[9]¶
源矩形起始地址
9.1.2.5.17.12. 引數[10]¶
顏色填充值
9.1.2.5.18. CX2341X_OSD_SET_FRAMEBUFFER_WINDOW¶
列舉:86/0x56
9.1.2.5.18.1. 描述¶
在螢幕上定位主輸出視窗。座標必須使整個視窗都位於螢幕上。
9.1.2.5.18.2. 引數[0]¶
視窗寬度
9.1.2.5.18.3. 引數[1]¶
視窗高度
9.1.2.5.18.4. 引數[2]¶
左上角視窗角的水平偏移
9.1.2.5.18.5. 引數[3]¶
左上角視窗角的垂直偏移
9.1.2.5.19. CX2341X_OSD_SET_CHROMA_KEY¶
列舉:96/0x60
9.1.2.5.19.1. 描述¶
色度鍵開關和顏色
9.1.2.5.19.2. 引數[0]¶
狀態:0=關閉,1=開啟
9.1.2.5.19.3. 引數[1]¶
顏色
9.1.2.5.20. CX2341X_OSD_GET_ALPHA_CONTENT_INDEX¶
列舉:97/0x61
9.1.2.5.20.1. 描述¶
檢索 Alpha 內容索引
9.1.2.5.20.2. 結果[0]¶
Alpha 內容索引,範圍 0:15
9.1.2.5.21. CX2341X_OSD_SET_ALPHA_CONTENT_INDEX¶
列舉:98/0x62
9.1.2.5.21.1. 描述¶
分配 Alpha 內容索引
9.1.2.5.21.2. 引數[0]¶
Alpha 內容索引,範圍 0:15
9.1.2.6. 編碼器韌體 API 描述¶
9.1.2.6.1. CX2341X_ENC_PING_FW¶
列舉:128/0x80
9.1.2.6.1.1. 描述¶
不執行任何操作。可用於檢查韌體是否正在響應。
9.1.2.6.2. CX2341X_ENC_START_CAPTURE¶
列舉:129/0x81
9.1.2.6.2.1. 描述¶
開始捕獲影片、音訊和/或 VBI 資料。所有編碼引數必須在此 API 呼叫之前初始化。連續捕獲幀或直到已捕獲預定義的幀數。
9.1.2.6.2.2. 引數[0]¶
捕獲流型別
0=MPEG
1=原始
2=原始直通
3=VBI
9.1.2.6.2.3. 引數[1]¶
位掩碼
如果設定了位 0,則捕獲 YUV
如果設定了位 1,則捕獲 PCM 音訊
如果設定了位 2,則捕獲 VBI(與 param[0]=3 相同)
如果設定了位 3,則捕獲目標是解碼器(與 param[0]=2 相同)
如果設定了位 4,則捕獲目標是主機
注意
此引數僅對 RAW 捕獲型別有意義。
9.1.2.6.3. CX2341X_ENC_STOP_CAPTURE¶
列舉:130/0x82
9.1.2.6.3.1. 描述¶
結束正在進行的捕獲
9.1.2.6.3.2. 引數[0]¶
0=在 GOP 結束時停止(生成 IRQ)
1=立即停止(無 IRQ)
9.1.2.6.3.3. 引數[1]¶
要停止的流型別,請參閱 API 0x81 的 param[0]
9.1.2.6.3.4. 引數[2]¶
子型別,請參閱 API 0x81 的 param[1]
9.1.2.6.4. CX2341X_ENC_SET_AUDIO_ID¶
列舉:137/0x89
9.1.2.6.4.1. 描述¶
分配編碼音訊流的傳輸流 ID
9.1.2.6.4.2. 引數[0]¶
音訊流 ID
9.1.2.6.5. CX2341X_ENC_SET_VIDEO_ID¶
列舉:139/0x8B
9.1.2.6.5.1. 描述¶
設定影片傳輸流 ID
9.1.2.6.5.2. Param[0]¶
影片流 ID
9.1.2.6.6. CX2341X_ENC_SET_PCR_ID¶
列舉: 141/0x8D
9.1.2.6.6.1. 描述¶
為 PCR 資料包分配傳輸流 ID
9.1.2.6.6.2. Param[0]¶
PCR 流 ID
9.1.2.6.7. CX2341X_ENC_SET_FRAME_RATE¶
列舉: 143/0x8F
9.1.2.6.7.1. 描述¶
設定影片幀率(每秒幀數)。更改發生在新的 GOP 開始時。
9.1.2.6.7.2. Param[0]¶
0=30fps
1=25fps
9.1.2.6.8. CX2341X_ENC_SET_FRAME_SIZE¶
列舉: 145/0x91
9.1.2.6.8.1. 描述¶
選擇影片流編碼解析度。
9.1.2.6.8.2. Param[0]¶
高度(行數)。預設值 480
9.1.2.6.8.3. Param[1]¶
寬度(畫素)。預設值 720
9.1.2.6.9. CX2341X_ENC_SET_BIT_RATE¶
列舉: 149/0x95
9.1.2.6.9.1. 描述¶
分配平均影片流位元率。
9.1.2.6.9.2. Param[0]¶
0=可變位元率,1=恆定位元率
9.1.2.6.9.3. Param[1]¶
位元率(位元/秒)
9.1.2.6.9.4. Param[2]¶
峰值位元率(位元/秒),除以 400
9.1.2.6.9.5. Param[3]¶
複用位元率(位元/秒),除以 400。可以為 0(預設)。
9.1.2.6.9.6. Param[4]¶
速率控制 VBR 填充
9.1.2.6.9.7. Param[5]¶
編碼器使用的 VBV 緩衝區
注意
Param[3] 和 Param[4] 似乎總是 0
Param[5] 似乎沒有被使用。
9.1.2.6.10. CX2341X_ENC_SET_GOP_PROPERTIES¶
列舉: 151/0x97
9.1.2.6.10.1. 描述¶
設定 GOP 結構
9.1.2.6.10.2. Param[0]¶
GOP 大小(最大值為 34)
9.1.2.6.10.3. Param[1]¶
I 幀和 P 幀之間的 B 幀數量,加 1。例如:IBBPBBPBBPBB --> GOP 大小:12,B 幀數量:2+1 = 3
注意
GOP 大小必須是 (B 幀 + 1) 的倍數。
9.1.2.6.11. CX2341X_ENC_SET_ASPECT_RATIO¶
列舉: 153/0x99
9.1.2.6.11.1. 描述¶
設定編碼寬高比。寬高比的更改在下一個 GOP 的開始生效。
9.1.2.6.11.2. Param[0]¶
‘0000’ 禁止
‘0001’ 1:1 正方形
‘0010’ 4:3
‘0011’ 16:9
‘0100’ 2.21:1
‘0101’ 到 ‘1111’ 保留
9.1.2.6.12. CX2341X_ENC_SET_DNR_FILTER_MODE¶
列舉: 155/0x9B
9.1.2.6.12.1. 描述¶
分配動態噪聲降低操作模式
9.1.2.6.12.2. Param[0]¶
Bit0: 空間濾波器,set=自動,clear=手動 Bit1: 時間濾波器,set=自動,clear=手動
9.1.2.6.12.3. Param[1]¶
中值濾波器
0=停用
1=水平
2=垂直
3=水平/垂直
4=對角線
9.1.2.6.13. CX2341X_ENC_SET_DNR_FILTER_PROPS¶
列舉: 157/0x9D
9.1.2.6.13.1. 描述¶
這些動態噪聲降低濾波器值僅在相應的濾波器設定為“手動”時才有意義(請參見 API 0x9B)
9.1.2.6.13.2. Param[0]¶
空間濾波器:預設值 0,範圍 0:15
9.1.2.6.13.3. Param[1]¶
時間濾波器:預設值 0,範圍 0:31
9.1.2.6.14. CX2341X_ENC_SET_CORING_LEVELS¶
列舉: 159/0x9F
9.1.2.6.14.1. 描述¶
分配動態噪聲降低中值濾波器屬性。
9.1.2.6.14.2. Param[0]¶
高於該閾值時啟用亮度中值濾波器。預設值:0,範圍 0:255
9.1.2.6.14.3. Param[1]¶
低於該閾值時啟用亮度中值濾波器。預設值:255,範圍 0:255
9.1.2.6.14.4. Param[2]¶
高於該閾值時啟用色度中值濾波器。預設值:0,範圍 0:255
9.1.2.6.14.5. Param[3]¶
低於該閾值時啟用色度中值濾波器。預設值:255,範圍 0:255
9.1.2.6.15. CX2341X_ENC_SET_SPATIAL_FILTER_TYPE¶
列舉: 161/0xA1
9.1.2.6.15.1. 描述¶
分配空間預濾波器引數
9.1.2.6.15.2. Param[0]¶
亮度濾波器
0=關閉
1=1D 水平
2=1D 垂直
3=2D 水平/垂直可分離(預設)
4=2D 對稱不可分離
9.1.2.6.15.3. Param[1]¶
色度濾波器
0=關閉
1=1D 水平(預設)
9.1.2.6.16. CX2341X_ENC_SET_VBI_LINE¶
列舉: 183/0xB7
9.1.2.6.16.1. 描述¶
選擇 VBI 行號。
9.1.2.6.16.2. Param[0]¶
Bits 0:4 行號
Bit 31 0=頂場, 1=底場
Bits 0:31 全部設定為“所有行”
9.1.2.6.16.3. Param[1]¶
VBI 行資訊功能:0=停用,1=啟用
9.1.2.6.16.4. Param[2]¶
切片:0=無,1=隱藏字幕 幾乎可以肯定未實現。設定為 0。
9.1.2.6.16.5. Param[3]¶
此行中的亮度樣本。幾乎可以肯定未實現。設定為 0。
9.1.2.6.16.6. Param[4]¶
此行中的色度樣本 幾乎可以肯定未實現。設定為 0。
9.1.2.6.17. CX2341X_ENC_SET_STREAM_TYPE¶
列舉: 185/0xB9
9.1.2.6.17.1. 描述¶
分配流型別
注意
傳輸流在最近的韌體中不起作用。並且在較舊的韌體中,TS 中的時間戳似乎不可靠。
9.1.2.6.17.2. Param[0]¶
0=程式流
1=傳輸流
2=MPEG1 流
3=PES A/V 流
5=PES 影片流
7=PES 音訊流
10=DVD 流
11=VCD 流
12=SVCD 流
13=DVD_S1 流
14=DVD_S2 流
9.1.2.6.18. CX2341X_ENC_SET_OUTPUT_PORT¶
列舉: 187/0xBB
9.1.2.6.18.1. 描述¶
分配流輸出埠。通常,當資料透過 PCI 匯流排(DMA)複製時為 0,而當資料流傳輸到另一個晶片(pvrusb 和 cx88-blackbird)時為 1。
9.1.2.6.18.2. Param[0]¶
0=記憶體(預設)
1=流式傳輸
2=序列
9.1.2.6.18.3. Param[1]¶
未知,但將其保留為 0 似乎效果最好。有跡象表明這可能與 USB 支援有關,儘管傳遞除 0 以外的任何內容只會破壞它。
9.1.2.6.19. CX2341X_ENC_SET_AUDIO_PROPERTIES¶
列舉: 189/0xBD
9.1.2.6.19.1. 描述¶
設定音訊流屬性,可以在編碼過程中呼叫。
注意
除了 bits 2:3 之外,所有位域都與 ISO11172 文件一致,ISO 文件將 bits 2:3 定義為
‘11’ Layer I
‘10’ Layer II
‘01’ Layer III
‘00’ 未定義
這種差異可能表明文件中存在可能的錯誤。測試表明,實際上只有 Layer II 在工作,並且最小位元率應為 192 kbps。
9.1.2.6.19.2. Param[0]¶
位掩碼
0:1 '00' 44.1Khz
'01' 48Khz
'10' 32Khz
'11' reserved
2:3 '01'=Layer I
'10'=Layer II
4:7 Bitrate:
Index | Layer I | Layer II
------+-------------+------------
'0000' | free format | free format
'0001' | 32 kbit/s | 32 kbit/s
'0010' | 64 kbit/s | 48 kbit/s
'0011' | 96 kbit/s | 56 kbit/s
'0100' | 128 kbit/s | 64 kbit/s
'0101' | 160 kbit/s | 80 kbit/s
'0110' | 192 kbit/s | 96 kbit/s
'0111' | 224 kbit/s | 112 kbit/s
'1000' | 256 kbit/s | 128 kbit/s
'1001' | 288 kbit/s | 160 kbit/s
'1010' | 320 kbit/s | 192 kbit/s
'1011' | 352 kbit/s | 224 kbit/s
'1100' | 384 kbit/s | 256 kbit/s
'1101' | 416 kbit/s | 320 kbit/s
'1110' | 448 kbit/s | 384 kbit/s
.. note::
For Layer II, not all combinations of total bitrate
and mode are allowed. See ISO11172-3 3-Annex B,
Table 3-B.2
8:9 '00'=Stereo
'01'=JointStereo
'10'=Dual
'11'=Mono
.. note::
The cx23415 cannot decode Joint Stereo properly.
10:11 Mode Extension used in joint_stereo mode.
In Layer I and II they indicate which subbands are in
intensity_stereo. All other subbands are coded in stereo.
'00' subbands 4-31 in intensity_stereo, bound==4
'01' subbands 8-31 in intensity_stereo, bound==8
'10' subbands 12-31 in intensity_stereo, bound==12
'11' subbands 16-31 in intensity_stereo, bound==16
12:13 Emphasis:
'00' None
'01' 50/15uS
'10' reserved
'11' CCITT J.17
14 CRC:
'0' off
'1' on
15 Copyright:
'0' off
'1' on
16 Generation:
'0' copy
'1' original
9.1.2.6.20. CX2341X_ENC_HALT_FW¶
列舉: 195/0xC3
9.1.2.6.20.1. 描述¶
韌體停止執行,並且在再次上傳韌體之前,不會處理任何進一步的 API 呼叫。
9.1.2.6.21. CX2341X_ENC_GET_VERSION¶
列舉: 196/0xC4
9.1.2.6.21.1. 描述¶
返回編碼器韌體的版本。
9.1.2.6.21.2. Result[0]¶
版本位掩碼:- Bits 0:15 build - Bits 16:23 minor - Bits 24:31 major
9.1.2.6.22. CX2341X_ENC_SET_GOP_CLOSURE¶
列舉: 197/0xC5
9.1.2.6.22.1. 描述¶
分配 GOP 開啟/關閉屬性。
9.1.2.6.22.2. Param[0]¶
0=開啟
1=關閉
9.1.2.6.23. CX2341X_ENC_GET_SEQ_END¶
列舉: 198/0xC6
9.1.2.6.23.1. 描述¶
獲取編碼器緩衝區的序列結束程式碼。當啟動捕獲時,仍會生成許多中斷,其中最後一箇中斷的 Result[0] 設定為 1,Result[1] 將包含緩衝區的大小。
9.1.2.6.23.2. Result[0]¶
傳輸狀態(如果為最後一個緩衝區,則為 1)
9.1.2.6.23.3. Result[1]¶
如果 Result[0] 為 1,則此欄位包含最後一個緩衝區的大小,否則未定義。
9.1.2.6.24. CX2341X_ENC_SET_PGM_INDEX_INFO¶
列舉: 199/0xC7
9.1.2.6.24.1. 描述¶
設定程式索引資訊。資訊儲存如下
struct info {
u32 length; // Length of this frame
u32 offset_low; // Offset in the file of the
u32 offset_high; // start of this frame
u32 mask1; // Bits 0-2 are the type mask:
// 1=I, 2=P, 4=B
// 0=End of Program Index, other fields
// are invalid.
u32 pts; // The PTS of the frame
u32 mask2; // Bit 0 is bit 32 of the pts.
};
u32 table_ptr;
struct info index[400];
table_ptr 是表中將寫入新條目的編碼器記憶體地址。
注意
這是一個環形緩衝區,因此 table_ptr 將回繞。
9.1.2.6.24.2. Param[0]¶
圖片掩碼:- 0=不進行索引捕獲 - 1=I 幀 - 3=I,P 幀 - 7=I,P,B 幀
(似乎被忽略,它總是索引 I、P 和 B 幀)
9.1.2.6.24.3. Param[1]¶
請求的元素數量(最多 400 個)
9.1.2.6.24.4. Result[0]¶
表開始處在編碼器記憶體中的偏移量。
9.1.2.6.24.5. Result[1]¶
分配的元素數量,最多為 Param[1]
9.1.2.6.25. CX2341X_ENC_SET_VBI_CONFIG¶
列舉: 200/0xC8
9.1.2.6.25.1. 描述¶
配置 VBI 設定
9.1.2.6.25.2. Param[0]¶
點陣圖
0 Mode '0' Sliced, '1' Raw
1:3 Insertion:
'000' insert in extension & user data
'001' insert in private packets
'010' separate stream and user data
'111' separate stream and private data
8:15 Stream ID (normally 0xBD)
9.1.2.6.25.3. Param[1]¶
每次中斷的幀數 (最大為 8)。僅在原始模式下有效。
9.1.2.6.25.4. Param[2]¶
原始 VBI 總幀數。僅在原始模式下有效。
9.1.2.6.25.5. Param[3]¶
起始程式碼
9.1.2.6.25.6. Param[4]¶
停止程式碼
9.1.2.6.25.7. Param[5]¶
每幀的行數
9.1.2.6.25.8. Param[6]¶
每行的位元組數
9.1.2.6.25.9. Result[0]¶
僅在原始模式下觀察到的每次中斷的幀數。範圍 1 到 Param[1]
9.1.2.6.25.10. Result[1]¶
在原始模式下觀察到的幀數。範圍 1 到 Param[2]
9.1.2.6.25.11. Result[2]¶
到原始 VBI 資料的記憶體偏移量
9.1.2.6.26. CX2341X_ENC_SET_DMA_BLOCK_SIZE¶
列舉: 201/0xC9
9.1.2.6.26.1. 描述¶
設定 DMA 傳輸塊大小
9.1.2.6.26.2. Param[0]¶
以位元組或幀為單位的 DMA 傳輸塊大小。當單位為位元組時,支援的塊大小為 2^7、2^8 和 2^9 位元組。
9.1.2.6.26.3. Param[1]¶
單位:0=位元組,1=幀
9.1.2.6.27. CX2341X_ENC_GET_PREV_DMA_INFO_MB_10¶
列舉: 202/0xCA
9.1.2.6.27.1. 描述¶
返回有關先前 DMA 傳輸的資訊,並結合中斷掩碼的位 27。 使用郵箱 10。
9.1.2.6.27.2. Result[0]¶
流型別
9.1.2.6.27.3. Result[1]¶
地址偏移
9.1.2.6.27.4. Result[2]¶
最大傳輸大小
9.1.2.6.28. CX2341X_ENC_GET_PREV_DMA_INFO_MB_9¶
列舉: 203/0xCB
9.1.2.6.28.1. 描述¶
返回有關先前 DMA 傳輸的資訊,並結合中斷掩碼的位 27 或 18。 使用郵箱 9。
9.1.2.6.28.2. Result[0]¶
狀態位:- 0 讀取完成 - 1 寫入完成 - 2 DMA 讀取錯誤 - 3 DMA 寫入錯誤 - 4 散佈-聚集陣列錯誤
9.1.2.6.28.3. Result[1]¶
DMA 型別
9.1.2.6.28.4. Result[2]¶
表示時間戳位 0..31
9.1.2.6.28.5. Result[3]¶
表示時間戳位 32
9.1.2.6.29. CX2341X_ENC_SCHED_DMA_TO_HOST¶
列舉: 204/0xCC
9.1.2.6.29.1. 描述¶
設定 DMA 到主機操作
9.1.2.6.29.2. Param[0]¶
連結列表的記憶體地址
9.1.2.6.29.3. Param[1]¶
連結列表的長度(wtf:什麼單位 ???)
9.1.2.6.29.4. Param[2]¶
DMA 型別 (0=MPEG)
9.1.2.6.30. CX2341X_ENC_INITIALIZE_INPUT¶
列舉: 205/0xCD
9.1.2.6.30.1. 描述¶
初始化影片輸入
9.1.2.6.31. CX2341X_ENC_SET_FRAME_DROP_RATE¶
列舉: 208/0xD0
9.1.2.6.31.1. 描述¶
對於捕獲的每幀,跳過指定數量的幀。
9.1.2.6.31.2. Param[0]¶
要跳過的幀數
9.1.2.6.32. CX2341X_ENC_PAUSE_ENCODER¶
列舉: 210/0xD2
9.1.2.6.32.1. 描述¶
在暫停狀態期間,所有幀都被丟棄,而不是被編碼。
9.1.2.6.32.2. Param[0]¶
0=暫停編碼
1=繼續編碼
9.1.2.6.33. CX2341X_ENC_REFRESH_INPUT¶
列舉: 211/0xD3
9.1.2.6.33.1. 描述¶
重新整理影片輸入
9.1.2.6.34. CX2341X_ENC_SET_COPYRIGHT¶
列舉: 212/0xD4
9.1.2.6.34.1. 描述¶
設定流版權屬性
9.1.2.6.34.2. Param[0]¶
0=流未受版權保護
1=流受版權保護
9.1.2.6.35. CX2341X_ENC_SET_EVENT_NOTIFICATION¶
列舉: 213/0xD5
9.1.2.6.35.1. 描述¶
設定韌體以通知主機有關特定事件。 主機必須取消遮蔽中斷位。
9.1.2.6.35.2. Param[0]¶
事件(0=重新整理編碼器輸入)
9.1.2.6.35.3. Param[1]¶
通知 0=停用 1=啟用
9.1.2.6.35.4. Param[2]¶
中斷位
9.1.2.6.35.5. Param[3]¶
郵箱槽,如果不需要郵箱則為 -1。
9.1.2.6.36. CX2341X_ENC_SET_NUM_VSYNC_LINES¶
列舉: 214/0xD6
9.1.2.6.36.1. 描述¶
根據使用的模擬影片解碼器,此方法分配場 1 和 2 的行數。
9.1.2.6.36.2. Param[0]¶
場 1 行數:- SAA7114 為 0x00EF - SAA7115 為 0x00F0 - Micronas 為 0x0105
9.1.2.6.36.3. Param[1]¶
場 2 行數:- SAA7114 為 0x00EF - SAA7115 為 0x00F0 - Micronas 為 0x0106
9.1.2.6.37. CX2341X_ENC_SET_PLACEHOLDER¶
列舉: 215/0xD7
9.1.2.6.37.1. 描述¶
提供了一種在 MPEG 流中插入自定義使用者資料的方法。
9.1.2.6.37.2. Param[0]¶
0=擴充套件 & 使用者資料
1=流 ID 為 0xBD 的私有資料包
9.1.2.6.37.3. Param[1]¶
插入資料的速率,以幀(對於私有資料包)或 GOP(對於擴充套件 & 使用者資料)為單位
9.1.2.6.37.4. Param[2]¶
要插入的資料 DWORD(如下)的數量
9.1.2.6.37.5. Param[3]¶
自定義資料 0
9.1.2.6.37.6. Param[4]¶
自定義資料 1
9.1.2.6.37.7. Param[5]¶
自定義資料 2
9.1.2.6.37.8. Param[6]¶
自定義資料 3
9.1.2.6.37.9. Param[7]¶
自定義資料 4
9.1.2.6.37.10. Param[8]¶
自定義資料 5
9.1.2.6.37.11. Param[9]¶
自定義資料 6
9.1.2.6.37.12. Param[10]¶
自定義資料 7
9.1.2.6.37.13. Param[11]¶
自定義資料 8
9.1.2.6.38. CX2341X_ENC_MUTE_VIDEO¶
列舉: 217/0xD9
9.1.2.6.38.1. 描述¶
影片靜音
9.1.2.6.38.2. Param[0]¶
位用法
0 '0'=video not muted
'1'=video muted, creates frames with the YUV color defined below
1:7 Unused
8:15 V chrominance information
16:23 U chrominance information
24:31 Y luminance information
9.1.2.6.39. CX2341X_ENC_MUTE_AUDIO¶
列舉: 218/0xDA
9.1.2.6.39.1. 描述¶
音訊靜音
9.1.2.6.39.2. Param[0]¶
0=音訊未靜音
1=音訊已靜音(產生靜音的 mpeg 音訊流)
9.1.2.6.40. CX2341X_ENC_SET_VERT_CROP_LINE¶
列舉: 219/0xDB
9.1.2.6.40.1. 描述¶
與“垂直裁剪線”有關
9.1.2.6.40.2. Param[0]¶
如果 saa7114 和原始 VBI 捕獲且 60 Hz,則設定為 10001。否則為 0。
9.1.2.6.41. CX2341X_ENC_MISC¶
列舉: 220/0xDC
9.1.2.6.41.1. 描述¶
雜項操作。 100% 不知道它做什麼。 它實際上是一種 ioctl 呼叫。 第一個引數是命令號,第二個是值。
9.1.2.6.41.2. Param[0]¶
命令號
1=set initial SCR value when starting encoding (works).
2=set quality mode (apparently some test setting).
3=setup advanced VIM protection handling.
Always 1 for the cx23416 and 0 for cx23415.
4=generate DVD compatible PTS timestamps
5=USB flush mode
6=something to do with the quantization matrix
7=set navigation pack insertion for DVD: adds 0xbf (private stream 2)
packets to the MPEG. The size of these packets is 2048 bytes (including
the header of 6 bytes: 0x000001bf + length). The payload is zeroed and
it is up to the application to fill them in. These packets are apparently
inserted every four frames.
8=enable scene change detection (seems to be a failure)
9=set history parameters of the video input module
10=set input field order of VIM
11=set quantization matrix
12=reset audio interface after channel change or input switch (has no argument).
Needed for the cx2584x, not needed for the mspx4xx, but it doesn't seem to
do any harm calling it regardless.
13=set audio volume delay
14=set audio delay
9.1.2.6.41.3. Param[1]¶
命令值。
9.1.2.7. 解碼器韌體 API 描述¶
注意
此 API 是解碼器韌體的一部分,因此僅適用於 cx23415。
9.1.2.7.1. CX2341X_DEC_PING_FW¶
列舉: 0/0x00
9.1.2.7.1.1. 描述¶
此 API 呼叫不執行任何操作。 它可用於檢查韌體是否響應。
9.1.2.7.2. CX2341X_DEC_START_PLAYBACK¶
列舉: 1/0x01
9.1.2.7.2.1. 描述¶
開始或恢復播放。
9.1.2.7.2.2. Param[0]¶
GOP 中從 0 開始的幀號,從此開始播放。
9.1.2.7.2.3. Param[1]¶
指定在恢復正常音訊之前要播放的靜音音訊幀數。(這在韌體中未實現,請保留為 0)
9.1.2.7.3. CX2341X_DEC_STOP_PLAYBACK¶
列舉: 2/0x02
9.1.2.7.3.1. 描述¶
結束播放並清除所有解碼器緩衝區。 如果 PTS 不為零,則播放將在指定的 PTS 處停止。
9.1.2.7.3.2. Param[0]¶
顯示 0=最後一幀,1=黑色
注意
這會立即生效,因此,如果要等待 PTS,則使用“0”,否則螢幕會立即變黑。 您可以稍後(即使沒有播放)使用值 1 呼叫此函式,以將螢幕設定為黑色。
9.1.2.7.3.3. Param[1]¶
PTS 低
9.1.2.7.3.4. Param[2]¶
PTS 高
9.1.2.7.4. CX2341X_DEC_SET_PLAYBACK_SPEED¶
列舉: 3/0x03
9.1.2.7.4.1. 描述¶
以非正常速度播放流。 有兩種操作模式
平滑:主機傳輸整個流,韌體丟棄未使用的幀。
粗略:主機根據索引刪除幀,以達到所需的速度。
9.1.2.7.4.2. Param[0]¶
Bitmap:
0:7 0 normal
1 fast only "1.5 times"
n nX fast, 1/nX slow
30 Framedrop:
'0' during 1.5 times play, every other B frame is dropped
'1' during 1.5 times play, stream is unchanged (bitrate
must not exceed 8mbps)
31 Speed:
'0' slow
'1' fast
注意
n 限制為 2。任何更高的值都不會導致更快的播放速度。相反,主機應該開始丟幀。
9.1.2.7.4.3. Param[1]¶
方向:0=向前,1=向後
注意
要使倒放功能正常工作,您必須按相反順序寫入完整的 GOP。
9.1.2.7.4.4. Param[2]¶
Picture mask:
1=I frames
3=I, P frames
7=I, P, B frames
9.1.2.7.4.5. Param[3]¶
每個 GOP 的 B 幀數(僅用於倒放)
注意
對於倒放,Picture Mask 應設定為 I 或 I, P。將 B 幀新增到 Mask 中會導致影片損壞。必須將此欄位設定為正確的值才能保持正確的時序。
9.1.2.7.4.6. Param[4]¶
音訊靜音:0=停用,1=啟用
9.1.2.7.4.7. Param[5]¶
顯示 0=幀,1=場
9.1.2.7.4.8. Param[6]¶
指定在恢復正常音訊之前要播放的靜音音訊幀數。(韌體中未實現,保留為 0)
9.1.2.7.5. CX2341X_DEC_STEP_VIDEO¶
列舉:5/0x05
9.1.2.7.5.1. 描述¶
每次呼叫此 API 都會將播放步進到當前播放方向中定義的下一個單元。
9.1.2.7.5.2. Param[0]¶
0=幀,1=頂場,2=底場
9.1.2.7.6. CX2341X_DEC_SET_DMA_BLOCK_SIZE¶
列舉:8/0x08
9.1.2.7.6.1. 描述¶
設定 DMA 傳輸塊大小。API 0xC9 的對應項
9.1.2.7.6.2. Param[0]¶
DMA 傳輸塊大小(以位元組為單位)。發出 DMA 傳輸命令時可以指定不同的大小。
9.1.2.7.7. CX2341X_DEC_GET_XFER_INFO¶
列舉:9/0x09
9.1.2.7.7.1. 描述¶
此 API 呼叫可用於檢測流結束狀態。
9.1.2.7.7.2. Result[0]¶
流型別
9.1.2.7.7.3. Result[1]¶
地址偏移量
9.1.2.7.7.4. Result[2]¶
要傳輸的最大位元組數
9.1.2.7.7.5. Result[3]¶
緩衝區滿度
9.1.2.7.8. CX2341X_DEC_GET_DMA_STATUS¶
列舉:10/0x0A
9.1.2.7.8.1. 描述¶
上次 DMA 傳輸的狀態
9.1.2.7.8.2. Result[0]¶
位 1 置位表示傳輸完成 位 2 置位表示 DMA 錯誤 位 3 置位表示連結串列錯誤
9.1.2.7.8.3. Result[1]¶
DMA 型別:0=MPEG,1=OSD,2=YUV
9.1.2.7.9. CX2341X_DEC_SCHED_DMA_FROM_HOST¶
列舉:11/0x0B
9.1.2.7.9.1. 描述¶
設定從主機操作的 DMA。API 0xCC 的對應項
9.1.2.7.9.2. Param[0]¶
連結列表的記憶體地址
9.1.2.7.9.3. Param[1]¶
要傳輸的總位元組數
9.1.2.7.9.4. Param[2]¶
DMA 型別(0=MPEG,1=OSD,2=YUV)
9.1.2.7.10. CX2341X_DEC_PAUSE_PLAYBACK¶
列舉:13/0x0D
9.1.2.7.10.1. 描述¶
立即凍結播放。在此模式下,當內部緩衝區已滿時,將不再接受任何資料,並且資料請求 IRQ 將被遮蔽。
9.1.2.7.10.2. Param[0]¶
顯示:0=最後一幀,1=黑色
9.1.2.7.11. CX2341X_DEC_HALT_FW¶
列舉:14/0x0E
9.1.2.7.11.1. 描述¶
韌體停止執行,並且在再次上傳韌體之前,不會處理任何進一步的 API 呼叫。
9.1.2.7.12. CX2341X_DEC_SET_STANDARD¶
列舉:16/0x10
9.1.2.7.12.1. 描述¶
選擇顯示標準
9.1.2.7.12.2. Param[0]¶
0=NTSC,1=PAL
9.1.2.7.13. CX2341X_DEC_GET_VERSION¶
列舉:17/0x11
9.1.2.7.13.1. 描述¶
返回解碼器韌體版本資訊
9.1.2.7.13.2. Result[0]¶
- 版本位掩碼
位 0:15 構建
位 16:23 次要
位 24:31 主要
9.1.2.7.14. CX2341X_DEC_SET_STREAM_INPUT¶
列舉:20/0x14
9.1.2.7.14.1. 描述¶
選擇解碼器流輸入埠
9.1.2.7.14.2. Param[0]¶
0=記憶體(預設),1=流式傳輸
9.1.2.7.15. CX2341X_DEC_GET_TIMING_INFO¶
列舉:21/0x15
9.1.2.7.15.1. 描述¶
從播放開始返回時序資訊
9.1.2.7.15.2. Result[0]¶
按解碼順序的幀計數
9.1.2.7.15.3. Result[1]¶
按顯示順序的影片 PTS 位 0:31
9.1.2.7.15.4. Result[2]¶
按顯示順序的影片 PTS 位 32
9.1.2.7.15.5. Result[3]¶
按顯示順序的 SCR 位 0:31
9.1.2.7.15.6. Result[4]¶
按顯示順序的 SCR 位 32
9.1.2.7.16. CX2341X_DEC_SET_AUDIO_MODE¶
列舉:22/0x16
9.1.2.7.16.1. 描述¶
選擇音訊模式
9.1.2.7.16.2. Param[0]¶
- 雙聲道模式操作
0=立體聲,1=左,2=右,3=單聲道,4=交換,-1=不變
9.1.2.7.16.3. Param[1]¶
- 立體聲模式操作
0=立體聲,1=左,2=右,3=單聲道,4=交換,-1=不變
9.1.2.7.17. CX2341X_DEC_SET_EVENT_NOTIFICATION¶
列舉:23/0x17
9.1.2.7.17.1. 描述¶
設定韌體以通知主機有關特定事件。API 0xD5 的對應項
9.1.2.7.17.2. Param[0]¶
- 事件
0=單聲道、(聯合) 立體聲和雙聲道之間的音訊模式更改。
3=解碼器已啟動
4=未知:解碼時每秒關閉 10-15 次。
5=某些同步事件:每幀關閉一次。
9.1.2.7.17.3. Param[1]¶
通知 0=停用,1=啟用
9.1.2.7.17.4. Param[2]¶
中斷位
9.1.2.7.17.5. Param[3]¶
郵箱槽,如果不需要郵箱則為 -1。
9.1.2.7.18. CX2341X_DEC_SET_DISPLAY_BUFFERS¶
列舉:24/0x18
9.1.2.7.18.1. 描述¶
顯示緩衝區數。要以倒放方式解碼所有幀,必須使用九個緩衝區。
9.1.2.7.18.2. Param[0]¶
0=六個緩衝區,1=九個緩衝區
9.1.2.7.19. CX2341X_DEC_EXTRACT_VBI¶
列舉:25/0x19
9.1.2.7.19.1. 描述¶
提取 VBI 資料
9.1.2.7.19.2. Param[0]¶
0=從擴充套件資料和使用者資料中提取,1=從專用資料包中提取
9.1.2.7.19.3. Result[0]¶
VBI 表位置
9.1.2.7.19.4. Result[1]¶
VBI 表大小
9.1.2.7.20. CX2341X_DEC_SET_DECODER_SOURCE¶
列舉:26/0x1A
9.1.2.7.20.1. 描述¶
選擇解碼器源。確保傳遞給此 API 的引數與編碼器設定匹配。
9.1.2.7.20.2. Param[0]¶
模式:0=來自主機的 MPEG,1=來自編碼器的 YUV,2=來自主機的 YUV
9.1.2.7.20.3. Param[1]¶
YUV 圖片寬度
9.1.2.7.20.4. Param[2]¶
YUV 圖片高度
9.1.2.7.20.5. Param[3]¶
點陣圖:請參閱 API 0xBD 的 Param[0]
9.1.2.7.21. CX2341X_DEC_SET_PREBUFFERING¶
列舉:30/0x1E
9.1.2.7.21.1. 描述¶
解碼器預緩衝,啟用後,對於流 <8mpbs,最多緩衝 128KB,對於流 >8mbps,緩衝 640KB
9.1.2.7.21.2. Param[0]¶
0=關閉,1=開啟
9.1.2.8. PVR350 影片解碼器暫存器 0x02002800 -> 0x02002B00¶
作者:Ian Armstrong <ian@iarmst.demon.co.uk>
版本:v0.4
日期:2007 年 3 月 12 日
此列表是透過反覆試驗得出的。會有錯誤和遺漏。一些暫存器沒有明顯的效果,因此很難說它們的作用,而另一些暫存器則相互作用,或者需要特定的載入順序。水平濾波器設定就是一個例子,有六個暫存器協同工作,需要特定的載入順序才能正確配置。索引顏色調色盤的設定要容易得多,只需要兩個暫存器,但同樣需要特定的載入順序。
某些暫存器對它們的設定很挑剔。載入一個壞值 & 解碼器將失敗。韌體重新載入通常可以恢復,但有時需要重置。對於包含大小資訊的暫存器,通常將它們設定為 0 是一個壞主意。對於其他控制暫存器,即 2878,只有在掛起時才會發現哪些值是錯誤的。
--------------------------------------------------------------------------------
2800
bit 0
Decoder enable
0 = disable
1 = enable
--------------------------------------------------------------------------------
2804
bits 0:31
Decoder horizontal Y alias register 1
---------------
2808
bits 0:31
Decoder horizontal Y alias register 2
---------------
280C
bits 0:31
Decoder horizontal Y alias register 3
---------------
2810
bits 0:31
Decoder horizontal Y alias register 4
---------------
2814
bits 0:31
Decoder horizontal Y alias register 5
---------------
2818
bits 0:31
Decoder horizontal Y alias trigger
These six registers control the horizontal aliasing filter for the Y plane.
The first five registers must all be loaded before accessing the trigger
(2818), as this register actually clocks the data through for the first
five.
To correctly program set the filter, this whole procedure must be done 16
times. The actual register contents are copied from a lookup-table in the
firmware which contains 4 different filter settings.
--------------------------------------------------------------------------------
281C
bits 0:31
Decoder horizontal UV alias register 1
---------------
2820
bits 0:31
Decoder horizontal UV alias register 2
---------------
2824
bits 0:31
Decoder horizontal UV alias register 3
---------------
2828
bits 0:31
Decoder horizontal UV alias register 4
---------------
282C
bits 0:31
Decoder horizontal UV alias register 5
---------------
2830
bits 0:31
Decoder horizontal UV alias trigger
These six registers control the horizontal aliasing for the UV plane.
Operation is the same as the Y filter, with 2830 being the trigger
register.
--------------------------------------------------------------------------------
2834
bits 0:15
Decoder Y source width in pixels
bits 16:31
Decoder Y destination width in pixels
---------------
2838
bits 0:15
Decoder UV source width in pixels
bits 16:31
Decoder UV destination width in pixels
NOTE: For both registers, the resulting image must be fully visible on
screen. If the image exceeds the right edge both the source and destination
size must be adjusted to reflect the visible portion. For the source width,
you must take into account the scaling when calculating the new value.
--------------------------------------------------------------------------------
283C
bits 0:31
Decoder Y horizontal scaling
Normally = Reg 2854 >> 2
---------------
2840
bits 0:31
Decoder ?? unknown - horizontal scaling
Usually 0x00080514
---------------
2844
bits 0:31
Decoder UV horizontal scaling
Normally = Reg 2854 >> 2
---------------
2848
bits 0:31
Decoder ?? unknown - horizontal scaling
Usually 0x00100514
---------------
284C
bits 0:31
Decoder ?? unknown - Y plane
Usually 0x00200020
---------------
2850
bits 0:31
Decoder ?? unknown - UV plane
Usually 0x00200020
---------------
2854
bits 0:31
Decoder 'master' value for horizontal scaling
---------------
2858
bits 0:31
Decoder ?? unknown
Usually 0
---------------
285C
bits 0:31
Decoder ?? unknown
Normally = Reg 2854 >> 1
---------------
2860
bits 0:31
Decoder ?? unknown
Usually 0
---------------
2864
bits 0:31
Decoder ?? unknown
Normally = Reg 2854 >> 1
---------------
2868
bits 0:31
Decoder ?? unknown
Usually 0
Most of these registers either control horizontal scaling, or appear linked
to it in some way. Register 2854 contains the 'master' value & the other
registers can be calculated from that one. You must also remember to
correctly set the divider in Reg 2874.
To enlarge:
Reg 2854 = (source_width * 0x00200000) / destination_width
Reg 2874 = No divide
To reduce from full size down to half size:
Reg 2854 = (source_width/2 * 0x00200000) / destination width
Reg 2874 = Divide by 2
To reduce from half size down to quarter size:
Reg 2854 = (source_width/4 * 0x00200000) / destination width
Reg 2874 = Divide by 4
The result is always rounded up.
--------------------------------------------------------------------------------
286C
bits 0:15
Decoder horizontal Y buffer offset
bits 15:31
Decoder horizontal UV buffer offset
Offset into the video image buffer. If the offset is gradually incremented,
the on screen image will move left & wrap around higher up on the right.
--------------------------------------------------------------------------------
2870
bits 0:15
Decoder horizontal Y output offset
bits 16:31
Decoder horizontal UV output offset
Offsets the actual video output. Controls output alignment of the Y & UV
planes. The higher the value, the greater the shift to the left. Use
reg 2890 to move the image right.
--------------------------------------------------------------------------------
2874
bits 0:1
Decoder horizontal Y output size divider
00 = No divide
01 = Divide by 2
10 = Divide by 3
bits 4:5
Decoder horizontal UV output size divider
00 = No divide
01 = Divide by 2
10 = Divide by 3
bit 8
Decoder ?? unknown
0 = Normal
1 = Affects video output levels
bit 16
Decoder ?? unknown
0 = Normal
1 = Disable horizontal filter
--------------------------------------------------------------------------------
2878
bit 0
?? unknown
bit 1
osd on/off
0 = osd off
1 = osd on
bit 2
Decoder + osd video timing
0 = NTSC
1 = PAL
bits 3:4
?? unknown
bit 5
Decoder + osd
Swaps upper & lower fields
--------------------------------------------------------------------------------
287C
bits 0:10
Decoder & osd ?? unknown
Moves entire screen horizontally. Starts at 0x005 with the screen
shifted heavily to the right. Incrementing in steps of 0x004 will
gradually shift the screen to the left.
bits 11:31
?? unknown
Normally contents are 0x00101111 (NTSC) or 0x1010111d (PAL)
--------------------------------------------------------------------------------
2880 -------- ?? unknown
2884 -------- ?? unknown
--------------------------------------------------------------------------------
2888
bit 0
Decoder + osd ?? unknown
0 = Normal
1 = Misaligned fields (Correctable through 289C & 28A4)
bit 4
?? unknown
bit 8
?? unknown
Warning: Bad values will require a firmware reload to recover.
Known to be bad are 0x000,0x011,0x100,0x111
--------------------------------------------------------------------------------
288C
bits 0:15
osd ?? unknown
Appears to affect the osd position stability. The higher the value the
more unstable it becomes. Decoder output remains stable.
bits 16:31
osd ?? unknown
Same as bits 0:15
--------------------------------------------------------------------------------
2890
bits 0:11
Decoder output horizontal offset.
Horizontal offset moves the video image right. A small left shift is
possible, but it's better to use reg 2870 for that due to its greater
range.
NOTE: Video corruption will occur if video window is shifted off the right
edge. To avoid this read the notes for 2834 & 2838.
--------------------------------------------------------------------------------
2894
bits 0:23
Decoder output video surround colour.
Contains the colour (in yuv) used to fill the screen when the video is
running in a window.
--------------------------------------------------------------------------------
2898
bits 0:23
Decoder video window colour
Contains the colour (in yuv) used to fill the video window when the
video is turned off.
bit 24
Decoder video output
0 = Video on
1 = Video off
bit 28
Decoder plane order
0 = Y,UV
1 = UV,Y
bit 29
Decoder second plane byte order
0 = Normal (UV)
1 = Swapped (VU)
In normal usage, the first plane is Y & the second plane is UV. Though the
order of the planes can be swapped, only the byte order of the second plane
can be swapped. This isn't much use for the Y plane, but can be useful for
the UV plane.
--------------------------------------------------------------------------------
289C
bits 0:15
Decoder vertical field offset 1
bits 16:31
Decoder vertical field offset 2
Controls field output vertical alignment. The higher the number, the lower
the image on screen. Known starting values are 0x011E0017 (NTSC) &
0x01500017 (PAL)
--------------------------------------------------------------------------------
28A0
bits 0:15
Decoder & osd width in pixels
bits 16:31
Decoder & osd height in pixels
All output from the decoder & osd are disabled beyond this area. Decoder
output will simply go black outside of this region. If the osd tries to
exceed this area it will become corrupt.
--------------------------------------------------------------------------------
28A4
bits 0:11
osd left shift.
Has a range of 0x770->0x7FF. With the exception of 0, any value outside of
this range corrupts the osd.
--------------------------------------------------------------------------------
28A8
bits 0:15
osd vertical field offset 1
bits 16:31
osd vertical field offset 2
Controls field output vertical alignment. The higher the number, the lower
the image on screen. Known starting values are 0x011E0017 (NTSC) &
0x01500017 (PAL)
--------------------------------------------------------------------------------
28AC -------- ?? unknown
|
V
28BC -------- ?? unknown
--------------------------------------------------------------------------------
28C0
bit 0
Current output field
0 = first field
1 = second field
bits 16:31
Current scanline
The scanline counts from the top line of the first field
through to the last line of the second field.
--------------------------------------------------------------------------------
28C4 -------- ?? unknown
|
V
28F8 -------- ?? unknown
--------------------------------------------------------------------------------
28FC
bit 0
?? unknown
0 = Normal
1 = Breaks decoder & osd output
--------------------------------------------------------------------------------
2900
bits 0:31
Decoder vertical Y alias register 1
---------------
2904
bits 0:31
Decoder vertical Y alias register 2
---------------
2908
bits 0:31
Decoder vertical Y alias trigger
These three registers control the vertical aliasing filter for the Y plane.
Operation is similar to the horizontal Y filter (2804). The only real
difference is that there are only two registers to set before accessing
the trigger register (2908). As for the horizontal filter, the values are
taken from a lookup table in the firmware, and the procedure must be
repeated 16 times to fully program the filter.
--------------------------------------------------------------------------------
290C
bits 0:31
Decoder vertical UV alias register 1
---------------
2910
bits 0:31
Decoder vertical UV alias register 2
---------------
2914
bits 0:31
Decoder vertical UV alias trigger
These three registers control the vertical aliasing filter for the UV
plane. Operation is the same as the Y filter, with 2914 being the trigger.
--------------------------------------------------------------------------------
2918
bits 0:15
Decoder Y source height in pixels
bits 16:31
Decoder Y destination height in pixels
---------------
291C
bits 0:15
Decoder UV source height in pixels divided by 2
bits 16:31
Decoder UV destination height in pixels
NOTE: For both registers, the resulting image must be fully visible on
screen. If the image exceeds the bottom edge both the source and
destination size must be adjusted to reflect the visible portion. For the
source height, you must take into account the scaling when calculating the
new value.
--------------------------------------------------------------------------------
2920
bits 0:31
Decoder Y vertical scaling
Normally = Reg 2930 >> 2
---------------
2924
bits 0:31
Decoder Y vertical scaling
Normally = Reg 2920 + 0x514
---------------
2928
bits 0:31
Decoder UV vertical scaling
When enlarging = Reg 2930 >> 2
When reducing = Reg 2930 >> 3
---------------
292C
bits 0:31
Decoder UV vertical scaling
Normally = Reg 2928 + 0x514
---------------
2930
bits 0:31
Decoder 'master' value for vertical scaling
---------------
2934
bits 0:31
Decoder ?? unknown - Y vertical scaling
---------------
2938
bits 0:31
Decoder Y vertical scaling
Normally = Reg 2930
---------------
293C
bits 0:31
Decoder ?? unknown - Y vertical scaling
---------------
2940
bits 0:31
Decoder UV vertical scaling
When enlarging = Reg 2930 >> 1
When reducing = Reg 2930
---------------
2944
bits 0:31
Decoder ?? unknown - UV vertical scaling
---------------
2948
bits 0:31
Decoder UV vertical scaling
Normally = Reg 2940
---------------
294C
bits 0:31
Decoder ?? unknown - UV vertical scaling
Most of these registers either control vertical scaling, or appear linked
to it in some way. Register 2930 contains the 'master' value & all other
registers can be calculated from that one. You must also remember to
correctly set the divider in Reg 296C
To enlarge:
Reg 2930 = (source_height * 0x00200000) / destination_height
Reg 296C = No divide
To reduce from full size down to half size:
Reg 2930 = (source_height/2 * 0x00200000) / destination height
Reg 296C = Divide by 2
To reduce from half down to quarter.
Reg 2930 = (source_height/4 * 0x00200000) / destination height
Reg 296C = Divide by 4
--------------------------------------------------------------------------------
2950
bits 0:15
Decoder Y line index into display buffer, first field
bits 16:31
Decoder Y vertical line skip, first field
--------------------------------------------------------------------------------
2954
bits 0:15
Decoder Y line index into display buffer, second field
bits 16:31
Decoder Y vertical line skip, second field
--------------------------------------------------------------------------------
2958
bits 0:15
Decoder UV line index into display buffer, first field
bits 16:31
Decoder UV vertical line skip, first field
--------------------------------------------------------------------------------
295C
bits 0:15
Decoder UV line index into display buffer, second field
bits 16:31
Decoder UV vertical line skip, second field
--------------------------------------------------------------------------------
2960
bits 0:15
Decoder destination height minus 1
bits 16:31
Decoder destination height divided by 2
--------------------------------------------------------------------------------
2964
bits 0:15
Decoder Y vertical offset, second field
bits 16:31
Decoder Y vertical offset, first field
These two registers shift the Y plane up. The higher the number, the
greater the shift.
--------------------------------------------------------------------------------
2968
bits 0:15
Decoder UV vertical offset, second field
bits 16:31
Decoder UV vertical offset, first field
These two registers shift the UV plane up. The higher the number, the
greater the shift.
--------------------------------------------------------------------------------
296C
bits 0:1
Decoder vertical Y output size divider
00 = No divide
01 = Divide by 2
10 = Divide by 4
bits 8:9
Decoder vertical UV output size divider
00 = No divide
01 = Divide by 2
10 = Divide by 4
--------------------------------------------------------------------------------
2970
bit 0
Decoder ?? unknown
0 = Normal
1 = Affect video output levels
bit 16
Decoder ?? unknown
0 = Normal
1 = Disable vertical filter
--------------------------------------------------------------------------------
2974 -------- ?? unknown
|
V
29EF -------- ?? unknown
--------------------------------------------------------------------------------
2A00
bits 0:2
osd colour mode
000 = 8 bit indexed
001 = 16 bit (565)
010 = 15 bit (555)
011 = 12 bit (444)
100 = 32 bit (8888)
bits 4:5
osd display bpp
01 = 8 bit
10 = 16 bit
11 = 32 bit
bit 8
osd global alpha
0 = Off
1 = On
bit 9
osd local alpha
0 = Off
1 = On
bit 10
osd colour key
0 = Off
1 = On
bit 11
osd ?? unknown
Must be 1
bit 13
osd colour space
0 = ARGB
1 = AYVU
bits 16:31
osd ?? unknown
Must be 0x001B (some kind of buffer pointer ?)
When the bits-per-pixel is set to 8, the colour mode is ignored and
assumed to be 8 bit indexed. For 16 & 32 bits-per-pixel the colour depth
is honoured, and when using a colour depth that requires fewer bytes than
allocated the extra bytes are used as padding. So for a 32 bpp with 8 bit
index colour, there are 3 padding bytes per pixel. It's also possible to
select 16bpp with a 32 bit colour mode. This results in the pixel width
being doubled, but the color key will not work as expected in this mode.
Colour key is as it suggests. You designate a colour which will become
completely transparent. When using 565, 555 or 444 colour modes, the
colour key is always 16 bits wide. The colour to key on is set in Reg 2A18.
Local alpha works differently depending on the colour mode. For 32bpp & 8
bit indexed, local alpha is a per-pixel 256 step transparency, with 0 being
transparent and 255 being solid. For the 16bpp modes 555 & 444, the unused
bit(s) act as a simple transparency switch, with 0 being solid & 1 being
fully transparent. There is no local alpha support for 16bit 565.
Global alpha is a 256 step transparency that applies to the entire osd,
with 0 being transparent & 255 being solid.
It's possible to combine colour key, local alpha & global alpha.
--------------------------------------------------------------------------------
2A04
bits 0:15
osd x coord for left edge
bits 16:31
osd y coord for top edge
---------------
2A08
bits 0:15
osd x coord for right edge
bits 16:31
osd y coord for bottom edge
For both registers, (0,0) = top left corner of the display area. These
registers do not control the osd size, only where it's positioned & how
much is visible. The visible osd area cannot exceed the right edge of the
display, otherwise the osd will become corrupt. See reg 2A10 for
setting osd width.
--------------------------------------------------------------------------------
2A0C
bits 0:31
osd buffer index
An index into the osd buffer. Slowly incrementing this moves the osd left,
wrapping around onto the right edge
--------------------------------------------------------------------------------
2A10
bits 0:11
osd buffer 32 bit word width
Contains the width of the osd measured in 32 bit words. This means that all
colour modes are restricted to a byte width which is divisible by 4.
--------------------------------------------------------------------------------
2A14
bits 0:15
osd height in pixels
bits 16:32
osd line index into buffer
osd will start displaying from this line.
--------------------------------------------------------------------------------
2A18
bits 0:31
osd colour key
Contains the colour value which will be transparent.
--------------------------------------------------------------------------------
2A1C
bits 0:7
osd global alpha
Contains the global alpha value (equiv ivtvfbctl --alpha XX)
--------------------------------------------------------------------------------
2A20 -------- ?? unknown
|
V
2A2C -------- ?? unknown
--------------------------------------------------------------------------------
2A30
bits 0:7
osd colour to change in indexed palette
---------------
2A34
bits 0:31
osd colour for indexed palette
To set the new palette, first load the index of the colour to change into
2A30, then load the new colour into 2A34. The full palette is 256 colours,
so the index range is 0x00-0xFF
--------------------------------------------------------------------------------
2A38 -------- ?? unknown
2A3C -------- ?? unknown
--------------------------------------------------------------------------------
2A40
bits 0:31
osd ?? unknown
Affects overall brightness, wrapping around to black
--------------------------------------------------------------------------------
2A44
bits 0:31
osd ?? unknown
Green tint
--------------------------------------------------------------------------------
2A48
bits 0:31
osd ?? unknown
Red tint
--------------------------------------------------------------------------------
2A4C
bits 0:31
osd ?? unknown
Affects overall brightness, wrapping around to black
--------------------------------------------------------------------------------
2A50
bits 0:31
osd ?? unknown
Colour shift
--------------------------------------------------------------------------------
2A54
bits 0:31
osd ?? unknown
Colour shift
--------------------------------------------------------------------------------
2A58 -------- ?? unknown
|
V
2AFC -------- ?? unknown
--------------------------------------------------------------------------------
2B00
bit 0
osd filter control
0 = filter off
1 = filter on
bits 1:4
osd ?? unknown
--------------------------------------------------------------------------------
9.1.2.9. cx231xx DMA 引擎¶
此頁面描述了 cx2341x DMA 引擎使用的結構和過程。
9.1.2.9.1. 簡介¶
cx2341x PCI 介面具有匯流排控制能力。這意味著它有一個 DMA 引擎,可以有效地在卡和主記憶體之間傳輸大量資料,而無需 CPU 的幫助。像大多數硬體一樣,它必須在連續的物理記憶體上執行。這在虛擬記憶體機器上很難大量獲得。
因此,它還支援一種稱為“分散-收集”的技術。該卡可以在一個操作中傳輸多個緩衝區。驅動程式可以分配幾個較小的緩衝區,而不是分配一個大的連續緩衝區。
在實踐中,我看到平均傳輸大約為 80K,但在啟動時,超過 128K 的傳輸並不少見。128K 這個數字很重要,因為這是核心通常可以分配的最大塊。即便如此,128K 的塊也很難獲得,因此敦促驅動程式編寫者選擇較小的塊大小並學習分散-收集技術。
郵箱 #10 保留用於 DMA 傳輸資訊。
注意:硬體需要小端資料(“英特爾格式”)。
9.1.2.9.2. 流程¶
本節概括地描述了處理 DMA 傳輸時事件的順序。詳細資訊在本節之後。
該卡引發編碼器中斷。
驅動程式從郵箱 #10 讀取傳輸型別、偏移量和大小。
驅動程式從足夠多的空閒 dma 緩衝區構造分散-收集陣列以覆蓋大小。
驅動程式透過 ScheduleDMAtoHost API 呼叫排程 DMA 傳輸。
該卡引發 DMA 完成中斷。
驅動程式檢查 DMA 狀態暫存器是否存在任何錯誤。
驅動程式對新傳輸的緩衝區進行後處理。
注意!編碼器和 DMA 完成中斷可能會同時引發。(最後一個的結束,下一個的開始,等等)
9.1.2.9.3. 郵箱 #10¶
標誌、命令、返回值和超時欄位將被忽略。
名稱:郵箱 #10
結果[0]:型別:0:MPEG。
結果[1]:偏移量:相對於卡記憶體空間的位置。
結果[2]:大小:要傳輸的確切位元組數。
我的推測是,由於 StartCapture API 具有可用的“RAW”捕獲型別,因此型別欄位將具有與 YUV 和 PCM 資料相對應的其他值。
9.1.2.9.4. 分散-收集陣列¶
分散-收集陣列是連續分配的記憶體塊,它告訴卡要傳輸的每個資料塊的源和目標。卡“地址”源自郵箱 #10 提供的偏移量。主機地址是目標 DMA 緩衝區的物理記憶體位置。
每個 S-G 陣列元素都是一個包含三個 32 位字的結構體。第一個字是源地址,第二個字是目標地址。兩者都佔用整個 32 位。第三個字的最低 18 位是傳輸的位元組計數。第三個字的高位是“last”標誌。last 標誌告訴卡片觸發 DMA_DONE 中斷。根據痛苦的個人經驗,如果您忘記設定此位,卡片仍然會“工作”,但資料流很可能會被損壞。
傳輸計數必須是 256 的倍數。因此,驅動程式需要跟蹤目標緩衝區中有多少資料是有效的,並相應地處理它。
陣列元素
32 位源地址
32 位目標地址
14 位保留位(高位是 last 標誌)
18 位位元組計數
9.1.2.9.5. DMA 傳輸狀態¶
暫存器 0x0004 儲存 DMA 傳輸狀態
第 0 位:讀取完成
第 1 位:寫入完成
第 2 位:DMA 讀取錯誤
第 3 位:DMA 寫入錯誤
第 4 位:Scatter-Gather 陣列錯誤