Some interlaced stream with height not fully aligned to CTU may have
random values at bottom with some height. This part should not be
processed by IEP. Otherwise the output of IEP will have some flaws bottom.
Change-Id: Ia648d50b65511a091dee0701dae6f1b2b8e30407
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
When frame-field detection result changes from field mode to unknow or
frame mode, source picture will be output disordered.
Change-Id: I77d4da4d09b06e273e9e8b090182811a5e2c6f10
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
1. solving deinterlace mode changes when video is
progressive at detection mode. Frame output
order will be wrong for the first 10 frames.
2. solving the issue that ff_mode judge will not
be updated when info changes.
Change-Id: I85ef0abe7af972dbe9ee7965f2c17de78330c506
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
BUG is reported from https://redmine.rock-chips.com/issues/464206
Thread 18 (LWP 2440):
#0 __lll_lock_wait (futex=0x7f34000d48, private=0) at lowlevellock.c:52
#1 0x0000007fab5b1540 in __GI___pthread_mutex_lock (mutex=0x7f34000d48) at pthread_mutex_lock.c:115
#2 0x0000007fa9e0299c in dec_vproc_signal (ctx=0x7f34001260) at ../git/mpp/vproc/mpp_dec_vproc.cpp:929
#3 0x0000007fa9df5bdc in mpp_dec_notify (ctx=0x7f602be600, flag=1088) at ../git/mpp/codec/mpp_dec.cpp:956
#4 0x0000007fa9e0ef30 in mpp_buffer_ref_dec (buffer=0x7f6403f6c8, caller=caller@entry=0x7fa9ee300c "mpp_frame_deinit") at ../git/mpp/base/mpp_buffer_impl.cpp:509
#5 0x0000007fa9e0fb84 in mpp_buffer_put_with_caller (buffer=<optimized out>, caller=caller@entry=0x7fa9ee300c "mpp_frame_deinit") at ../git/mpp/base/mpp_buffer.cpp:105
#6 0x0000007fa9e11820 in mpp_frame_deinit (frame=frame@entry=0x7f602ec340) at ../git/mpp/base/mpp_frame.cpp:85
#7 0x0000007fabd6bf4c in rkmpp_release_frame (opaque=<optimized out>, data=0x7f602ba600 <error: Cannot access memory at address 0x7f602ba600>) at src/libavcodec/rkmppdec.c:339
#8 0x0000007fab9547dc in buffer_replace (src=0x0, dst=<optimized out>) at src/libavutil/buffer.c:133
#9 av_buffer_unref (buf=<optimized out>) at src/libavutil/buffer.c:144
#10 0x0000007fac714bb8 in mp_image_destructor (ptr=0x7f60252c80) at ../../../../../../sources/mpv/video/mp_image.c:209
#11 0x0000007fac748d40 in ta_free (ptr=0x7f60252c80) at ../../../../../../sources/mpv/ta/ta.c:244
#12 0x0000007fac715178 in mp_image_unrefp (p_img=p_img@entry=0x7f4c00bfc0) at ../../../../../../sources/mpv/video/mp_image.c:472
#13 0x0000007fac73396c in wlbuf_pool_entry_release (data=0x7f4c00bfa0, wl_buffer=<optimized out>) at ../../../../../../sources/mpv/video/out/wlbuf_pool.c:132
#14 0x0000007fb4cfe328 in ffi_call_SYSV () at ../libffi-3.3/src/aarch64/sysv.S:114
#15 0x0000007fb4cfdb44 in ffi_call_int (cif=cif@entry=0x7f70fdec80, fn=0x7f70fdeca0, orig_rvalue=orig_rvalue@entry=0x0, avalue=0x10, avalue@entry=0x7f70fded50, closure=0x200000001, closure@entry=0x0) at ../libffi-3.3/src/aarch64/ffi.c:747
#16 0x0000007fb4cfdf24 in ffi_call (cif=cif@entry=0x7f70fdec80, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0x7f70fded50) at ../libffi-3.3/src/aarch64/ffi.c:756
#17 0x0000007faa49c7c0 in wl_closure_invoke (closure=0x7f4c00bff0, flags=<optimized out>, target=<optimized out>, opcode=0, data=<optimized out>) at ../wayland-1.22.0/src/connection.c:1025
#18 0x0000007faa499df0 in dispatch_event (display=display@entry=0x7f4c001d40, queue=<optimized out>) at ../wayland-1.22.0/src/wayland-client.c:1644
#19 0x0000007faa49b2c8 in dispatch_queue (queue=0x7f4c001e30, display=0x7f4c001d40) at ../wayland-1.22.0/src/wayland-client.c:1790
#20 wl_display_dispatch_queue_pending (display=0x7f4c001d40, queue=0x7f4c001e30) at ../wayland-1.22.0/src/wayland-client.c:2032
#21 0x0000007faa49b2f4 in wl_display_dispatch_pending (display=<optimized out>) at ../wayland-1.22.0/src/wayland-client.c:2095
#22 0x0000007fac73e2cc in vo_wayland_dispatch_events (wl=0x7f4c000e40, nfds=nfds@entry=2, timeout=timeout@entry=100) at ../../../../../../sources/mpv/video/out/wayland_common.c:1933
#23 0x0000007fac741d7c in vo_wayland_wait_events_timeout (vo=vo@entry=0x7f600abed0, timeout_ms=timeout_ms@entry=100) at ../../../../../../sources/mpv/video/out/wayland_common.c:2594
#24 0x0000007fac73baf4 in draw_frame (vo=0x7f600abed0, frame=0x7f302063b0) at ../../../../../../sources/mpv/video/out/vo_dmabuf_wayland.c:1113
#25 0x0000007fac7360c4 in render_frame (vo=0x7f600abed0) at ../../../../../../sources/mpv/video/out/vo.c:984
#26 vo_thread (ptr=0x7f600abed0) at ../../../../../../sources/mpv/video/out/vo.c:1123
#27 0x0000007fab5af370 in start_thread (arg=0x7f72ffbe06) at pthread_create.c:477
#28 0x0000007fab51bedc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
Thread 14 (LWP 3455):
#0 __lll_lock_wait (futex=0x7f60208040, private=0) at lowlevellock.c:52
#1 0x0000007fab5b1540 in __GI___pthread_mutex_lock (mutex=mutex@entry=0x7f60208040) at pthread_mutex_lock.c:115
#2 0x0000007fa9e0ef48 in mpp_buffer_ref_dec (buffer=0x7f6406fee8, caller=caller@entry=0x7fa9ee1ae7 "check_entry_unused") at ../git/mpp/base/mpp_buffer_impl.cpp:503
#3 0x0000007fa9e0fb84 in mpp_buffer_put_with_caller (buffer=<optimized out>, caller=caller@entry=0x7fa9ee1ae7 "check_entry_unused") at ../git/mpp/base/mpp_buffer.cpp:105
#4 0x0000007fa9e0bf1c in check_entry_unused (entry=0x7f601ef530, impl=0x7f60263ec0) at ../git/mpp/base/mpp_buf_slot.cpp:627
#5 mpp_buf_slot_clr_flag (slots=0x7f60263ec0, index=<optimized out>, type=type@entry=SLOT_QUEUE_USE) at ../git/mpp/base/mpp_buf_slot.cpp:919
#6 0x0000007fa9e00eb0 in dec_vproc_clr_prev0 (ctx=ctx@entry=0x7f34001260) at ../git/mpp/vproc/mpp_dec_vproc.cpp:149
#7 0x0000007fa9e00fd0 in dec_vproc_clr_prev (ctx=ctx@entry=0x7f34001260) at ../git/mpp/vproc/mpp_dec_vproc.cpp:180
#8 0x0000007fa9e012b8 in dec_vproc_thread (data=0x7f34001260) at ../git/mpp/vproc/mpp_dec_vproc.cpp:631
#9 0x0000007fab5af370 in start_thread (arg=0x7f47ffdf16) at pthread_create.c:477
#10 0x0000007fab51bedc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I742e55e745c46a4adb229e2f6f0e2a2c3498e369
For IEP2, the first two frames will be deinterlaced at I1O1 mode. I5O2
mode only works when the 3rd frame arrived. Thus the 2nd frame will be
deinterlaced twice and PTS will be repeated as following pattern:
-------------------------------------
IEP in : 0 1 2 3 4
IEP out : 0 1 0.5 1 2.5 3 3.5
-------------------------------------
To fix this, just skip the 2nd frame processing.
Change-Id: I2d66951a941a664da093f1b9edbdd73855c57060
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Field order shown at bistream syntax may be conflict with the detection
result of IEP. If there is obvious index showing that the detection
of IEP is right, we should trust IEP.
Change-Id: Ib151c4b538c187afb33e05c6e6a6e8a46c7629eb
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
1. Add MPP_VPROC_MODE_DETECTION for user to enable frame/field data
detection for iep2.
2. Use MPP_FRAME_FLAG_DEINTERLACED flag for frame/field data detection
flag in MppFrame.
3. Add vproc version and detection function to dec_vproc module.
Change-Id: I41e36c6df4a09970952b499eda5930091e6f716d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
1. Split encoder and decoder hal_task defs and infos.
2. Change hal_task to a general info list with status.
Change-Id: I6f26035eeee4772d1ef99a21d85716e9c33eb9a6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
NOTE: The MppCtx should be restored for external user.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2a4241ddacb14196f43b29a59b46658131ebfcee
when src frame is err, dst should be set errinfo also.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I5d9f090abc3a9ffea8f7e921c1b523242ab1fc69
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>
Add iep2 HAL library and corresponding unit test.
Add a adapter layer for iep and iep2 compatible.
there will be libiep2.so generated after build.
this library will support direct using iep2 api outside
MPP platform, such as using in analog camera application.
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Change-Id: Ide9662bf099e5374602dda7417ee6973de64c912
Use semaphore to sync the reset operation.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I7440530a779a7fd5c394e93b30f9addbaf4044d0
1. Only use notify to communicated between mpp and codec.
2. Remove mpp_enc_impl.h
Change-Id: Ia62757240efa7d245b5215ad79539fa9bbbd1550
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add MppDecImpl layer for separate encoder and decoder.
Change-Id: I02e04acddf617ae5188572af89312ab20fbf21b6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Use HalTask to communicate between hal thread and vproc thread.
Change-Id: I4e87b7ca63bdf86e46045e31296ffa69958ae719
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Hal task will be changed to a more general task between mpp components.
Change-Id: I8ed46da8d02f530cddcdc785f6f6b3778afac5b9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
We need to turn off this switch to prevent some areas
of the video from flickering, but there may be other effects.
However, a choice needs to be made.
Change-Id: Ia52a604eed21e381f7310b1c85fe1c0434a1db13
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
1. Unify the hal thread output process to mpp_dec_put_frame
2. Add vproc path for field source.
3. Reserve one more buffer when deinterlace is enabled.
4. Default enable for normal mpp path but disable on vpuapi path for the
reason that rk_ffplayer has done deinterlace process internally.
Change-Id: I02e7cece844fde01c2d249dafe6f7ce6a325593f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When mpp_dec_vproc reset buffer slot index should be dequeue and release
its MppFrame property to insure MppBuffer is not leaked.
Change-Id: I2dc35505306135907fe812b18ae3b8178adb942b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add iep context and iep function to the mpp_dec_vproc.
Change-Id: I0e4819cccb068fc665d1d3cac89e0d4bcda032a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add mpp dec post-process thread and functions.
Change-Id: I2a03e6ddfd6c746d272dd58b629e81f98b530c4a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>