Commit Graph

2404 Commits

Author SHA1 Message Date
sayon.chen
0b0d0db215 [rc_base]: Rewrite rc_base code
1.use cycle buf update statistics param
2.remove unused function

Change-Id: Iaeae290a30482b55842373f443863cf167b9ea71
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-10-09 09:05:26 +08:00
Herman Chen
e509662728 [mpp_frame]: Make MppFrameFormat value visible
Change-Id: I1276af32ca4907bfabae2664ff6f0fe67eb8aa0d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-09 08:54:59 +08:00
Herman Chen
51d01e0069 [utils]: Fix error on RGB color fill
Change-Id: I5b7768e410135910d5c20994c84629678cd37524
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-29 16:39:10 +08:00
sayon.chen
96aad17638 [rc_v2]: Used I frame tuning config set
Change-Id: Iaaa717268804e047fa51bb0cf05790e25df143ba
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-28 17:59:02 +08:00
sayon.chen
d8a5fb18b7 [rc_v2]: Reorganize rc_mode_v2 code
ratio_calc used Register function in mode init according rc_mode

Change-Id: I0317ecc004a2c882e005cf791207c6a5a7e50598
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-28 17:59:02 +08:00
Herman Chen
f8b77d6aa2 [h264e_syntax]: Simplify h264e_syntax
1. Move sps / pps / slice / dpb definition to there own header.
2. Prepare to add new h264e syntax struct for hal.

Change-Id: I95e884afcf08fa51bdeb6f1e6571c264d9a609ec
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-28 09:53:49 +08:00
Herman Chen
04137732ac [h264e_syntax]: Rename syntax for h264 encoder
Change-Id: I742d251905f083d5636c61b98d9125421b90f3de
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-28 09:33:48 +08:00
Herman Chen
16ba8b5820 [hal_h264e_vepu]: Fix stride parameter compatible
Fix stride definition to compatible to both pixel stride and byte
stride.

In MPI the stride is defined to byte stride. But vepu requires 8 pixel
aligned pixel stride.

So we add more code to adapt to both case and check 8 pixel alignment.

From opengles definition:

Stride means bytes in a row of pixels including padding. So an image
could be 510 pixels in width and rounded up to 512 pixels. The stride
would be 512 * bit depth of the image's format. You could also have
stride in pixels in which case the stride would be 512 pixels

Pitch is a little more vague, but typically could be interchangeable
with stride. Considering your reference is specifying in bytes, it's
likely safe to assume they're not measuring in pixels. So the reference
likely means the number of bytes in a row + padding, the only
alternative would be number of bytes without padding e.g. image width *
bit depth.

Change-Id: I20acf71e2a6bea2eb08b41fe7df531154ebef897
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-28 09:25:06 +08:00
Herman Chen
7987b57bd1 [hal_vp8d_vdpu1]: Fix vp8 decode error on vdpu1
Change-Id: I629e90ab0582d9d7c144646c266e51d64396b20a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-25 16:38:53 +08:00
Herman Chen
dbd5ae4099 [mpp_enc_v2]: Fix header not send on frame drop
When the frame is not encoded do not set ready flag in header status.

Change-Id: I21980d48a5abedc562de9875e24466fea5315121
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-25 11:52:00 +08:00
toby.zhang
bf48567dcf [vepu541_h264e]: Reduce video trailing error
Signed-off-by: toby.zhang <toby.zhang@rock-chips.com>
Change-Id: I09e7e6c9bdc29c48638f4f00b154140ae897b681
2020-09-25 10:53:55 +08:00
oirmario
4f10068859 fix in mpp.pc vpu.pc for crosscompile.
Change-Id: I4caee98b741cb613547daa8f58018fd90d3d0f39
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 14:27:04 +08:00
Herman Chen
094af953b3 [rc]: Improve coding style
Change-Id: I697737a96907cc15c188665621c669e2ef5a466b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
Herman Chen
5859a7c50d [mpp_enc_v2]: Add error process flow
Change-Id: Ibcf967d91f533eeaa9a5c5f4b0337f5d3e3bf4b6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
Herman Chen
da1a54f86b [vepu541]: Fix roi buffer access iommu fault
Enlarge roi buffer size for 32 bytes to avoid hardware iommu page fault.

Change-Id: Ibdf6bcda2b0b6ea6e1cb2aef54dda8516b2dfb72
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
Herman Chen
dc17320a94 [vepu_h264e]: Do not run mb_rc on I frame
Change-Id: Ibf96b993b6bbc33836cea34900589c263306546c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
sayon.chen
31b43445f8 [mpp_enc_ref]: Fix header not update issue
When encoder reference config is changed the stream header should be
updated while keep_cpb is not set.

