Commit Graph

1911 Commits

Author SHA1 Message Date
Herman Chen
7cbb8325e2 [vpu]: Remove unused code
Change-Id: I81864036c2951154de666f568ccc63c69c7ca7bd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-09 14:56:35 +08:00
Herman Chen
78a1778820 [h264e]: Add intra task flag for output packet
Change-Id: I55ee0bd825c77aa7172a89e86f40dfd406511c41
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-09 14:56:35 +08:00
fangxingwen
a1bebba268 [legacy]: remove buffer limit size in internal mode
Change-Id: I9306c52a57acb6c42b1bb643045f2b0adaa51169
Signed-off-by: fangxingwen <fxw@rock-chips.com>
2017-03-08 17:10:20 +08:00
Randy Li
e254d8c15b [h264e]: fix the alignment check
The encoder only require the stride is align with 8 bytes.

Change-Id: I3206b06af5427216c9e7a121424afda5297f7b62
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-06 15:47:56 +08:00
Randy Li
00ee65d28f [h264d]: remove useless code to disabe warning
Fix issue:
https://github.com/rockchip-linux/mpp/issues/1

It makes no sense and generates an uncomfortable warning message:
mpp_buf_slot: mpp_slots_set_prop found invalid input slots

Change-Id: I8a26cd58aa10d03add371c88bb81e19f2a83cd70
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-06 14:44:13 +08:00
Herman Chen
f940297505 [coding-style]: Remove tab and extra space
Change-Id: If9a05bf2c957ff3c48ace56ab74be534a1b192dc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-03 18:26:16 +08:00
leo.ding
96feaee816 [vp8d]: fix bug when calculate control partition length
Change-Id: I9d51ea3a8bb08c4082450893c978b7cbecd5bc93
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-03-03 18:07:55 +08:00
Randy Li
fa8bf72d6f [hal/h264e]: add support for VEPU1
The VEPU1 is an old IP used on rk3066 / rk3188 / rk3288 / rk3368 / rk312x.

Change-Id: I9fdbaedbc8311129cf4fdac4cae614ad624d5f93
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-03 18:06:33 +08:00
Randy Li
a4fa50eed8 [h264e]: move H.264 header generation functions
All the H.264 encoder could use the same function to generate
those header info likes: SPS, PPS, and nalu header.

Some other help functions used for encoder also be moved to
here.

Change-Id: I45b9f3ef7046fc95e649796ff54852c336055bf6
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-03 18:06:33 +08:00
Randy Li
87f97ed3a9 [h264e]: rename the old vpu function to the vepu2
Change-Id: I6642aa183d318f59d508dfe44630fed6136099d1
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-03 18:06:33 +08:00
Randy Li
a518a1cfe7 [h264e]: rename the vpu implementation to vpu2
There is a video encoder IP which is departure, having a similar
name to the currently device. Although there is not relation
between they but I have to keep them in the same directory.

To avoid conflict and confuse, I have to rename those files.

Change-Id: Ib924fa8e9f20259d704e685595cd06b3d6b7f958
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-03 18:06:33 +08:00
Randy Li
ec4a74ebb7 [h264e]: use platform detection to choose target
The new platform detection could cover more target devices than before.

Change-Id: Icf97320a7e381c444fa90803a0c99fd28fda4ff1
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-03 18:06:33 +08:00
Herman Chen
4b41fdd8bc [mpp_platform]: Modify chip vcodec detection
1. Add video codec information and kernel driver device detection code for all
supported chips.
2. Add video codec type and device name detection test

Change-Id: I275c0e616acd80c9a4ad2fee00588479e47a92db
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-03 16:12:36 +08:00
Randy Li
cbbba2c361 [mpp/hal]: add define for RKVENC
RKVENC is a new generation encoder found on the rockchip platform.

Change-Id: I1fb4a052aebe0a1f7f5083736141eda2cc83ac98
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-03 15:52:41 +08:00
Herman Chen
344229dfb9 [coding-style]: Clean up coding style
Change-Id: I3c0c11cfb5fa759ac2f64113299492bc6a78d485
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-03 09:24:51 +08:00
Lin Kesheng
1d0413bd03 [coding-style]: implement git hook pre-commit
Change-Id: I0270d9c07655a965c5e4fda0cc03e44d0a5d8946
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-28 18:13:03 +08:00
Randy Li
70f33c3dfc [mpp/hal]: add enum type for hardware mode
Not only H.264 decoder would have different IP supporting this
format. It is better to be used as a common type of hal part.

Change-Id: Ifbc1d0de189cc2799d39e26a16e78a71a5f6aa32
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-02-28 17:26:19 +08:00
Lin Kesheng
c1665998c3 [h264e]: transform_8x8_mode is not limitted for smaller resolution
Change-Id: I5ba70b325580c0936d72bc553a95f1c208533271
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-28 14:51:33 +08:00
Lin Kesheng
63eb5bf3e6 [h264e_hal]: clean up code
1. rename structures definition
2. rename functions definition
3. clean up log functions
4. remove unneccessary code
5. remove unneccessary comment

