Commit Graph

167 Commits

Author SHA1 Message Date
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
Herman Chen
249f83f35b [mpp_buffer]: Add caller to MppBuffer functions
Add caller parameter to all mpp_buffer functions.

Change-Id: Ibebd2a31b302988fe1ed480de575189ce57e41a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-15 16:56:39 +08:00
timkingh.huang
34698dcaf8 [tools]: add doxygen config file
1.The INPUT tag used to specify the files and/or directories that
contain documented source files is set to mpp/inc.
2.The OUTPUT_DIRECTORY tag used to specify the (relative or absolute)
path into which the generated documentation will be written is set
to mpp/doc.
3.Assuming that doxygen is configured correctly under Linux, if you
want to get documentation of pdf format, do as follow:
    cd mpp/tools
    doxygen mpp_doxyfile
    cd ../doc/latex
    make
4.mpp/doc/html contains documentation of html format.
5.modify notes of vpu_api.h and rk_mpi.h.

Change-Id: I02b09514ff44b4689ea99e3d99d2acc9eb58cd19
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2016-11-30 11:33:41 +08:00
leo.ding
7735655408 [avsd] add avsd hard decoder driver.
Change-Id: I4459a9b3ea71d6ab06d5b6ebe6226604bc8b7042
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2016-11-15 17:04:02 +08:00
Lin Kesheng
2f9b18b0bd [hal_h264e_rkv]: remove compile warnings on windows
1. add new ioctl interface SendReg2 in vpu.c
2. use Sendreg2 interface in hal_h264e_rkv, exclude ioctl.h

Change-Id: Id79716e0fca96141b8665d59244569b6de9dd39a
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-11-11 16:21:24 +08:00
Lin Kesheng
fad35922fc [h264e_rkv]: pack cfg into SEI and write to stream
1. add SEI writting interface
2. write extra_info_cfg and rc_cfg to SEI
3. stream_get_pos use s->buf_plus8 rather than s->p_start

Change-Id: I71de4d6f5dc31f21c0a32dc5ded275ced260d861
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-25 20:54:06 +08:00
Herman Chen
cd97a84407 [mpp_buffer]: fix macro hand writing error
Change-Id: I6a3799314c345defaaf28b1377d621f51fee4e1a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-10-18 15:23:09 +08:00
Lin Kesheng
f04d6604f7 [h264e_rkv]: Implement OSD function
1. add description for OSD cmd in rk_mpi_cmd.h
2. judge if input MppBuffer for OSD is NULL

Change-Id: I6d674c81790d9cf57acdfa23f20c929b56f263e9
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-09 10:31:51 +08:00
Lin Kesheng
089660baa8 [hal_h264e_rkv]: support osd configuration
1. add osd control interface
2. remove h264e_hal_rkv_coveragetest_cfg.osd
3. add h264e_hal_test & mpi_enc_test for osd
4. use tool to format code

Change-Id: Iadb3453d8e6976e5f718253f762d144864419e94
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-08 11:19:11 +08:00
Herman Chen
c58df3f3f9 [mpp_enc]: Implement new encoder framework
1. Separate encoder configure to four parts
2. Add Preprocess / OSD / Extra configs
3. Implement mv_info interface

Change-Id: I2350a25c9f40b199cee8ef6c75ac6ca099f143c4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-27 11:08:08 +08:00
Herman Chen
1752473f33 [mpi]: fix -Wstrict-prototypes warning
Change-Id: If9549b213c6b5d5545186e1289a436957160924f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-09-14 16:13:28 +08:00
herman.chen
a0c0639205 [meta]: modify metadata type and key definition
This is prepare for adding metadata key tree.

Change-Id: Ibd8f4a2c820cdeb5c59ade9a0f80d29e803143da
Signed-off-by: herman.chen <herman.chen@rock-chips.com>
2016-09-08 16:56:45 +08:00
Lin Kesheng
60373a6973 [all]: format code
use fromdos to change file type, remove ^M in code.

Change-Id: I000202dc51fcff57cc0771455baebea595115b1d
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-08 15:21:02 +08:00
Herman Chen
43bfdc6bdf [format]: format coding style
Change-Id: I3d0e081f6636ca8162df4bda68618ec0ba37e7ae
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-08-23 09:16:22 +08:00
HuangTingjin
fdc9c5d4b4 [jpegd]: add implementation of jpegd_parser_control.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1180 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-09 12:24:54 +00:00
ChenHengming
72d5d0fc93 [mpp_frame]: add more type for convenience
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1164 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-07 02:37:02 +00:00
ChenHengming
4428090348 [mpp_frame]: fix frame format macro backward compatible issue
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1160 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-05 08:15:04 +00:00
ChenHengming
f6aa0ebafa [mpp_frame]: fix frame format macro backward compatible issue
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1159 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-05 07:14:32 +00:00
LinKesheng
ec463020e5 [hal_h264e]: 1. fix bugs in SDK debug; 2. support new Mppframeformat in mpp_frame.h.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1158 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-04 13:23:50 +00:00
GaoZhili
530ac6b5d4 [h264e]: consummate the input format of encoder
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1154 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-04 07:15:49 +00:00
ChenHengming
560213eef9 [h264]: encoder and decoder share common definition
[h264e]: separate init and config into two functions and add mpp encoder config check function

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1145 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-03 06:20:01 +00:00