Commit Graph

387 Commits

Author SHA1 Message Date
Herman Chen
ba2fab3018 [mpp_task]: Hide port and task queue from rk_mpi.h
Move MppPort and MppTaskQueue function to mpp_task_impl.h.
Add caller parameter to mpp_port_poll, mpp_port_dequeue,
mpp_port_enqueue, mpp_port_awake functions for debug purpose.

Change-Id: I39f69d934d45b65c3bc751d71ec98388c2fb9849
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-21 17:49:20 +08:00
Herman Chen
ab235fd62e [mpp_meta]: Add meta size interface
1. Add mpp_meta_size and mpp_meta_next_node function
2. Move mpp_meta_size and mpp_meta_next_node to mpp_meta_impl.h

mpp_meta_size      - Return node count in metadata.
mpp_meta_next_node - Return next MppMetaNode in metadata.

These two functions are useful in debug.

Change-Id: If0be59c4621fd8ba2e2dbe96124a653b397bac7c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-21 17:44:03 +08:00
Herman Chen
584d8565cd [meta]: Add key for temporal id
Temporal id is the temporal layer id for H.264 and H.265. It is
usefull for TSVC stream storage and frame display.

Users can determine their behave according to this id.

Change-Id: I06f039b63e0665d3542dc6bd89cc6b52d957af25
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 11:26:43 +08:00
Herman Chen
a5995e3aab [mpp_packet]: Add MppMeta to MppPacket
MppPacket will NOT create meta data by default. Then user and mpp can
attach or remove flexible parameter without adding or remove
interface which will break binary compatibility.

Change-Id: I2c2ff24f7e1c22adb7085a75a4c857e5760d2eae
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 11:09:48 +08:00
Herman Chen
0ee116f416 [mpp_frame]: Add MppMeta to MppFrame
MppFrame will NOT create meta data by default. Then user and mpp can
attach or remove flexible parameter without adding or remove
interface which will break binary compatibility.

Change-Id: Ia3c0d15d6daa210deab7a7d5dffcb54303fbb73e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 11:09:48 +08:00
Herman Chen
cd9a1cca3f [misc]: Change interface header file dependency
Move MppCtx, MppParam, MppFrame, MppPacket, MppBuffer, MppBufferGroup,
MppTask and MppMeta to rk_type.h.

Later development need to bring in cross reference between these
objects. So we choose to move these declaration together.

Change-Id: I7ea39138ca87d6ca4cb86556464a5de89d172846
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 10:15:12 +08:00
Johnson Ding
d2459e4fac [jpegd]: Add YUV400 support
Change-Id: I110f0f2a16977f985d32204704ca4c2effcd8b90
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-06-12 10:55:58 +08:00
Herman Chen
a1ae919a33 [h264e]: Remove unused i_frame_packing
Change-Id: Ia53c2513bc57dde47960c06374d1c6d5fa729da7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-17 14:35:07 +08:00
hh
8f4199a0f4 [rga]: fix bug of rga config
1. Modify data type of rga_request to keep consistent with kernel
2. Modify error yuv fomrat translate and error yuv2rgb_mode config of rga

Change-Id: Iaee7b101f510c9d6f90aabe7d5ce2794b4502bf7
Signed-off-by: hh <hh@rock-chips.com>
2018-12-19 10:49:08 +08:00
Ding Wei
3e5ad4fed3 [h265e]: add h265 encoder code
Change-Id: I08350dc76d3040bc1a16a3d8234f836f5fbf69d0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-11-21 09:59:31 +08:00
Herman Chen
0a78fb7102 [mpp]: Combine block control and timeout control
Use MppPollType as block control MPP_SET_INPUT_TIMEOUT and
MPP_SET_OUTPUT_TIMEOUT 's parameter.
Deprecate old block/block_timeout control.

Next step is to change MppPollType to RK_S64 for compatible in different
platform.

Change-Id: I02974f0b8eeb23ff43687448d6c3271ea7dd0a2c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-27 11:56:56 +08:00
Herman Chen
44f0ee0353 [mpp_dec]: Add post-process path to mpp_dec
1. Unify the hal thread output process to mpp_dec_put_frame
2. Add vproc path for field source.
3. Reserve one more buffer when deinterlace is enabled.
4. Default enable for normal mpp path but disable on vpuapi path for the
reason that rk_ffplayer has done deinterlace process internally.

