OSDN Git Service

media: aspeed: Support aspeed mode to reduce compressed data
authorJammy Huang <jammy_huang@aspeedtech.com>
Fri, 28 Oct 2022 02:35:53 +0000 (10:35 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 4 Nov 2022 15:56:41 +0000 (16:56 +0100)
commitd4b9fd006fae58d2fdc68a1d1000e0498d8fbe33
tree477d3816d6c7617a45c6097d8b69772eb7dd4215
parentdae86bb6488895738c390bce286ce14156c08d6b
media: aspeed: Support aspeed mode to reduce compressed data

aspeed supports differential jpeg format which only compress the parts
which are changed. In this way, it reduces both the amount of data to be
transferred by network and those to be decoded on the client side.

2 new ctrls are added:
* Aspeed HQ Mode: to control aspeed's high quality(2-pass) compression mode
  This only works with yuv444 subsampling.
* Aspeed HQ Quality: to control the quality of aspeed's HQ mode
  only useful if Aspeed HQ mode is enabled

Aspeed JPEG Format requires an additional buffer, called bcd, to store
the information about which macro block in the new frame is different
from the previous one.

To have bcd correctly working, we need to swap the buffers for src0/1 to
make src1 refer to previous frame and src0 to the coming new frame.

Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: fix logging dma_addr_t, use %pad for that]
drivers/media/platform/aspeed/aspeed-video.c
include/uapi/linux/aspeed-video.h [new file with mode: 0644]