Commit Graph

33 Commits

Author SHA1 Message Date
Johnson Ding
7e13df0813 [jpegd]: Fix paser error
After pasering SOF makers and DQT, DHT etc, buffer pointer should point
to the position after what has been read. Otherwise, paser will be
finding markers right after the last marker. And may lead to take datas
in DHT or DQT as markers.

Refer to this issue: https://redmine.rockchip.com.cn/issues/212649

Change-Id: Ie4edc8ab43aeedf1678894a9968a1254ca10ac50
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-07-10 10:51:18 +08:00
Johnson Ding
d2459e4fac [jpegd]: Add YUV400 support
Change-Id: I110f0f2a16977f985d32204704ca4c2effcd8b90
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-06-12 10:55:58 +08:00
Johnson Ding
869ff44980 [jpegd]: Fix jpegd decode error when img without DHT
That is a coding mistake.
See issue: https://redmine.rockchip.com.cn/issues/201155
In the attachments, the "cam.jpg" is a jpeg file without DHT. And it can
be used for testing.

Change-Id: I68086a19958b353d5aee6597b47ee9ac8b02c4d0
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-11 11:37:10 +08:00
Herman Chen
7d1f812873 [jpegd]: Add YUV444 support
1. Fix missing 444 case on parser stage. Parser should setup YUV444
   format for original jpeg stream format.
2. Fix missing case on MPP_DEC_SET_OUTPUT_FORMAT. When user change
   the output format the corresponding MppFrameFormat should be
   changed.

Change-Id: I111ba2bcadd675339bfe2948a054301780177f9a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-10-12 15:35:08 +08:00
sliver.chen
eb28892adc [jpegd]: add information if input img format may be png
in some case,user may think of png bitstream as jpeg.
and file suffixes can also easily lead to misunderstandings,
so add warning to prevention is necessary.

Change-Id: I2ed319033706b2ef48c8b34c6cdc77098137827c
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-19 17:20:38 +08:00
Randy Li
45c05512eb [jpegd]: stop the future work when the parser is error
It is not necessary to allocate or decode an error input
source.

Change-Id: I81075a6ea696d2699ec595a02cdcd5163736d27c
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-12 17:35:09 +08:00
timkingh.huang
738704e6a2 [jpegd]: just scan parts of markers for rv1108
This can reduce CPU's occupancy, which will result in a problem
that jpeg parser can not judge if input stream is integrated.
Fortunately it doesn't matter for most of cases.

Change-Id: I77d59dc1642f0967e75ba9d15741eeb24789f87c
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-10-31 11:28:26 +08:00
Randy Li
c8cf942c2b [jpegd]: fix the compiler warnings and hide some symbols
The internal of the parser had better not be exported.

Change-Id: I4c3d786ebc0424e90d135a43aaa027daac390291
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-07-07 15:05:38 +08:00
Randy Li
01943db26d [jpegd]: parse only one image a times
The default behavior of the JPEG parser should ignore
the reminined data.

Change-Id: Id097cf6997bcef048afcbeb9eb72319373dd9ae7
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-05-02 16:38:02 +08:00
timkingh.huang
93aa8a0c8a [jpegd]: modify jpegd parser
scan the stream just for one time in jpegd parser and
remove redundant codes.

Change-Id: I72920b15fc4ed15cfa1de55d9ed249d50cceebb2
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-04-01 18:25:15 +08:00
Herman Chen
c3527bf8f5 [misc]: Fix compile warning
Change-Id: I9eec2fc4074cd925dd34aa561390e3f83f3ec72e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-24 16:36:54 +08:00
Randy Li
091567e079 [jpegd]: Fix compile warning
Change-Id: I92e9c672fb89c717a70e874679b52700a9595b89
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-24 12:05:08 +08:00
timkingh.huang
de952332dd [jpegd]: add stream copy flag
Get stream copy flag from soc_name because there is no need
to copy stream for RV1108.

