Commit Graph

3026 Commits

Author SHA1 Message Date
Yandong Lin
91cbd85488 [mpp_frame/packet]: Reduce malloc/free
Reduce malloc/free of MppFrame/MppPacket

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Iffa042e162ad1da749305b131f68a52a140763e2
2021-05-01 16:27:05 +08:00
Yandong Lin
ed69e9077f [mpp_mem_pool]: Add common module MppMemPool
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id778f4395f457a773812db78164ecad4038b2ff4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-01 16:27:00 +08:00
Herman Chen
dbda66de53 [test]: Add quiet flag to decoder test log
Change-Id: I9472760ede918a913957b336665d7e0367b661c5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
cdec28698c [mpp_buffer]: Add info dump on buffer leaked
Change-Id: Ida823d6bbfa06a846546b554d6b3a218418deadd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Ding Wei
ff5c5aec39 [hal_h265d]: fix issue for rcb_buf not free
Change-Id: Ie2bf272ffc66d94c73229645d0a44d53427296b5
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
aed7c380c5 [mpp]: Fix block input error
1. put_packet support block mode now.
2. The EosTask should be insure to be block mode.
3. NOTE: When set to block mode use put_packet and get_frame in single
thread may cause deadlock for the info change or eos may be blocked and
the put_packet can not return.

Change-Id: I8cf73f833e5d29c3b330c4b56fbd6be8d7432e60
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
7d8b6414c3 [mpp_buffer]: Use new mutex lock
Replace service lock with buffer lock, group lock and smaller service
lock.

Change-Id: Ic8ff9fae714b0362f43df23008efce49fe16b9ce
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
841022f529 [mpi_dec_multi_test]: Add quiet flag to disable log
Change-Id: Iea28d4377212e4c18a91f30762ae8ec135702c16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Johnson Ding
c01259d4fe [jpegd]: fix marker parsing error
If there is an 0xff between two section, parser will stop searching
marker. But if we skip this byte and contine parsing, it may be
successfully decoded.

Ref to https://redmine.rock-chips.com/issues/295017

Change-Id: Ia73bf66b05ea109ac19a7a5a37241a6381b468d3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-04-30 18:43:16 +08:00
Yandong Lin
025275ab26 [mpi_dec_utils]: Fix build warning under 64-bit
Note:
    warning: ignoring return value of 'fread', declared with attribute
    warn_unused_result [-Wunused-result]
         fread(ivf_data, 1, IVF_FRAME_HEADER_LENGTH, reader->fp_input);

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ic2ec8c0a46d56f584be048f933fa17532a77ce20
2021-04-30 18:43:16 +08:00
Herman Chen
0e0071db2b [mpp_buffer]: Use fixed array to record history
Change-Id: I9d651fd381abe0d25794aefb3f1ca44826b74939
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
ffbd5c042a [mpp_buffer]: Get allocator on MppService created
Store allocator to MppBuffer to remove dependency from buffer to group.

Change-Id: I7ae136d12bb30cb989b6352989df3b0b3477ad98
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
sayon.chen
35c84f8210 [iep1]: Fix iep1 ctx double free issue
Change-Id: Ia08ffe74466d756be25069ab28d9be6be7799efd
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
a4a9effd33 [mpp_mem]: Reduce mutex lock range
Change-Id: Ic70f0d66ad20878bca0b4ad3a5d5e933f96ca4b3
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-22 16:37:16 +08:00
Chen Jinsen
a26e71291e [vpu_api_legacy]: support fbc fmt setup
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: If43694ce50a0f163776a260a1a919d2f9d12a4d0
2021-04-22 11:29:48 +08:00
Ding Wei
23fa2f0bd3 [h264d]: avoid every frame to mpp_frame_init/mpp_frame_deinit
Change-Id: Idc5cb835653ce2dfbc1597c8463bd25f2a9172a6
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-04-21 17:02:22 +08:00
Herman Chen
fdbaa67b23 [mpp_buffer]: Use hashtable to search buffer group
When there are a lot of buffer groups created the search speed will be
slow. We should use hashtable to speed up.