Change-Id: I20432b80fbcd702b5f04391f8c9ff18627d72f53
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
Herman Chen
5c199eb5b5 [vepu541_h265e]: Update H.265 fine tuning config
Change-Id: Ia8804a23ac43ebc0586137068dda99824866d5ca
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
sayon.chen
901e511c3c [vepu_541]: Return error when send_request fail
Change-Id: I06271e6e51ab023f935ba5c5136d4b96cb7936f0
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
Herman Chen
3f9eb1c4ff [rc]: Separate different video coding rate control
1. Use rc_model_v2 as a common rate control method.
2. Separate rate control algorithm on different video coding.

Change-Id: Iebb9ba8db14cd19ca8a4e091a6c879e29ec5693e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
Herman Chen
304df8fbf4 [mpp_enc_v2]: Add drop and pskip flow
1. Separate rc_frm_end to rc_frm_check_reenc and rc_frm_end.
2. Add drop mode parameter copy in H.264/H.265 encoder.
3. Separate normal encoding process and reenc/drop flow.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ica29eb6d5e700fb51c4019e39c42f4918857ac71
2020-09-24 11:54:22 +08:00
Herman Chen
cd311d877f [rc]: Separate check reenc and rc_end function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib594afdd25a0e4283612fd5808a27b229d40f597
2020-09-24 11:54:22 +08:00
Herman Chen
a2cc66bc7a [vepu541_h264e]: Video quality fine tuning
1. Increase Intra frame quality.
2. Disable some options.
3. Change default parameter table.

Change-Id: Iee2494eb92217c33313a117969b1e080a8630468
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:22 +08:00
Herman Chen
693facdf9e [hal_jpege]: Fix error of jpege reenc
1. Update header length before hardware encoding.
2. Update hw_length after hardware encoding.

Change-Id: I89ef0503c029f8b7e702c2c3437324cc1808eab9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-24 11:54:00 +08:00
Herman Chen
85ada595ee [mpp_enc_cfg]: Add encoder I frame tuning config
Add max_i_prop, min_i_prop and init_ip_ration for I frame tuning config.

max_i_prop:
The max percentage of intra frame size in one gop.

min_i_prop:
The min percentage of intra frame size in one gop.

init_ip_ration:
Define the first I frame size is how many times of one P frame size.
Set to 16 mean I frame size is equal to P frame size.
Set to 160 mean I frame size is 10 times of P frame size.

These three parameters are for tuning Intra frame quality.

Change-Id: Iac1e700fe2a51fb3a6ad94753784cd54ee789176
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
sayon.chen
13bf4e3f41 [h265e_v2]: Add temporal_id set
Change-Id: I3eb631c92ea3bc4c9332d7fbb8597849afdb13af
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
Herman Chen
e3278d7655 [vepu541]: Fix OSD AYUV bit order definition error
Change-Id: I89ddd7b626873ea1d4ba22569f79d8706b216b55
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
sayon.chen
8653a80c36 [mpi_enc_test]: Support camera capture encoder
if input file name is start with "/dev/video",  default  open camera
device as input.

Change-Id: I85d639ddb6fa5d99413ea75a0b088c79798dd6c8
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
sayon.chen
12431e34d6 [utils]: Support camera as input source
Change-Id: If2a91a7436e05be4705425db40b0b1d41347f4c8
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
Johnson Ding
45228ab7ff [jpegd]: fix stream copy not working problem
Stream modified and assigned to MppPacket won't be retrieve by hardware,
since hardware get stream by fd and this operation doesn't overwrite it.
Another way to slove this problem is doing memcpy at mpp_dec right after
calling mpp_parser_prepare, just like the 6th step at try_proc_dec_task.

Change-Id: Icea9516ab1ea92239613f7daa001018e581a8a2c
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-09-23 10:28:43 +08:00
Herman Chen
4b386eba08 [mpp_frame]: Fix using ffmpeg definition
Do NOT use ffmpeg define.