Change-Id: I02e7cece844fde01c2d249dafe6f7ce6a325593f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-05 15:10:39 +08:00
Herman Chen
3ed61e06e1 [MppBuffer]: Add buffer group memory usage
Add mpp_buffer_group_usage function to return runtime buffer group
memory usage.

Change-Id: Ibb2893087e84b6d40de1b44accf45439b7ba925e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 09:14:41 +08:00
Rimon Xu
fb73f23f53 [alloctor]: add flags for alloctor
Each of the different alloctor has different alloctor modes,
such as allocating physical continuous memory, secure memory,
etc.

Change-Id: Ib032689f0cfd36b494843dcc176a22c6c9587b6a
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2018-05-07 17:34:34 +08:00
Ding Wei
44ad1558ec [vpu_api]: add command VPU_API_SET_IMMEDIATE_OUT
tips: this command is used to set decoded frame immediate out,
whehter is in display order or not.

Change-Id: I0b6b2c34fde722fe724019118c7af142b4b2e6f1
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 09:53:10 +08:00
Ding Wei
7716b36af8 [mpeg4][h263]: remove internal pts mode
tips: the timestamp in slice header is not useful, except for
calculate increment of dispaly frame. so, it cannot use to
dispaly, and remove it.

Change-Id: I748d553d40c4736e2f5ef98d8a8519fcc5e533e0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Ding Wei
2f5bd0bffb [mpp_dec]: add control to set present time order
tips: when input timestamp has not pts, and set pts=dts,
it should use input timestamp order for output.

Change-Id: I8b3ef9a8d150e5729a3fa94df6c1b448edb8f1fd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Randy Li
a78598dab5 [osal]: add new buffer type for DMA import buffer
This buffer type is used for the buffer coming from the
application, the application should make sure those
buffers are the dma buffer.

Change-Id: I2c8491f4dea77e5d7ae8d9157b0a1eda204f4bd6
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Randy Li
35cb04f7bb [inc]: add error define for operation not permitted
Operation not permitted, it also means that this operation
is not implemented.

Change-Id: I752efb3f5a697125f334f6fdf8bd58fea94a7024
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Randy Li
86c5f925cd [alloactor]: fix some minior errors
1. fix the header protection
2. the incorrect offset in ion memory mapping
3. the commentment of the buffer type in a header file

Change-Id: If9d1db90d41131750a341ab6177f947f7b966317
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Herman Chen
3bca32d1e0 [inc]: Add eos flag clear function to mpp_packet
For it is inconvenient to clear the eos bit in mpp_packet flag we add a
new function to clear the eos flag only.

Change-Id: I67fad6e416bca68b6b7cee8e816fca386759f35a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-22 11:52:01 +08:00
timkingh.huang
1acefd6207 [h264e]: add configuration of ROI
Change-Id: Ieba60baedc8fabd248112636f5ea59a107775403
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2018-01-15 18:34:28 +08:00
Ding Wei
9dec5cd14e [mpp_dec]: add flag about display queue whether full
tips: when decode too fast then display queue is full,
that should wait until frame displayed.

Change-Id: Ic8ec18368fdb956cad92b0760a3d4637e46f55bf
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-05 08:50:59 +08:00
Ding Wei
c6594ae192 [mpi_cmd]: add disable error command
1. Disable error default is not set for normal error detection.
2. On special case like drone streaming the user prefers to ignore
all error and continue decoding. Then disable error flag will be set
to fullfill this requirement.
3. When disable error flag is set H.264/H.265 decoding will ignore
hardware error and mark all output frame as no error.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>

Change-Id: I8fd619511c53ee744ae973ab3fe015565106dd37
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2017-12-22 11:44:33 +08:00
sayon.chen
6c74d876a3 [rkv_enc]: VBR case add new ratecontrol
add AQ_ONLY quality ratecontrol for CVR
qp adjust according bit allocate,mb qp dealt adjust
accroding adaptive quant

Change-Id: Ia9a46e765646a88e2659f5fb19b94a0a5c667681
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2017-12-14 16:17:36 +08:00
Randy Li
6d0955c62f [meta]: add the missing meta data
The encoder would use the KEY_OUTPUT_INTRA to indicate
the current frame is intra frame.

And the decoder would use the new added KEY_HDR_INFO key
to store the HDR data.

