Skip to content

vo_gpu_next: use pl deinterlace shader for bwdif instead of sw filter#17394

Open
llyyr wants to merge 5 commits into
mpv-player:masterfrom
llyyr:pl-deint
Open

vo_gpu_next: use pl deinterlace shader for bwdif instead of sw filter#17394
llyyr wants to merge 5 commits into
mpv-player:masterfrom
llyyr:pl-deint

Conversation

@llyyr

@llyyr llyyr commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread filters/f_auto_filters.c Outdated
@dancingmirrors

Copy link
Copy Markdown

Yes, for some reason bwdif_vulkan stopped working for me after around FFmpeg 7.1, just outputs a green screen instead. No idea what happened but libplacebo's deinterlacing works.

@llyyr llyyr force-pushed the pl-deint branch 4 times, most recently from 0939147 to 6da6403 Compare February 10, 2026 20:15
@kasper93

Copy link
Copy Markdown
Member

This should be implemented such that it's possible to output full frame rate (60i -> 60p), instead of every other frame.

@Headcrabed

Copy link
Copy Markdown
Contributor

Any updates?

@llyyr

llyyr commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

No, and I'm quite busy irl so I won't have time for this for a few months still. If anyone wants to pick this up they're welcome

@llyyr

llyyr commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on top of #18099

This is ready for testing/review now

@llyyr llyyr marked this pull request as ready for review June 8, 2026 17:20
@kasper93

kasper93 commented Jun 8, 2026

Copy link
Copy Markdown
Member

This is ready for testing/review now

This should be implemented such that it's possible to output full frame rate (60i -> 60p), instead of every other frame.

@llyyr

llyyr commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

This should be implemented such that it's possible to output full frame rate (60i -> 60p), instead of every other frame.

unless I'm misunderstanding it, documentation of pl_source_frame.first_field already says libplacebo is doing the doubling internally. Can you tell me what I need to do here or how I can check if it's working right?

@kasper93

kasper93 commented Jun 8, 2026

Copy link
Copy Markdown
Member

This should be implemented such that it's possible to output full frame rate (60i -> 60p), instead of every other frame.

unless I'm misunderstanding it, documentation of pl_source_frame.first_field already says libplacebo is doing the doubling internally. Can you tell me what I need to do here or how I can check if it's working right?

It does, but you have to drive rendering twice as fast. Two times per each frame to output full frame rate, else you are dropping every other field (output frame).

Get this sample and test it. You should be able to see all consecutive numbers. You can pause and frame step, both forward and backward frame step should work correctly. https://github.com/bbgdzxng1/interlace-detection-test-patterns/raw/9d163e87b222e2711ab5fae805d80b2e655e04c1/bt601-525_480_interlaced_bff.ts

EDIT: You can find more samples at https://github.com/bbgdzxng1/interlace-detection-test-patterns/

@llyyr

llyyr commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

From those samples, even current vaapi/vulkan deint filters skip half the fields on gpu-next. On gpu, 60i becomes 60p correctly. I'll need to check why

llyyr added 3 commits June 15, 2026 13:46
When the image format changes (e.g. switching hwdec), immediately
destroy the existing deinterlace filter instead of draining it. Draining
feeds new frames through the old filter, which can cause issues. (e.g.
bwdif_vulkan receiving vaapi frames).

This fixes userdeint filter failure when switching from hwdec=vulkan to
hwdec=vaapi while the filter is applied via --deinterlace=auto/yes
This is used to emit frame per field, so the VO is asked to draw both
fields.
@llyyr

llyyr commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

This outputs full frame rate now. Though I'm not sure if there's a simpler way to do this than adding a dummy video filter

llyyr added 2 commits June 15, 2026 18:07
This is used to signal when the VO can do deinterlacing itself, instead
of using a filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants