]> git.sesse.net Git - ffmpeg/commit
avcodec/cuviddec: improve progressive frame detection
authorSergey Svechnikov <svechnikov66@gmail.com>
Mon, 22 Apr 2019 17:26:24 +0000 (22:26 +0500)
committerTimo Rothenpieler <timo@rothenpieler.org>
Tue, 23 Apr 2019 10:48:08 +0000 (12:48 +0200)
commit703583dbb1f35ccefeb8f2cccd2f99b97a4d482a
tree9dda188bd04f3ef3774df8df4a4acbd186595630
parenta0877648472a25debc9bd7957684748a253c2b52
avcodec/cuviddec: improve progressive frame detection

There are 2 types of problems when using adaptive deinterlace with cuvid:

1. Sometimes, in the middle of transcoding, cuvid outputs frames with visible horizontal lines (as though weave deinterlace method was chosen);
2. Occasionally, on scene changes, cuvid outputs a wrong frame, which should have been shown several seconds before (as if the frame was assigned some wrong PTS value).

The reason is that sometimes CUVIDPARSERDISPINFO has property progressive_frame equal to 1 with interlaced videos.
In order to fix the problem we should check if the video is interlaced or progressive in the beginning of a video sequence (cuvid_handle_video_sequence).
And then we just use this information instead of the property progressive_frame in CUVIDPARSERDISPINFO (which is unreliable).

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
libavcodec/cuviddec.c