1. Move mpp_rc_api.h to rc_api.h
2. Add rc base module from mpp_rc.
3. Add rc api and empty rc model.
RC module design:
Rate control is a highly user defined module. So we perfer to open the
interface and let users add their frame-level rate control model.
In order to limit the user behavior the API input and output is
restricted. User can use the provide rc base components to define their
own model.
Change-Id: I72c251e7807f675e973bc80ea55683cd57070b00
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. Add mpp_enc_hal module.
2. Connect hal_h264e_api to mpp_enc_hal for later usage.
Change-Id: Ia5dcb9a38004dd1f87daaa766699abb798297684
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
New hal api will change interface to the following functions:
1. get_task - receive one task from encoder and process hw rate control.
2. gen_regs - generate register set according to different hardware.
3. start - start the hardwara.
4. wait - wait hardware process one task.
5. ret_task - return the processed task back to encoder.
NOTE: change some function to v2 to avoid linker conflict.
NOTE: vepu2_v2 status
1. Add svc and gop ref implement.
2. Without rc config. The QP is fixed.
Change-Id: I5fa890e8e23c0abbc5abb5ce44111c8a10ea1817
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. Add start function for fps process and dpb backup.
2. Remove update_dpb function for dpb should be processed at one time.
3. Add device id to encoder config for header generation.
4. Add hal_ret syntax to encoder hal task.
Change-Id: I9dbbc831d46b267701901dc6e80db7efaa7a0b14
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Reg of pps_id should be 8-bits long, instead of 5-bits long. This leads
to hard error when pps_id is greater than 31.
Change-Id: I0ecb894a1aa0af4e66bffb97a19c8b4b9ab5a401
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
The principle of rc_data is to maintain rate control related data for
default and user define rate control algorithm.
Mpp internal work flow will automatically maintain these data. Then rate
control algorithm can just use the data by some APIs.
RC data has some status transaction betweeen different flow stage.
Stage 1. RcData is at unused status.
Stage 2. RcData is got by encoder and encoder starts to filling data.
Stage 3. When data filling is finished RcData is marked as done status.
Stage 4. When data receive max life cycle it returns to unused status.
Encoder will fill in the RC related data including:
1. Unique sequence id
2. Frame type / status
3. Stream size
4. Extra info (hardware feedback)
Overall status and stage diagram
oldest latest
+ + +
|last | current | next
+----------------------------------------------------------------->
| done | filling |unused
+head tail+head tail+head
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib71581d0585f60b46de20662ffe1d20989270884
1. Detect NDK path and version
2. Enable cmake multithread compiling if version > 3.12
3. Support specifying args to build script
Change-Id: I2179aeb5460de6b8d39a867ba3a4200c51b61be7
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
1. Fix error on no_output_of_prior_pics and marking syntax.
2. Add max_ref_num_frames and poc type to slice config.
3. Fix mmco count error and reading error.
4. Add more slice syntax log.
5. Add h264e_slice_write_prefix_nal_unit_svc function.
6. Use mpp_writer_align_one and mpp_writer_trailing to write tailing.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia3871b8818c1ba73884ab74b58200ea309e01a50
1. Use mpp define rather than H264E define.
2. Unify debug function to hal_h264e_debug.h.
3. Change h264e_hal macro to hal_h264e.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I924f717bbffbb37230d9eb3300969a4dce807def
The encoder will get parameter directly from MppEncCfgSet. The
mpp_enc_refs is not needed any more.
Change-Id: Id8b466a905ae10335159bba3ce8d1e5185e3c714
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add a new ioctl mode for kernel-4.19 or later.
Tips:
1. There will be only one device /dev/mpp_service in kernel.
User should use client type to distinguish different device.
2. Each codec use the same function as before.
3. Ioctl magic changes from VPU_IOC to MPP_IOC.
4. Update structure for ioctl argument.
Original structure:
data_ptr | size
In this mode has many sortcommings:
a) Need many ioctl cmd for different requirements.
b) Data_ptr not to differ library for 32 or 64 system.
c) Contain only one info ioctl once.
New data structure:
cmd_type | flags | size | offset | data_ptr
a) Cmd_type works like previous ioctl cmd.
b) Flags is extend to mark current data for any purpose.
c) Size is the same as before.
d) Data_ptr use 32 bits build in 32 system while 64 bits in 64 system.
kernel-4.19 related commit:
ib94ac0df876dfcc786b25ed3de6a68d861d2ef1e
cda9d27c62017309519bcbf8fe91057dfdc21076
Change-Id: I13d54a2e4823b7378265f100540916a22f62b9d4
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
fixed Chimera_1080p_short.mp4 decoder error.the issue
for this stream segment enable & map_update flag is set true.
1) in the paser status map_update must init to zero before read.
2) in hal_set last segment enable flag must set true if segment
enable flag is true.
3) the segment last id must update after this frame decoder when
segment enable & map_update flag is true.
Change-Id: Ia000c4687185f869229a8b6e36933bb5e1991e5f
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Don't do division it will cause missing precision.
Signed-off-by: Zhou Jing <tracy.zhou@rock-chips.com>
Change-Id: If7daba7bb18ef9def5188c386d17832e54f4cded
Set encoder output to block mode in mpi_enc_test.
In some case the demo will get NULL return packet. Use block mode to
avoid this error.
Change-Id: I8e7438b07f024a30f62bbb92382e210b06e47a61
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. Move hal h264e dpb/slice functions to codec.
2. The dpb functions support I frame gop interval, LTR interval, force
LTR and generating reorder/marking syntax.
Change-Id: I42654f33c9628bb3228afb6acf56c85c984a377e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. Move H264 encoder new SPS/PPS syntax to a new header.
2. Change include file correspondingly.
Change-Id: I29d2819c61871953f4981703cd11a4a26d90986f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This header is interface for different rate control strategies.
Change-Id: I4db0c3effbd5fbb0b52506774247e1f5483b9209
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Disable cache_en when the video resolution is less than 720p
Signed-off-by: Zhou Jing <tracy.zhou@rock-chips.com>
Change-Id: I17af1241d536ccb5fbabb0cb45537dfbe2e64bbb
NOTE: Add scaling list mode flag to rk_venc_cmd.h
Change-Id: Idd3b33c577ce5ffd79dabc850f7c98a98c1ac19a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. EncFrameStatus will be used in dpb, rc and hal config.
2. Remove misc config.
Change-Id: I32eb4460180f3eb0b1c866c3393ed6fc4b95b99b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
If dpb size calculated from Profile/Level is less than
max_num_ref_frames, then dpb size should equals to max_num_ref_frames.
Refer to this issue: https://redmine.rockchip.com.cn/issues/229257
Change-Id: Ia0b27dbc581e052a5adb82ee505130bc492a524c
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Tailing 0xff will always be done in hal thread. There is not need to
doing this twice.
Change-Id: Ide4fcc4a2e252be04067c6990fc6a8e9ba8ee824
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
When frame_num_value_allowed_flag is equal to 1,
If frame_num is not continuous,
errorinfo does not need to be marked
Change-Id: Icf68d4186dccdb1d647fbf69c767034dcb7088ac
Signed-off-by: Wenjie Yang <ywj@rock-chips.com>