hi:
meng,上次你提到
Resizer可以支持YUV420的缩放,但是需要Y和UV分别处理,目前代码没有支持。
我们想在dm8127的ISP模块实现420SP转420SP,能不能给个思路?我们自己会试着实现下
Chris Meng:
你好,
建议你阅读一下iss user guide里面resizer相关章节和寄存器。
网上有DM36x resizer 缩放yuv420到yuv420的例子代码,你也可以参考一下:http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/7583。DM36x resizer在缩放yuv420数据这部分原理和DM8127的resizer是一样的。
Aen Jone:
回复 Chris Meng:
我看了8127的配置寄存器好像只支持YUV422格式 的输入RSZ_420这个寄存器是这样描述的:
如果我们输入的420的源那要如何配置呢?
Chris Meng:
回复 Aen Jone:
你好,
请参考使用寄存器RSZ_SRC_FMT1。
Aen Jone:
回复 Chris Meng:
我发现 在dm8127 的IPNC RDK 3.5配置函数 Iss_ispControl里 YUV 420 input and YUV 420 output模式已经有支持
Iss_ispWriteReg(&rsz_reg->SRC_FMT1,0,0,1); // RAW -> Flipping preserves YCbCr format Iss_ispWriteReg(&rsz_reg->SRC_FMT1,1,1,1); // IN420 -> YUV4:2:0 is input
在RESIZE的帧处理函数Iss_ispProcessFrames 420输入-》420输出也是Y和UV单独处理的:
// Y resizing Iss_ispWriteReg(&rszA_reg->RZA_420,1,0,1); // YEN -> Y output enable and 422to420 conversion enabled Iss_ispWriteReg(&rszA_reg->RZA_420,0,1,1); // CEN -> C output disable
retVal = issSetRszOutAddress(RESIZER_A, RSZ_YUV420_Y_OP, outAddrAY, pObj->pitch0); // Wait for IPIPE and IPIPEIF to be free while(ipipeif_reg->IPIPEIF_ENABLE == 1); while(ipipe_reg->SRC_EN == 1);
// Trigger RSZ and IPIPEIF Iss_ispWriteReg(&rsz_reg->SRC_EN,1,0,1); Iss_ispWriteReg(&rszA_reg->RZA_EN,1,0,1); Iss_ispWriteReg(&rszB_reg->RZB_EN,0,0,1); Iss_ispWriteReg(&ipipe_reg->SRC_EN,1,0,1); Iss_ispWriteReg(&ipipeif_reg->IPIPEIF_ENABLE,1,0,1);
pObj->usrCbFlag = 1; Semaphore_pend(pObj->sem420,BIOS_WAIT_FOREVER);
Iss_ispWriteReg(&ipipeif_reg->ADDRU,(((UInt32)inAddrC >> 21) & 0x07FF),0,11); Iss_ispWriteReg(&ipipeif_reg->ADDRL,(((UInt32)inAddrC >> 5) & 0xFFFF),0,16);
// UV resizing Iss_ispWriteReg(&rszA_reg->RZA_420,0,0,1); // YEN -> Y output disable Iss_ispWriteReg(&rszA_reg->RZA_420,1,1,1); // CEN -> C output enable and 422to420 conversion enabled rszASetOutConfig(pObj->inWidth – 2, (pObj->inHeight >> 1) – 2, pObj->outWidth0, pObj->outHeight0 >> 1);
retVal = issSetRszOutAddress(RESIZER_A, RSZ_YUV420_C_OP, outAddrAC, pObj->pitch0);
这是不是说明RDK已经支持RESIZE 420输入-》420输出的模式,我测试了下发现跑了1帧这个函数就卡死了,这是什么原因? 是这个代码有什么问题?
Aen Jone:
回复 Aen Jone:
hi:
all , 我看到ISS的文档里有提到RESIZE文档里有提到RESIZE处理YUV420模式的描述:
3.3.3.13 ISS ISP IPIPEIF YUV4:2:0 Data Input for Memory-to-Memory Resize OperationsThe ISP RSZ module can resize YUV4:2:0 data. The YUV4:2:0 data can come from the memory (throughBL) or from the VP through the SC module, which reads data from SDRAM and pushes it to the IPIPEIFmodule VP. The possible data paths are:• SDRAM – IPIPEIF (BL) – RESIZER – SDRAM• SDRAM – SC – IPIPEIF (VP) – RESIZER – SDRAM• SDRAM – IPIPEIF (BL) – IPIPE – RESIZER – SDRAM• SDRAM – SC – IPIPEIF (BL) – IPIPE – RESIZER – SDRAMWhen the data comes from BL, the IPIPEIF module must be set up to process the luminance data first,and then the chrominance data.• For 420Y (first pass):– IPIPEIF_CFG1[15:14] INPSRC1 = 0x1 (SDRAM data input)– IPIPEIF_CFG1[3:2] INPSRC2 = 0x1 (SDRAM data input)– IPIPEIF_CFG1[13:11] DATASFT = 0x0 (no data shift)– IPIPEIF_CFG1[9:8] UNPACK = 0x1 (data packed on 8 bits)– IPIPEIF_CFG2[3] YUV16 = 0x1 (data_input [7:0] = 0 and data_input [15:8] = valid)• For 420C (second pass):
– IPIPEIF_CFG1[15:14] INPSRC1 = 0x1 (SDRAM data input)– IPIPEIF_CFG1[3:2] INPSRC2 = 0x1 (SDRAM data input)– IPIPEIF_CFG1[13:11] DATASFT = 0x0 (no data shift)– IPIPEIF_CFG1[9:8] UNPACK = 0x1 (data packed on 8 bits)– IPIPEIF_CFG2[3] YUV16 = 0x0 (data_input[7:0] = valid and data_input [15:8] = 0)
上面那段话是什么意思? 让我重写RESIZE代码还是在现在RDK的代码的基础上配置下ISS的寄存器就可以支持RESIZE的YUV420转420的模式了?上面的代码是目前RDK里RESIZE模块处理YUV420转420的源码我该如何改呢? 跪求TI的大神给解决方法。
Aen Jone:
回复 Aen Jone:
静等FAE答复
Aen Jone:
回复 Aen Jone:
每天来看下有没有消息