• Linjie Fu's avatar
    lavf/vf_deinterlace_vaapi: flush queued frame for field in DeinterlacingBob · 9c58fd22
    Linjie Fu authored
    For DeinterlacingBob mode with rate=field, the frame number of output
    should equal 2x input total since only intra deinterlace is used.
    
    Currently for "backward_ref = 0, rate = field", extra_delay is
    introduced. Due to the async without flush, frame number of output is
    [expected_number - 2].
    
    Specifically, if the input only has 1 frame, the output will be empty.
    
    Add deint_vaapi_request_frame for deinterlace_vaapi, send NULL frame
    to flush the queued frame.
    
    For 1 frame input in Bob mode with rate=field,
    before patch: 0 frame;
    after  patch: 2 frames;
    
    ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128
            -hwaccel_output_format vaapi -i input.h264 -an -vf
            deinterlace_vaapi=mode=bob:rate=field -f null -
    Tested-by: 's avatarMark Thompson <sw@jkqxz.net>
    Reviewed-by: 's avatarMark Thompson <sw@jkqxz.net>
    Signed-off-by: 's avatarLinjie Fu <linjie.fu@intel.com>
    Signed-off-by: 's avatarHaihao Xiang <haihao.xiang@intel.com>
    9c58fd22
vf_deinterlace_vaapi.c 15.3 KB