Change-Id: I9ceeaa5a72eedf81597eeb83b34d417c74ceae04
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-21 14:43:56 +08:00
Herman Chen
f026a238de [osal]: Add hash table implement
Change-Id: I190282e2236797f1b452176a82e72117b93cd64f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-21 14:39:38 +08:00
Yandong Lin
3452de9352 [h264d_parser]: Fix issue that continuous frame loss when seek with B-frame
After seek, set err frame whose poc is smaller than the poc of the
first i frame.
But the poc record of the first i frame is not update,
resulting in continunous frame loss.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I8d56f6aeca570d66912a6dcdd5690a809fa070e8
2021-04-20 16:38:59 +08:00
Herman Chen
b201b9dc42 [mpi_enc_test]: Fix compile size_t print warning
Change-Id: Icb30a7d8df0f2e3c47aee946ec7fed66fecff5df
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-20 16:21:38 +08:00
Ding Wei
e957b0b12c [hal_h265d]: cabac_table && spspps && rps && scalist share one fd
Change-Id: If7b176d0f523ac2f6de7f2ffe943e726e8d00998
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-04-20 15:29:38 +08:00
Herman Chen
a91439bef4 [mpp_buffer]: Add mem and buffer usage function
Change-Id: I356ef9311802868fe8d234dbff178ad8463985d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-20 14:39:52 +08:00
Herman Chen
94c123bdb7 [hal_vdpu34x]: Update error check flag
Change-Id: I3cea464910d01a9aa924520a0f69e317cf0d8c01
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-20 14:30:46 +08:00
Yandong Lin
7335516d41 [hal_vp9d_vdpu34x]: Fix fbc body offset not enough issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ide84ef495d37c5d8cf42288502362c731b31debf
2021-04-19 14:46:51 +08:00
Johnson Ding
cac9e9a1cd [jpegd]: Fix NV12 ver_stride error
Change-Id: I825bebb603198ab4d36b3b5f03766719e973aada
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-04-19 14:46:31 +08:00
Johnson Ding
75257262e5 [h264d]: fix a typo
Change-Id: I89c1120627eb23557aa784941d72658d98345624
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-04-14 11:28:51 +08:00
sayon.chen
bc38dbac7e [h265d_parser]: Fix no more start_code cause dec error
Change-Id: I9c3dc9ab8e5b38b6730d6732e1346bd288bea2b6
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-04-13 09:54:47 +08:00
Yandong Lin
5b1156a47b [vcodec_service]: Fix array out of bounds issue
Note:
1. In kernel 4.4 and previous version, the array may cross the boundary
and cover an unknown memory address
2. The array is out of bounds caused by the following submission:

 commit 5be47f31f0
  Author: Yandong Lin <yandong.lin@rock-chips.com>
  Date:   Wed Feb 24 19:44:32 2021 +0800

      [hal_vdpu]: Support fd and offset to be set separately

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie3fc4324dde497732424cf3023ce81997401fd96
2021-04-09 11:12:56 +08:00
Herman Chen
ae49194de1 [readme]: Add more chipset support in readme
Add RK3566/RK3568/RV1109/RV1126 support in readme.

Change-Id: I9c7c191f2a1c0e5302af7df6edfbefc6457d397b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-08 10:30:06 +08:00
Herman Chen
fc8fcacc49 [mpi]: Change mpi return value meaning
The 0 and positive return is success. The negative return is failure.

Change-Id: I9c4586286ce7368a52b7d9dd776fd40c6af4a1da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-08 09:08:48 +08:00
Johnson Ding
078b4aab41 [mpeg4]: Fix split conflict problem
For Linux platform running Gstreamer, enable need_split may conflict
with bitstream parser within Gstreamer.

Change-Id: I8616e173cbae43aaf8fc18aec4dbd680ad38bdf8
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-29 16:05:04 +08:00
Johnson Ding
2e611ffac7 [jpegd]: Fix jpeg decoder timeout issue
FF00 before EOI should be kept. The test source file is at
"server=172.16.4.246,share=mediaframework/jpeg_ff00_before_eoi/CIF_98.jpg"

