Hardware JPEG support in kernel for Luckfox Pico boards?

  • Hello, currently supports calling RV1103/RV1106 JPEG hardware-encoded IP cores only using MPP library and MPI library
    MPP Rockchip only open source header files and dynamic libraries, there is no description of actual use, the actual use can refer to the community members developed Opencv-Mobilehttps://github.com/nihui/opencv-mobile, there is a jpeg encoding to achieve MPP accelerated images
    MPI part calls VENC code also needs VI component binding, mainly used on the camera is not recommended to use alone
  • Hi! I've managed to create an application to take jpeg photos based on rk_mpi api and examples. It turns out that the scheme of doing it is pretty much the same as it for videos, but i've encountered problem with encoder internal buffer: it turns out that this buffer works as FIFO, and when it overflows it stops receiving frames until you pop some frames by calling RK_MPI_VENC_GetStream(). The problem that arises is when im making a series of photos, in the second series i have couple of old photos from the buffer, not the present ones. To solve this issue i have only one option for now: hard-code size of buffer to prevent it from storing more than one encoded frame. This solution is not quite safe and effective as i usually change resolution of camera and jpeg photos vary quite a lot in size. Is it possible to turn the internal encoder buffer off to only get the most present frame in case of photo-making? Thanks in advance!
  • Then why don't you use RK_MPI_VENC_ReleaseStream() first,to release buffer
    Maybe you can translate this document (because it is only in Chinese now), it can help you to use MPI
    Attachments
    Downloaded 95 times
  • This document is only thing that helps me, im using it in machine-translated version for couple of months for now :D. Obviously i call API functions in this order: RK_MPI_VENC_GetStream() -> do something with encoded frame... -> RK_MPI_VENC_ReleaseStream(). In case of video everything works fine, as im doing it in designated thread without long delays. In cases of photo i want to make series of photos with some delay between each frame. So in this case the order of API function call changes to this: RK_MPI_VENC_GetStream() -> do something with encoded frame... -> RK_MPI_VENC_ReleaseStream() -> delay... . In this case i'm getting old frames from encoder buffer, instead of the most present ones. It seems to me that due to the fact that encoder is bound to video input, VI constantly push data to encoder and it stores encoded frames in it's buffer no matter how frequently i call RK_MPI_VENC_GetStream(). At least, it looks like that. Is there any opportunity to clear encoder buffer? Thanks...
  • Hello, since we don't know the internal details of rkmpi implementation, rkmpi itself is also a closed-source library, if there is no mention of buffer cleaning methods on the API, then it is very troublesome to implement it through other APIs.
    In our RKMPI routine, instead of binding operation, we use the method of passing buffer blocks to VENC. In the image processing stage, you can choose whether to pass buffer blocks to VENC. You can refer to https://github.com/LuckfoxTECH/luckfox_ ... pi_example
  • Thank you, i'll consider on that!