Change-Id: I018cbd56db12d708d5a9db20523d674248ba540f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-17 15:52:09 +08:00
Herman Chen
77a795a7fc [rc]: Fix bitrate error on low fps out case
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Idd74ae718d3a597c95ba541b9ae5a9fabfa4c871
2020-09-17 15:52:09 +08:00
Xinhuang Li
879c161b9b [jpege]: change the upper limit of bps setting to 500Mbps
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
Change-Id: I13f8861a60f45def091fc7442ca7096d9833f560
2020-09-15 09:04:15 +08:00
Herman Chen
6871f65035 [mpp_enc_impl: Add software encode path
1. Remove encoder reset / flush / callback function.
2. Add sw_enc for software encode path.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0c62bdc1ae28272dc30922781be8188ed49f9e9f
2020-09-12 11:12:46 +08:00
Herman Chen
d733a62fba [cmake]: Improve version history record
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I86cc8e9b4788e2d0a3f296f127e7e938c0b0cde4
2020-09-12 11:12:46 +08:00
Herman Chen
95670aa475 [mpi]: Add rk_venc_rc.h
1. Add rk_venc_rc.h for rate control definitions.
2. Add drop parameter to set_rc_cfg.

Change-Id: Iab27a1505ba187f512815f7ab00cd0ea7f863cb8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-11 16:32:38 +08:00
Herman Chen
a620c88e80 [h264e_dpb]: Fix on_used not set on cpb rollback
Change-Id: If03df1e69a11ba4550956e34d97687c8bd3da6d6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-11 16:32:11 +08:00
Herman Chen
a2c289bbce [mpp_enc_ref]: Add st_cfg repeat value check
1. When repeat in st_cfg is negative set it to zero.
2. Do not insert non-reference frame when smart oop vi_len less than 2.

Change-Id: Icdf2be21fbbe0a919f7c3006d9c1dde5dfc5ffcb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-11 15:29:39 +08:00
sayon.chen
74cc83f69e [rc_v2]: Support avbr ratecontrol
when select avbr must set target_bps max_bps min_bps,in still scene
will used min_bps for enc, in the moving scene will max_bps for enc.
and final avg bit will get close to target_bps

Change-Id: I84b2878c7e76b18a593ca2a0d99c0c8f26a2d557
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-11 11:15:55 +08:00
Herman Chen
fc6d13f5d3 [vepu541]: check max buffer count on hal_buf_setup
When creating hal buffer for vepu541 check both buffer size and buffer
count.

Change-Id: Ice1afa70f5458b74d1d2f98fc772c6e0a3e4cbf7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-11 10:59:21 +08:00
Herman Chen
e8a428ea04 [mpi]: Cleanup unused definition
Change-Id: Ib8490abf7241f432164f647165b1c67c618c1168
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-10 14:59:03 +08:00
Herman Chen
ccf97315fe [mpp]: Remove obsolete mpp_enc path
All encoders will use mpp_enc_v2 path.

Change-Id: I7ab66e70760a4685086f73735fb11386039d639e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-10 10:22:46 +08:00
yandong.lin
46a33b2459 [mpi_enc_test]: add vp8e rc test demo
Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I56b97b8df9e137f4005c3731c87d63539308b1c6
2020-09-09 16:34:01 +08:00
yandong.lin
5ea05d986e [vp8e_v2] add vp8e v2 implement
1. add vp8e_api_v2 module
2. add hal_vp8e_vepu1_v2 and hal_vp8e_vepu2_v2 module
3. add default rc for vp8e

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I6c0e9b0a0a7654b92905ac50431ba3f4b023c2e2
2020-09-09 16:09:31 +08:00
Herman Chen
b56cfdb688 [mpp_enc_cfg]: Add frame drop paramters
Add frame drop parameters for frame drop behavior on bitrate overflow.

Change-Id: Id90fbd0c63b1a0909e426a2c9f09c8b371bec0b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-09 15:21:54 +08:00
Herman Chen
b2aa5b404b [rc]: Do not reenc when quality max reached
Change-Id: I3cce5d8124d9c40d37ca8cf0978580a3aeb80efb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-09 14:44:18 +08:00
Herman Chen
f1ebb21814 [mlvec]: Fix error when ltr_frames larger than 3
Enlarge max ltr_frames support from 3 to 16.

Change-Id: I2d87a956019cbb4ce807aedc7be2d0c4987fa4d2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-09 08:57:41 +08:00
sayon.chen
74f2f76fd7 [mpp_enc]: Support vui colour_description set
Change-Id: If84d8b04ce6ea430ed38d39c339eb9da783c6510
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-08 14:32:45 +08:00
yandong.lin
8f953b3106 [h265d] fix cut extension data fault in case of multi slice
when stream has multi slice, it will occur error to
cut the slice header externsion data in slice header segment.

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: Iaab8a9ea145aa7539d7401be22493619ce98df95
2020-09-08 09:05:59 +08:00
Herman Chen
e83f07e4e5 [mpp]: Obsolete MPP_ENC_GET_EXTRA_INFO
Obsolete MPP_ENC_GET_EXTRA_INFO in vpu_api_legacy and mpi_enc_test.

Change-Id: I3209a1af112ca073e3f61bbff60d8c2844c00ed1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-08 09:05:59 +08:00