[COMMON] media: smfc: support for secondary image compression
SMFC supports for back-to-back image compression. It compresses two
images at the same time. Even though SMFC, itself has a single JPEG
compression engine, the users including the driver of SMFC feels that
the two source images are compressed concurrently because it provides
two sets of source image configuration registers and the users receive
two compressed data when the 'frame done' interrupt is asserted.
V4L2 does not consider about the special function like back-to-back
(B2B) compression which requires a couple of source images and results
different output streams for the source images. Thus SMFC driver
requires userspaces to provide the secondary image to compress in a
special way.
- For B2B, the output and capture buffer type should be multi-plane.
- All the format and buffer information passed to the driver from the
the userspace should be the information of the primary image.
- To B2B compression, the userspace should configure
* The width and the height of the secondary image should be
configured in the higher 16-bits of the fields of width and
height of 'struct v4l2_format'
* The color format of the secondary image should be the same as
the primary image. Therefore there is no way to configure
the color format of the secondary image.
* The quality factor of the secondary image should be configured
with the V4L2 control ID 'V4L2_CID_JPEG_CLASS_BASE + 20'.
The parameter is the same as V4L2_CID_JPEG_COMPRESSION_QUALITY.
* The buffer information of the secondary image should be
specified from v4l2_buffer.m.plane[num_planes of the 1st image].
v4l2_buffer.length should be also doubled because the effective
planes are doubled. Otherwise, the users get failure.
Change-Id: I0f0abfe2ca2cc74219646fa4157dc41d5ef1e5b7
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>