Change-Id: I65d4ee6b9bbb5bb650a09dd24448fe90a2965cd2
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-03-09 15:01:25 +08:00
Herman Chen
bb53bc2bbf [jpegd]: Fix compile warning
Change-Id: I735125646ff629b195421f48ec46962ebecb33ca
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-21 09:17:07 +08:00
timkingh.huang
49a88d995e [jpegd]: adjust register configuration
1. only if height is 8-pixel aligned but not 16-pixel aligned,
bit 20 of reg148 is enabled.
2. default output buffer size is set to 2*width*height.

Change-Id: Ib23e1530c4c6a6688c3f8e632ba3f0b8e2b3c352
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2016-11-22 20:13:41 +08:00
timkingh.huang
77bb910876 [jpegd]: set output frame info
when one frame is decoded, set frame info such as width,
height, yuv format, display width and height, so that
upper application can handle decoded frame properly.

Change-Id: Ide89e55ac200304e7c2c49d31b6a9cd8c9feb6d9
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2016-11-18 16:48:31 +08:00
Herman Chen
04b6a23ce2 [test]: modify mpi_dec_test for mjpeg decoding
1. clear input packet length when packet is copied
2. modify mjpeg advanced decoding path in mpi_dec_test
3. add numerator and denominator set prop function
4. remove extra log on first info change
5. fix eos process and buffer size check in advanced decoding flow
6. fix jpegd stream length config error

Change-Id: Id6c26ebda090eb4076f27deaad4d61b4221f2653
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-10-10 11:03:59 +08:00
timkingh.huang
44852d9696 [mpi_dec_test]:add advanced decoding path
(1) when decoding mjpeg, switch to mpi_dec_test_decode_advanced
(2) add advanced decoding interface for mjpeg in vpu_api_legacy.cpp

Change-Id: Ib1848d1686c76826385f76405dda81dd0405cb62
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2016-10-08 08:57:41 +08:00
Lin Kesheng
60373a6973 [all]: format code
use fromdos to change file type, remove ^M in code.

Change-Id: I000202dc51fcff57cc0771455baebea595115b1d
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-08 15:21:02 +08:00
leo.ding
83222e8ed7 [compile]: remove warnings in vs
Change-Id: I468c8d9094a76e42a0a45e3c3541f1f41fc40b3c
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2016-08-25 21:33:31 +08:00
HuangTingjin
7db8ceecc4 [jpegd]: fix bug: input buffer size is set incorrectly.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1196 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-15 11:57:40 +00:00
HuangTingjin
aa9adac089 [jpegd]: remove codes of slice mode.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1193 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-12 01:46:31 +00:00
ChenHengming
4f7f69c1ae [mpp]: fix compile error on windows
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1191 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-11 10:16:44 +00:00
HuangTingjin
33f09224ea [jpegd]: reallocate a socket if it is VPU_DEC_PP and remove some redundant codes.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1188 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-11 03:08:31 +00:00
HuangTingjin
d86dad42c0 [jpegd]: add implementation of hal_jpegd_control and remove some unused codes.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1186 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-10 09:47:24 +00:00
HuangTingjin
592abf7851 [jpegd]: move set_output_format function from jpegd_parser.c to hal_jpegd_reg.c.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1184 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-10 06:37:14 +00:00
HuangTingjin
fdc9c5d4b4 [jpegd]: add implementation of jpegd_parser_control.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1180 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-09 12:24:54 +00:00
HuangTingjin
2d3182898d [jpegd]: remove some unused codes.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1141 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-02 02:05:36 +00:00
HuangTingjin
72da0376dc [jpegd] decrease input buffer length and allocate new memory if input buffer length is too small.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1136 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-01 10:09:12 +00:00
HuangTingjin
3df1003aad [jpegd]: fix memory leak.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1132 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-31 11:44:22 +00:00
HuangTingjin
1407f07185 [jpegd]: add implementation of jpegd_default_huffman_tables.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1103 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-27 03:39:11 +00:00
HuangTingjin
448771db51 [jpegd]: handle special stream and eos in parser_prepare and format source code with mpp_astyle.sh in Linux Server.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1102 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-27 02:57:06 +00:00
HuangTingjin
a82bda1f00 [jpegd]: add jpegd source code file and comment jpegd in support_list.
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1099 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-26 09:32:21 +00:00