Change-Id: Ife6b36cefaa5a7b0da1ab24bc472769426a0a345
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-28 09:47:40 +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
alpha lin
64cd425968 [rc]: Modify quadratic regression model caculation
Using Gaussian elimination to calculate regression
matrix for less complexible.

And previous calculation method had a bug, will get
wrong model parameters.

Also, RC degrade the quadratic model to linear model
when get invalidate quadratic model parameters due to
statistic data vary sharply during video scenarial
change. And model caculation will be skip when statistic
data concentration.

Change-Id: I54763e4675b412abfae4e2e81dfa887d13bdc865
Signed-off-by: alpha lin <alpha.lin@rock-chips.com>
2017-02-27 17:05:03 +08:00
Lin Kesheng
d5dceef2c4 [coding-style]: add git hook to format code
1. please run hooks/install_hooks.sh manually for the first time
2. hooks/pre-commit.hook is called before commit automatically
3. format code

Change-Id: I4565b206da10abb59506ef73f62392c9e9690cd4
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-24 17:30:53 +08:00
Lin Kesheng
6a3d3e497f [hal_h264e]: validate pps.entropy_mode
For profile baseline, entropy_mode should be CALVC.

Change-Id: If655dc718063bc2b5485c997fefd2b30505d901f
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-20 09:51:04 +08:00
leo.ding
91149039e0 [mpp_frame] remove color parameters check on comparing MppFrame
If video stream change the range flag but keep dimenstion parameter the
same mpp should not generate a info change frame to external user.
But this should be handled in better way.

Change-Id: I9f11fb5e7265c4b09951c1eb40580b95e0f753a0
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-02-20 08:49:20 +08:00
timkingh.huang
23f9a2f54a [jpege]: fix jpeg encoder bug
Chroma offset is not set correctly because of wrong hor_stride
and ver_stride.

Change-Id: I930fd66054b40c8e36063221cb25d390b735687a
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-02-15 08:58:13 +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
alpha lin
2dbeb94ee8 [rc]: revise frame level Qp estimation
1. Apply quadratic model for new R-Q model, R = a + b / Q + c / (Q * Q)
2. Take sse in R-Q model calculation.
3. using hardware feedback QpSum to get a float qp value
   for more precise Q Step take part in R-Q model
   calculation.
4. scalable windows length according to complexity change.
5. extend the regression weight table to length 15.

Change-Id: I447087758b6599e65a98dcfc8f6382f950032899
Signed-off-by: alpha lin <alpha.lin@rock-chips.com>
2017-02-10 15:52:47 +08:00
Jung Zhao
0a472eabaf [rc]: rename acc_inter/intra_bits_in_fps
reset acc_inter/intra_bits_in_fps value when insert a i-frame

Change-Id: Ie7ab9f7505957f6be7439da8c76ff718d90d8bb6
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-02-10 11:28:33 +08:00
Lin Kesheng
bc0ce58c07 [h264e]: fix idr frame setting
Change-Id: I23857959dc8e156409597e4ac92c02bbd03560a4
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-10 11:07:43 +08:00
Jung Zhao
0c39d23bde [rc]: adjust bits allocation of ratecontrol
1. set first target size to bps * 2 / 3
2. re-encoder first frame, first time turn on mbrc and second
   time turn off mbrc and use first time real bits as target
   bits and average qp as init qp
3. modify intrapercent calculating
4. only use last gop extra bits for avoiding bitrate fluctuation

Change-Id: If7f79bc423602a8948edc455dd45bee727240d10
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-02-10 11:03:39 +08:00
alpha lin
17f8b33dd5 [rc]: revise weight linear regression caculation
Change-Id: Icf3f7ddd8424546b4c9e14751a10b4e7fd61c986
Signed-off-by: alpha lin <alpha.lin@rock-chips.com>
2017-02-10 11:03:39 +08:00
Lin Kesheng
3582a78e34 [hal_h264e_rkv]: implement mb rc configuration
1. add H264eRcCtx to control mb rc
2. define H264eRkvMbRcCfg to list cfgs on each level
3. merge from trunk
4. implement checpoint error_bits and delta_qp according the
   relativeness between qp and bits
5. correct qp_adjust
6. merge from trunk
7. correct traget_bit_error
8. VBR: adjust qp_min/qp_max according to quality configuration

Change-Id: I25eefc992c6e68842a675fd04286d0564bd5d2c2
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-10 11:03:39 +08:00
Lin Kesheng
eee502c5ae [hal_h264e_rkv]: Fix memory leak
Call function mpp_linreg_deinit to release the buffer malloced
by mpp_linreg_init.

Change-Id: I3ac51478da56cb03b36154a055d0617d783d2936
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-10 10:08:06 +08:00
herman.chen
d88b087526 [mpp_task]: Fix task condition release bug
Change-Id: I2d378cb7d0219823fdcc66f3ce65c22210576025
Signed-off-by: herman.chen <herman.chen@rock-chips.com>
2017-02-10 09:01:02 +08:00
Lin Kesheng
db10a78138 [hal_h264e_rkv]: modify assertion
1. remove assertion hor_stride==ALIGN(width, 16)
   For rkv, hor_stride can be equal to width, even width is not
   16 aligned. Ver_stride is in the same way.
