cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 H264 encoder motion vectors

ClosedBridge
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Ethan HUANG
ST Employee

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:

EthanHUANG_0-1734919694484.png

View solution in original post

3 REPLIES 3
Ethan HUANG
ST Employee

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:

EthanHUANG_0-1734919694484.png

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.

Hello @ClosedBridge , if @Ethan HUANG comment answered your question, don't hesitate to mark it "Accepted as Solution".

Thanks.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.