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>
A picture vertical stride should align with 16. But in jpeg decoding
picture is dividing into 8x8 blocks. So hardware decoder is designed to
keep the original data rather than cut out redundant data. If more than 7
is need to fill into the height of a picture when aligning the height
with 16, there will be an extra line of 8x8 blocks which do not contain
any information of the original picture. In this case jpeg_height8_flag
should be enabled to tell hardware to cut out them. In other case,
don't. Otherewise there will be a 8 pixels-height green bar in the
bottom of the picture after decoding.
Change-Id: Ic042eb0b6deccb6fc3727d7a288b4cd4efd8320d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
1. Add slice function for hardware slice header modification
2. Add dpb function for hierarchy infomation parsing and list building
3. Due to these two patches are so closely related we need to make it
one commit.
Detailed changes:
1. Change poc type to 0
2. Add lsb writing
3. Add non-reference frame support and frame_num change
4. Add longterm support
5. Add multi longterm frame support
6. Add bit shift and 03 process
Change-Id: I70f6fa550a5d19069ec9b21c3d9ee1875ffbe59e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add encoder misc config for later extension.
Change-Id: Ie67b2d5e74227e5089b16752d8088a9502142ddd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. rk_mpi_cmd.h will contain cmd value only.
2. rk_venc_cmd.h will contain all the encoder command structure.
3. Move MppCtxType and MppCodingType to rk_type.h for better include
dependency.
4. Add MppEncRefCfg to MppEncCfgSet.
5. Remove rk_mpi.h dependency inside mpp.
Change-Id: I6b972738100fb60c0a6a9b7cfe0a012abf4205b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Move MppPort and MppTaskQueue function to mpp_task_impl.h.
Add caller parameter to mpp_port_poll, mpp_port_dequeue,
mpp_port_enqueue, mpp_port_awake functions for debug purpose.
Change-Id: I39f69d934d45b65c3bc751d71ec98388c2fb9849
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. Add mpp_meta_size and mpp_meta_next_node function
2. Move mpp_meta_size and mpp_meta_next_node to mpp_meta_impl.h
mpp_meta_size - Return node count in metadata.
mpp_meta_next_node - Return next MppMetaNode in metadata.
These two functions are useful in debug.
Change-Id: If0be59c4621fd8ba2e2dbe96124a653b397bac7c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Temporal id is the temporal layer id for H.264 and H.265. It is
usefull for TSVC stream storage and frame display.
Users can determine their behave according to this id.
Change-Id: I06f039b63e0665d3542dc6bd89cc6b52d957af25
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
MppPacket will NOT create meta data by default. Then user and mpp can
attach or remove flexible parameter without adding or remove
interface which will break binary compatibility.
Change-Id: I2c2ff24f7e1c22adb7085a75a4c857e5760d2eae
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
MppFrame will NOT create meta data by default. Then user and mpp can
attach or remove flexible parameter without adding or remove
interface which will break binary compatibility.
Change-Id: Ia3c0d15d6daa210deab7a7d5dffcb54303fbb73e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Move MppCtx, MppParam, MppFrame, MppPacket, MppBuffer, MppBufferGroup,
MppTask and MppMeta to rk_type.h.
Later development need to bring in cross reference between these
objects. So we choose to move these declaration together.
Change-Id: I7ea39138ca87d6ca4cb86556464a5de89d172846
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
After info_change is encountered by paser thread, HalDecTaskFlag will
have info_change flag set. Although mpp_dec_flush is called there may be
some frame still remaining in display queue and waiting to be output. So
these frames shouldn't have info_change set since their resolution and
bit depth are the same as before. What's more, the info_change flag has
nothing to do with frames need to be output.
Change-Id: Ia01d1ecca5a6deb1a5d2914c34147d5c46c21684
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
When there is [xx xx 00 00 03 01] 6 bytes data right after a start code in the
bitstream, parser will take [00 00 03 01] as start code. This is an error.
Change-Id: I7e530f77892c5316656588f6bbf634cfe4198859
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
The no_output_of_prior_pics_flag flag in apple airplay stream is true.
This will cause dpb slot leak in idr_memory_management function.
The no_output_of_prior_pics_flag flag require the frame before IDR frame
should be discard rather than display. So we need to unmark the frames
in dpb and then mark them to be displayed to avoid they to be send to
display queue.
NOTE: when clearing no output frame we need to remove it first with
p_mark->out_flag is false to insure the CODEC_USE flag in mpp_buf_slot is
clear. Then set is_output flag to true to avoid real output this frame
to display queue.
Change-Id: Ib9bcebe6b84ceb96350bf405b9bed96e7fa0ca2e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. When the width of a input picture is not stride to 16, vpu1 will
encountered Page Fault problem.
2. Make hor_stride and ver_stride less ambiguous, since they
should be set to original values from outside configuration, not the result of
MPP_ALIGN from mpp inside, although they should be exactly equal.
3. Fix the caculation of xFill in vepu2, this should be divide by 4.
Change-Id: I3e6c394ff9c15a730714a0e5938d18ca83c24d09
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
When multi thread calls scandir, crash may occur, so
the operation needs to be synchronized.
Change-Id: Idbdf539208259313d36c4acd17934af0e4dcf911
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Separate h264 encoder stream writing to a new module.
Change-Id: Ibf55a20ac73e4eb2e3a3d744573eded3ebd92662
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When encoder receives an empty frame with eos flag set, encoder will
encode an unreasonable extra frame.
Change-Id: I3bd1a2c84780f1b6212171117b67319b2f613b9f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Jpeg decoder with format conversion will use dec_pp mode. On this case The
sw_dec_out_dis flag need to be set in jpegd_setup_pp function. But this
flag is clear in later jpegd_gen_regs again which will lead to failure
on dec_pp mode jpeg decoding.
This fix move jpegd_setup_pp into the end of jpegd_gen_regs.
Change-Id: I6604d9593ec72ac58ad8a1757c6655bedc6b92fe
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When the buffer does not match, frame group needs to modify
the buffer size before it can be used properly, so it needs
to wake up the wait.dec_buf_match condition after info changed
ready.
Change-Id: I3ef7b2bf59d7649cf0e05731a2e51f40fd082535
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
commit a base version of vp8 encoder,include vpu1 and vpu2.
encode input raw picture to ivf stream.
Change-Id: I9ac697edf2249a4ca7464fdbfb5fd22a63fd3c34
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Vepu will return stream write length in 64 bit unit from input aligned
address. So final output length should count from 64 aligned sofeware
header address. Otherwise there will be extra gabage data at the end of
output stream.
Change-Id: Ic96a2bf6599f023a5c13b5f3acf219c231ac3327
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>