2. modify qp range assertion
   For rkv, qp should be equal or greater than 1.

Change-Id: I102bf92f2af77e4f591c63fed31fcfe0ffe5642f
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-07 09:43:40 +08:00
Lin Kesheng
73f2ee87a7 [h264e]: add SEI writing
1. write prep/codec/rc cfg to SEI
2. mpi_enc_test add SEI writting test
3. write SEI one sequence once defaultly

Change-Id: I7dd00a20afe101d7ddf17c875f0704d91a8fea2b
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-06 14:23:09 +08:00
Lin Kesheng
d1857e4390 [hal_h264e]: move syntax from hw_cfg to sps or pps
including syntax below:
transform_8x8_mode, constrained_intra_pred,
chroma_qp_index_offset, second_chroma_qp_index_offset,
cabac_init_idc, enable_cabac, pps_id, profile_idc,
level_idc

Change-Id: I708f4126eba731758473f64197cf52cdc0592ca3
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-23 15:34:45 +08:00
timkingh.huang
d92760e77a [jpegd]: add errinfo for output frame
If input stream or hardware interrupt is error, errinfo
of output frame will be set to 1.

Change-Id: I50cf9d7d69b5530043f50a56b13ed4b2417ac40d
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-01-22 09:58:22 +08:00
fangxingwen
68963e0cba [m2vd]: fix gop header error
1. mpeg2 maybe not contain GOP header, so cannot judge err
   stream by Gop header flag.
2. extra data may contain seq header, but not decode start
   of this seq header, so we take the way of discard id.

Change-Id: I6f9516716b0553e34e9d89dfbdb343143d00366a
Signed-off-by: fangxingwen <fxw@rock-chips.com>
2017-01-20 16:20:19 +08:00
Jung Zhao
dfaf926fef [rc]: add rc log print
set h264e_hal_debug=0x8000 in environment to enable rc print
set h264e_hal_debug=0x20000 to store rc print in /tmp/rc_log.txt

Change-Id: I7f53d6a2e0f4a1b0085a074bf9bbc624aa8b07b2
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-01-20 11:54:21 +08:00
Jung Zhao
a85cf99e0c [rc]: add warning when fps is 0 and change it to 30
Change-Id: Ie2dad8d03873132d8b674d3416f818fd7a19db50
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-01-20 11:05:07 +08:00
Jung Zhao
a487b11725 [rc_test]: fix fps float exception
rc_test doesn't provide value to rc_cfg->fps_out_num, so fps is 0
inside mpp.

Change-Id: Ic92e86ecc45814087efb4b796a997ae51cb33799
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-01-20 10:20:10 +08:00
timkingh.huang
507abba33a [vpu]: add errno and error message print
Change-Id: I8502e3a743ac91edf5076405f706b432dbae0404
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-01-19 17:26:13 +08:00
leo.ding
85e7a18a7d [vp9d]: fix bug: when info change, parameters in reg_cxt should be reset
Change-Id: I6a35de8b494bcf21ace7ab675eed95ed3c2ab4fd
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-01-19 17:05:36 +08:00
Lin Kesheng
5ffc5535d3 [hal_h264e]: disable 8x8 transform for small resolution
For small resolution sequence if transform_8x8_mode is enabled
quality reduction may occur in ouput stream. So 8x8 transform is
disbaled for sequence which resolution is less than or equal to
1920x1080.

Change-Id: I54630347abda9f44cfdba0d3cbf256ba50fb6cca
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-19 16:44:13 +08:00
Lin Kesheng
5b633ce8dd [hal_h264e]: always set sps.chroma_format_idc to yuv420
For rkv and vpu, the only format supported is YUV420,
sequence in other formats will be converted to YUV420
by hardware.

Change-Id: I9de1141df2f290af9df824ec0090b7fa050a455d
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-18 14:26:44 +08:00
Jung Zhao
e86d330941 [rc]: fix frame count
acc_total_count will be set to 0 when a new gop start.
use acc_intra_count+acc_inter_count instead of it.

Change-Id: I14b1c75954f5994eb150d1f0ff7d822a74ed2359
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-01-18 14:18:44 +08:00
Lin Kesheng
b3fd37aa08 [hal_h264e]: always set pps.pic_init_qp to 26
Pps.pic_init_qp is different from codec_cfg.qp_init,
and is not included in user configuration, thus we
fix pps.pic_init_qp to 26.

Change-Id: I408528891f91cd394aa55fe3b8b0e51bdb0e051f
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-18 09:53:30 +08:00
timkingh.huang
726d4b470c [jpege]: fix jpege qtable bug
when configuring registers, qtable need to reorder in
particular order.

Change-Id: If4f9afa4ee3135bb4b0f24f0c0c0cc5d16503491
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-01-17 19:06:43 +08:00
Lin Kesheng
0ce6b79f74 [hal_h264e]: fix pps setting error
fix pic_init_qp setting in pps

Change-Id: Ib68d535b1f41d187bf118f0f6d157ae6622944ae
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-17 15:30:49 +08:00