Usage - 1.1 English

Video Scene Change Detection LogiCORE IP Product Guide (PG322)

Document ID
PG322
Release Date
2023-11-10
Version
1.1 English

To better understand the driver usage, consider the following test case scenario. Suppose the core in the design was configured with memory based mode and eight input streams. Driver should program the input image width, input image height, stride for input image, video format of the input image, sampling rate, and source buffer address registers for all the configured eight input streams. The application should allocate required frame buffer space for each input stream in memory. These addresses can be updated during the interrupt. To integrate and use the Video Scene Change driver in the application, the following steps should be performed:

  1. Include the driver header file xv_scenechange.h that contains the Video Scene Change Detection IP instance object definition.
  2. Declare an instance of the Video Scene Change Detection IP type: XV_scenechange ScdPtr;.
  3. Initialize the Video Scene Change DetectionIP instance at power on: XV_scenechange_Initialize(&ScdPtr, DeviceId);. This function accesses the hardware configuration and initializes the core instance structure.
  4. If the core is operating in an interrupt mode, the application needs to perform the tasks mentioned, that is, register the ISR with the system interrupt controller and set the application callback function. This function is called by the Video Scene Change Detection IP driver when the frame done IRQ is triggered.
  5. If applicable, write the application level callback function. An example action to be performed here would be to update Source Image buffer addresses, that is, from where to read the next frame data for each output. This allows the application to render the frame updates in memory, on screen.
  6. Set the number of input streams for memory based mode by the function XV_scenechange_Set_HwReg_stream_enable(&ScdPtr, ScdPtr.userval_stream);.
  7. Configure input image width, input image height, input image width, stride for input image, video format of the input image, subsampling rate, and source buffer address registers for all the configured streams.
  8. Enable the interrupts using the following functions:
    • XV_scenechange_InterruptGlobalEnable(&ScdPtr);
    • XV_scenechange_InterruptEnable(&ScdPtr, XV_SCENECHANGE_CTRL_ADDR_ISR_AP_DONE).
  9. Start the IP using the XV_scenechange_Start(&ScdPtr) function and wait for the interrupt.
Note:
  1. Resolution changes are not possible on the fly. If the changes are needed then the application must reset the Video Scene Change Detection, that is toggle ap_rst_n, and reconfigure the core for the new resolution. After reset, all registers are cleared to 0.
  2. The application code should check the return status of all APIs to make sure the required action was completed successfully and if not take corrective action.