2024-12-21 10:11 PM - last edited on 2024-12-23 02:25 AM by Amel NASRI
Hello,
I've been reading the reference manual for the STM32N6 and it's video encoder. There does not seem to be any registers that point to a region where the motion vectors are calculated, nor a memory map for the SRAM region mapped for the peripheral. Is there anyway to access the motion vectors calculated by the H264 peripheral directly instead of needing to decode the H264 stream? This would be incredibly useful in applications that require optical flow as part of their operation.
Thanks,
-Alex
Solved! Go to Solution.
2024-12-22 06:15 PM
Hi Alex,
I'm not a VENC expert. According to the name of the API, EncAsicGetMvOutput in encasiccontroller.c (inside STM32Cube_FW_N6_V1.0.0\Middlewares\Third_Party\VideoEncoder\source\common) looks like what you need:
/*------------------------------------------------------------------------------
EncAsicGetMvOutput
Return encOutputMbInfo_s pointer to beginning of macroblock mbNum
------------------------------------------------------------------------------*/
u32 * EncAsicGetMvOutput(asicData_s *asic, u32 mbNum)
{
...
}
The usage of this API in the example VENC_USB (inside STM32Cube_FW_N6_V1.0.0\Projects\STM32N6570-DK\Applications\VENC) is shown below for your reference:
2024-12-22 06:15 PM
Hi Alex,
I'm not a VENC expert. According to the name of the API, EncAsicGetMvOutput in encasiccontroller.c (inside STM32Cube_FW_N6_V1.0.0\Middlewares\Third_Party\VideoEncoder\source\common) looks like what you need:
/*------------------------------------------------------------------------------
EncAsicGetMvOutput
Return encOutputMbInfo_s pointer to beginning of macroblock mbNum
------------------------------------------------------------------------------*/
u32 * EncAsicGetMvOutput(asicData_s *asic, u32 mbNum)
{
...
}
The usage of this API in the example VENC_USB (inside STM32Cube_FW_N6_V1.0.0\Projects\STM32N6570-DK\Applications\VENC) is shown below for your reference:
2024-12-23 10:32 PM
Thank you, this was certainly helpful. I haven't tested it out yet, but it did point me to the correct portion of the VENC demo provided for the DK. As part of that demo, the `encOut` struct already contains a pointer to the macroblock motion vectors.
2024-12-24 12:24 AM
Hello @ClosedBridge , if @Ethan HUANG comment answered your question, don't hesitate to mark it "Accepted as Solution".
Thanks.