optimize the size of some structures as blow:
1. H264dVideoCtx_t
2. H264dCurCtx_t
3. DXVA_Slice_H264_Long
Change-Id: If3d7ca2f8d92d2a590767a97324537700848ab90
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
NOTE: RGB format horizontal stride is byte stride. The pixel_stride in
MppFrame is the stride by pixel.
Change-Id: I09e87c5f7fb871ee2b285451ed2f0abfb1351f19
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Compatible with some jpeg images that do not start with ffd8, but messy
data.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I963e16cb499af13fe95358e60f44e91d0df17bf3
When a new sps/pps nal is detected the spspps_update flag must be set.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ida86fae2dbe5e2db5171504859ff6fe65b2c0828
1. In mpp_buffer_ref_dec it should be locked on search group by id.
2. Remove extra hash_32 on adding new group.
3. Improve id searching on id overflow.
Change-Id: Ibef4612e48b5a4c9dd6c5eca6c85f8ccba813827
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When nal buf len is 0, nal buf shouldn't be read.
e.g. the following stream, the nalu_len will be decrese below 0,
it will crash to read nal_buf[] with invalid idx.
0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Iafa103fe4f6df7cff41ffbdf6c94b42736456bcb
The static lock maybe release before mpp_buffer_service. So we should
not used the lock on finalizing stage.
Change-Id: Ibf207e02e4fcdc2b5280ea58bd68372a7888a60a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When /dev/mpp_service is opened and be forked to another thread the
leaked fd will increase file refcnt in kernel.
Then the codec kernel session will be leaked on mpp_destroy.
Change-Id: I5bb682792c8e58591ec3a21af36e3f8a967f77fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
There is a bug when using single drm allocator device for all buffers:
Sample:
1. external fd a is import to mpp_buffer and get handle B / fd b.
2. external fd a is import to mpp_buffer again and get handle B / fd c.
NOTE: The handle is the same in mpp for drm allocator is the same
and the handle ref_count is not increased.
4. release fd b and handle B. (NOTE: The handle B is released in kernel)
5. mmap fd c by handle B. (Crash on getting handle B in kernel)
So we should reacquire handle for fd c when it need mmap or free.
Change-Id: Ide0591f97be5e00ca71f6a16e0ff676c4ed206a5
Signed-off-by: aaron.sun <aaron.sun@rockchips-com>
Incase of some application not reinit Mpp Context for the next JPEG
decoding, some of syntax info will not be overwrite and it will leads to
hardware decoder error. So syntax struct should be cleaned before
parsing.
Change-Id: Iea8d76f0086fe7675d463f497c7a9dc106bdb546
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
When split_nal_units found valid nal to decode just return success and
let hardware try to decode the valid nal with redundant data.
Change-Id: I7afb4bd55181d583f46dfc0192c622fc88445d6d
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
When mark IDR frame as longterm reference frame the longterm reference
frame index must be zero. So when user marked IDR frame to be non-zero
lt_idx just reset it to zero lt_idx.
Change-Id: Iec994f6891269ac47137ec68c2c82db5f33f40da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add hw capability to parser and check resolustion based on
hardware capability.
Change-Id: I6f7ff7a56d0e46d6ca9cb0dcd547e74fd15d7bc1
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Add hw capability to parser and check resolustion based on hardware
capability.
Change-Id: Id9b719b238c74d6b77f78fd8d583a3de854a94f4
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Return hw detection result from iep2 hal to vproc.
Change-Id: I53acb5260b5806abb6ba9085b81c967f30ea3f13
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
Field order detected by hw will be covered by outside config
in previous commit, and cause video jarring when video field
order provided by video header information is incorrection.
Change-Id: I2d76ff5dc544026acd6450965294998bf9ecc06a
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
When fail in store_picture_in_dpb, the dpb_mark and fs binding failed,
the num of dpb_mark and fs does not match, so should flush cur dpb_mark.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I03acc107de655297857fbe56a0f4434576cca49e
When a new start code is not right after the last marker section, parser
will go wrong.
Change-Id: I84a06ed697ccb5900fb76044f36a00f4ea7566f5
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
When decoding a YUV444 picture with format convertion, it may encounter
timeout error.
Change-Id: I9a9f6eda6c9ee92e029530c0dbbb8ad7f48d9d18
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Abort decoding when parser found corrupt stream
Change-Id: Ie828ed61b12cf6dc0817a8e96fddc9940e4f4efe
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
In case of some JPEG file with multiple stream header, continue to
search all markers even SOS is found.
Change-Id: Ic13c2d43f97a4b52ec5233db2de362d83ccb86a9
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
EXIF and MPF data can be write by send user data via KEY_USER_DATAS.
Change-Id: Ib9b5a117433437c202bf354d59dc404c76a4db5f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>