Change-Id: I150a993906f43792474ac5aa02a1e5441fb21e8f
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-24 17:08:56 +08:00
Ding Wei
f391bd9ea4 [vpu_api]: modify interface to get stride when buffer malloc
1. remove vpu_api_get_format interface.
2. rename vpu_api improper name.

Change-Id: I8986b989ab352972f8f03fb1d3c35447bf3eda47
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2017-11-22 10:07:04 +08:00
Randy Li
c89b4727c7 [mpp_frame]: add complex formats and more comments
A few comments for the pixel formats are not correct,
also without the mapping to the common name comparing
to the Gstreamer or V4L2.

Both VPU and RKV supports tile format, so I add a new
type to store those pixel formats with a complex layout.

The VDPU does NOT semi-planarity pixel formats and
other than 8x4 marcoblock size for the tile format.

Change-Id: I9abea54a563eafe6902f5cf5e25e741a809f41b0
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-10-12 09:01:27 +08:00
leo.ding
e54fafe8cb [vpu_api]: add vpuCodecContext parameters
a) mpp_mode: if have rkv, can set it 1 to use rkv decoder
b) bit_depth: for calculate stride
c) yuv_format: for setting multiplication coefficient when malloc

Change-Id: Id7c32c7cac17d3c9007a0674979c2b73769ae44f
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-10-11 09:58:01 +08:00
timkingh.huang
5f1583697b [h264e]: add command of MPP_ENC_SET_QP_RANGE
Change-Id: I5c8fedc381537117953e858191f4b2ff8a5a2581
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-09-21 19:14:10 +08:00
leo.ding
28bdc96b2d [vpu_api_legacy]: disprese MPP_DEC_SET_FRAME_INFO function to
each codec.

Change-Id: I5ac177fbaba6e81db53c7d162a1d81ba3e00c2e4
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-09-06 10:08:31 +08:00
timkingh.huang
137618c298 [h264e]: allocate buffers before encoding
Allocate buffers before encoding so that we can save
some time when encoding first frame.

Change-Id: I02d67347313e2050896b545b861bc5fa0bba495d
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-08-07 14:54:05 +08:00
Randy Li
851f1185a3 [mpi]: decode_put_packet() would return the internal error
The reason why the decode_put_packet() could be various, it
should return the correct reason to make the caller use the
properly way to handle that.

Change-Id: I88ee1c06d204b8c3bb7ba09482f2939fdd1e8633
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-06-06 14:21:59 +08:00
hh
8fa1648bac [platform] Distinguish avs and avs+
Add macro avs to distinguish avs and avs+ streams.

Change-Id: Idf6f5d289d09301001f7036dea2c83b8644ba281
Signed-off-by: hh <hh@rock-chips.com>
2017-06-06 09:24:56 +08:00
Herman Chen
9c7b9efe74 [misc]: Remove source code executable attribute
Change-Id: I1bf4ec5782e30869e971e4c27ef50285d4382233
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-06 08:48:50 +08:00
hh
0da8d1f604 [enc]: add output port awake when encode exit.
If encode thread is blocked in mpp_port_poll(output, MPP_POLL_BLOCK) and
user's get stream thread exit, it must awake this block call before join
encode thread exit.

Change-Id: Iee52d2d45a672464b7f3485086a389041dacdeb0
Signed-off-by: hh <hh@rock-chips.com>
2017-05-04 18:03:45 +08:00
Randy Li
bd43fac60e [mpp_buffer]: access the index field of buffer info
The external buffer would request the index of a buffer to
manage it in an array.

Change-Id: Ifbb169c75dfb6342b428b1fd640db9ec45ff5f73
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-05 16:51:44 +08:00
Randy Li
ab07acf076 [legacy]: update hevc device node name
I also fix a number of compiler warnings in this commmit.
A funtion is forgot to be exported and some functions should not
be exported.

Change-Id: I945456721a7507d448cfa0559418c356c6cb6ace
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-05 14:13:07 +08:00
timkingh.huang
93aa8a0c8a [jpegd]: modify jpegd parser
scan the stream just for one time in jpegd parser and
remove redundant codes.

Change-Id: I72920b15fc4ed15cfa1de55d9ed249d50cceebb2
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-04-01 18:25:15 +08:00
Herman Chen
a8e6c27d0b [mpp]: Move vpu.c out of libmpp.so
Use mpp_device to replace VPUClient interface. Then libmpp.so can
work without libvpu.so. And libvpu.so is only for legacy libvpuapi.

