vmh264: Progressive stream is forced to interlace causing jitter. [1/1]
authormiaohong chen <miaohong.chen@amlogic.com>
Wed, 25 Nov 2020 08:28:53 +0000 (16:28 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Tue, 1 Dec 2020 08:08:56 +0000 (00:08 -0800)
PD#SWPL-35861

Problem:
In order to be compatible with a fake progressive stream,
this normal progressive stream was affected.

Solution:
Restrict the conditions that are compatible
with the abnormal stream.

Verify:
u212

Change-Id: I7e602196738012520af8028d5fe023cfa569322b
Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c

index 24de3c73c1ef8da15e9096602a000f293fba1014..4d180916ec367be53c5605ea1667fe851d3aed29 100644 (file)
@@ -2628,6 +2628,7 @@ static void update_vf_memhandle(struct vdec_h264_hw_s *hw,
 static int check_force_interlace(struct vdec_h264_hw_s *hw,
        struct FrameStore *frame)
 {
+       struct h264_dpb_stru *p_H264_Dpb = &hw->dpb;
        int bForceInterlace = 0;
        /* no di in secure mode, disable force di */
        if (vdec_secure(hw_to_vdec(hw)))
@@ -2636,8 +2637,9 @@ static int check_force_interlace(struct vdec_h264_hw_s *hw,
        if ((dec_control & DEC_CONTROL_FLAG_FORCE_2997_1080P_INTERLACE)
                && hw->bitstream_restriction_flag
                && (hw->frame_width == 1920)
-               && (hw->frame_height >= 1080)
-               && (hw->frame_dur == 3203 || hw->frame_dur == 3840)) {
+               && (hw->frame_height >= 1080) /* For being compatible with a fake progressive stream which is interlaced actually*/
+               && (hw->frame_dur == 3203 || (hw->frame_dur == 3840 && p_H264_Dpb->mSPS.profile_idc == 100 &&
+               p_H264_Dpb->mSPS.level_idc == 40))) {
                bForceInterlace = 1;
        } else if ((dec_control & DEC_CONTROL_FLAG_FORCE_2500_576P_INTERLACE)
                         && (hw->frame_width == 720)