Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gl_hwdec_vdpau: specify source rect for mixer #1863

Closed
wants to merge 1 commit into from

Conversation

bylee20
Copy link
Contributor

@bylee20 bylee20 commented Apr 25, 2015

VDPAU adds padding for some non-standard resolution videos.
This padding should be cropped out by giving proper source rect so the input image
fit to output surface.

This is already done in vo_vdpau so vo_vdpau does not have problem.

NOTE: I don't have any reference for this. This is based on what I observed.
I've got a report that some kind of white lines are added at bottom for vdpau with 1280x718 res.
This line is not visible when there's no margin to display this lines, so the screenshot is taken in full screen mode.
before

Here's the sample file which I used to take the screenshot.
https://drive.google.com/file/d/0B7k0IbH_XHW4RExIbTJpUldOSWM/view?usp=sharing

VDPAU adds padding for some non-standard resolution videos.
This padding should be cropped out by giving proper source rect so the input image
fit to output surface.

This is already done in vo_vdpau so vo_vdpau does not have problem.
ghost pushed a commit that referenced this pull request Apr 26, 2015
vo_opengl (or gl_hwdec_vdpau.c to be specific) calls
mp_vdpau_mixer_render() with video_rect=NULL, which means to use the
full surface. This is incorrect if the surface is actually cropped, as
it can happen with h264. In this case, it was rendering the parts
outside of the image.

Fix it by making this case use the cropped size instead.

Alternative fix for PR #1863.
@ghost
Copy link

ghost commented Apr 26, 2015

Your fix was correct. But I made an alternative fix, which is slightly smaller.

The problem here is that h264 distinguishes between the "real" frame size (which is used for internal codec operation, and which AFAIK is aligned to macroblocks), and the cropped frame size. FFmpeg and mpv have no real concept of cropping. It's worked around by generally making the output frame size the size of the cropped frame. A cleaner solution would probably explicitly introduce cropping to FFmpeg and mpv.

@ghost ghost closed this Apr 26, 2015
@bylee20
Copy link
Contributor Author

bylee20 commented Apr 26, 2015

Thanks for fix.

@bylee20 bylee20 deleted the vdpau-source-rect branch April 27, 2015 14:37
ghost pushed a commit that referenced this pull request Apr 27, 2015
vo_opengl (or gl_hwdec_vdpau.c to be specific) calls
mp_vdpau_mixer_render() with video_rect=NULL, which means to use the
full surface. This is incorrect if the surface is actually cropped, as
it can happen with h264. In this case, it was rendering the parts
outside of the image.

Fix it by making this case use the cropped size instead.

Alternative fix for PR #1863.

(cherry picked from commit a5ed6e4)
This pull request was closed.
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.

1 participant