Remove iommu detection function in mpp. All buffer register will be
send to kernel with the form of low 10 bit file handle plus 22 bit
offset mode.

Remove vpu.h/vpu_api.h from libmpp.so
NOTE: mpp_frame.h is updated for external user.

Change-Id: I7ff2effd3c73c042ed65896847fc7458da29fc55
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-01 17:44:11 +08:00
Lin Kesheng
cad4b4b886 [h264e]: add rotation configuration
Change-Id: I148814a644264b341d6db1d7af767dd485942829
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-03-28 14:08:41 +08:00
Randy Li
dae0c0d52a [meta]: use fourcc format to store the meta type
It is the correct to store multi char variable in a variable.
Finally we can't get rid of warning.

NOTE: Need to check the macro under different compiler.

Change-Id: Id43fabd9a6ad437938ba590c95dc0552ef4e5699
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-24 16:27:40 +08:00
LongChair
a3f463f9ce [mpi] : Add a block timeout control command.
When retrieving frames current API only allows to define wether
the API should block without any timeout or not block at all.
This allows to specify a block timeout via the
MPP_SET_OUTPUT_BLOCK_TIMEOUT control operation.

Change-Id: Id35ad3d48f72881184009f830c406c3a655e1a90
Signed-off-by: LongChair <LongChair@hotmail.com>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-24 11:43:08 +08:00
rimon.xu
cd27842b1e [h265d]: add h265d colorType support HDR
1.colorType bitmask add dynamic range and color space
2.need to cooperate with mediacodec modifications
3.need to cooperate with omx_il modifications

Change-Id: Ib8c23f6b0488cf799e69ced2bdc9b54d309a1630
Signed-off-by: rimon.xu <rimon.xu@rock-chips.com>
2017-02-27 17:43:10 +08:00
Lin Kesheng
422ecbc204 [mpi]: change rc mode and quality definition
Change-Id: I87008d7294acaa89d9206e5b1cd1ce74c40d4af4
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-14 15:50:06 +08:00
Herman Chen
444e8b429f [mpp]: Fix compile warning for strict-prototypes
Change-Id: Ia430a5d157dc2d19c92a43ca15eab83f1ac540c6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-01-11 10:43:27 +08:00
Herman Chen
b1a5c18ef9 [mpi/mpp]: Remove MppEncConfig interface
Change-Id: Ie85b780076b22342bfc1837beef00036f5f40a04
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-01-06 18:00:36 +08:00
Herman Chen
4c1ae218e6 [mpi/mpp/enc]: New encoder framework
1. Interface change:
Separate normal config into three basic config and several runtime config:
Three basic config -
a. rate control config
b. preprocess config
c. video codec protocol config
More flexible rate control interfaces are provided.
More codec configure interfaces are provided.
Change flag with bitmap is provided for further optimization.

2. Remove old codec config from controller and left rate control module only
Encoder controller only handle user rate control requirement and bit allocation.
Hal hardware encoder only handle qp calculation according given target bit.
Remove all old codec code.

3. Move codec process to hal
Different hardware will share same codec process function in common protocol
directory. And different hardware api will register to same api set. Codec
header generation is moved to separate hal directory.

4. Encoder will return length by task
Encoder will NOT get stream information feedback from controller. All
information required by encoder will be all stored in Task.

5. Add mpp_rc for rate control
Move some common rate control utils to mpp_base.

6. Update mpi_enc_test and mpi_rc_test with new interface

Change-Id: Iebb5e276a48f547167e1bed4673f21cc2f0c8ad5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-05 10:58:27 +08:00
Herman Chen
d8ed1f4eb1 [mpi]: Add poll interface to mpi
1. Add poll with timeout. Support three mode: block/non-block/timeout.
2. Change control MPP_SET_INPUT_BLOCK and MPP_SET_OUTPUT_BLOCK.
3. Remove msleep in most mpp interface.

Change-Id: I39d9a261b6f1da66c6cb944abd71d1e7f4928d2d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-01-04 15:15:37 +08:00
Lin Kesheng
0e8b435b82 [h264e_prep]: add prep cfg interface for dsp
1. cfg sharpen parameters

export h264e_hal_debug=0x8001, to open log
export h264e_hal_debug=0x1,    to close log

Change-Id: I97322f9819cfbb6909b86afc25f84bacac9841af
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-12-20 11:35:17 +08:00