Change-Id: Ic5e7781a329f8effb5b674a1816350be732fffbb
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-29 15:12:39 +08:00
Johnson Ding
9ba1054f17 [vepu_common]: Fix YUV420SP offset calculation
Change-Id: I4a53b49b0de27cb49fe120ae2f54d341ba597af3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-29 11:37:04 +08:00
Yandong Lin
bb6cd661cd [hal_h265d_vdpu34x]: Fix input a wrong param issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I914cab4a0f08dea79dcdfd1463bda61295bb918d
2021-03-26 18:07:04 +08:00
sayon.chen
d8bc45a936 [mpp_enc_impl]: Fix rc print issue
Change-Id: Idc109d9ec29a85cd6ce8c9276eb77ac298eac1bc
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-03-26 16:15:47 +08:00
Johnson Ding
99d8c99902 [hal_h265d]: fix build warning
Change-Id: I197d57c1c7652bde350d3c570a75ed5e413c01d7
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-26 11:08:59 +08:00
Herman Chen
f35aae8a04 [jpege]: Add jpeg slice encoding mode
Change-Id: Ib0a919bd2e1c4da5968a0d7f378e455e9a40367c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-25 20:57:59 +08:00
Herman Chen
ed7e3af8fd [vepu_common]: Add function for offset calculation
Change-Id: I792239329bc62fa05ec3a8f2f76634628aa521fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-25 20:56:53 +08:00
Johnson Ding
e0025fd3bd [jpegd]: Use memchr instead of memrchr
The memchr() function is a GNU extension, available since glibc 2.1.91.
Glibc at some platform may be too old, or some platform may using uclibc
instead of glibc. So it's better to use memchr().

Change-Id: Id400e9d347a7abd231b417208abc5d02452462a6
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-25 11:06:59 +08:00
Johnson Ding
a54b395fd6 [hal_h265d]: Correct register definition and print
Change-Id: I0b77a9e59d13b72db2995501d6f8450843132485
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-25 10:14:05 +08:00
Johnson Ding
0250dab00c [h264d]: fix field combination error
Change-Id: Iad69f04299911d3b593d6719eff80e8c6436e5d8
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-22 09:27:44 +08:00
Johnson Ding
cfa8d380bd [h264d]: fix ref list check error
Change-Id: I2e0b44f92b95711de2bf3caa4c25c5ceead065ea
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-03-22 09:26:23 +08:00
Herman Chen
2b69a5e190 [hal_h264e_vepu1]: Fix error on sei_mode
The remain stream msb/lsb is rewrited by mistake.

Change-Id: I99bf21852b49bcecda103e7c9bd8051364c29c32
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2021-03-19 11:34:24 +08:00
Herman Chen
a4ed23117b [mpi_dec_test]: Add MppDecCfg to setup decoder
Add MppDecCfg and string control to add more extra control.

Change-Id: Iead4bd938691af3eac76368421c04c3ebd1f6272
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-17 11:42:04 +08:00
sayon.chen
4fa1aa8604 [hal_h265e_api_v2]: modify v2 api func register
Change-Id: I75032f6d26c705190a4a8432f52b178e04aa64db
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-03-17 11:42:04 +08:00
sayon.chen
128c1054bc [hal_hevc_541]: Fix madp get error issue
Change-Id: I5d43d6142970c8c6dc73a5801daf4475d8a4bb12
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-03-17 11:30:46 +08:00
Yandong Lin
b1813791df [vp9d_parser]: Fix invisible frame being released prematurely issue
The invisible frame will not be output normally, so it must be released
 when unref_frame.
But sometimes, the invisible frame will be instructed to output, and
then it cannot be released when unref_frame, otherwise the user will
get the buffer that has been released.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I6bb014e0e5b6d52312639c4ad858b93b45f5d622
2021-03-17 11:28:12 +08:00
Herman Chen
85dcfcc8e6 [rk_mpi]: Add rk_vdec_cfg.h
Change-Id: If15b5eb8b0222c1a3978d3ca7c3d4a7fc83faa73
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-17 10:55:48 +08:00
Herman Chen
690e96685e [mpp]: Return buffer full when poll failed
For ffmpeg plugin compatible.

Change-Id: Iba580bd63de249f6a633e2c0ec8618addeee9ef1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2021-03-17 10:38:24 +08:00
Yandong Lin
5599465f7d [hal_vepu]: Support fd and offset to be set separately
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie186589473420cc10551b6c113b9f9c8a3ed4d5d
2021-03-16 16:36:19 +08:00