Bug 91241 - High quality video scaling results in wrong video proportions and positioning
Summary: High quality video scaling results in wrong video proportions and positioning
Status: RESOLVED WONTFIX
Alias: None
Product: libva
Classification: Unclassified
Component: intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: haihao
QA Contact: Sean V Kelley
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-06 13:09 UTC by Igor Tarasov
Modified: 2016-12-07 05:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Igor Tarasov 2015-07-06 13:09:52 UTC
I've encountered this issue with mpv (https://github.com/mpv-player/mpv/issues/2109), and it appears only when using hq scaling for vaapi. Here is video of how scaling works:

on kernel 3.13: https://www.youtube.com/watch?v=wz5ARpE1WOY
on kernel 3.19: https://www.youtube.com/watch?v=I1nEA_fA7IA

Both are bogus. It is supposed to zoom centered.

mpv authors say it is intel-driver related, since they do not change anything in proportions when changing scaling mode.

Command line to reproduce this is this:

mpv some16:9video --hwdec=vaapi --vo=vaapi:scaling=hq --geometry=1280x640

If you change "hq" to "fast" or remove ":scaling=hq" at all - it gets fixed and works as supposed to.

Ubuntu 14.04.2 64bit, i5-2450M processor used.
Comment 1 Igor Tarasov 2015-07-06 13:56:36 UTC
Also, the right border when zooming in is single-pixel band stretched to that area width. More noticeable on this image: http://i.imgur.com/u3drnmk.jpg
Comment 2 Igor Tarasov 2015-07-11 20:14:32 UTC
mpv author provided some details, here is what he said:

Specifically, it happens with vaPutSurface if you pass VA_FILTER_SCALING_HQ to it, and the source coordinates don't use the full image (i.e. cropping).
Comment 3 Igor Tarasov 2015-08-14 10:12:08 UTC
As it came out, the issue appears only if BOTH hardware decoding and hardware video output (with HQ scaling) used. If I use only HW output with HQ scaling, while using SW decoding, panscan works well. The same is true for HW decoding and SW output/scaling.
Comment 4 haihao 2015-09-29 07:16:49 UTC
(In reply to Igor Tarasov from comment #1)
> Also, the right border when zooming in is single-pixel band stretched to
> that area width. More noticeable on this image:
> http://i.imgur.com/u3drnmk.jpg

I didn't see this issue, could you provide the command line ?
Comment 5 Igor Tarasov 2015-09-29 07:30:09 UTC
For example, something like this:

mpv some16:9video --hwdec=vaapi --vo=vaapi:scaling=hq --geometry=1280x640 --panscan=1

You can also use keys w and e to change panscan during playback.

Or to make things even more clear, you could use square window:

mpv some16:9video --hwdec=vaapi --vo=vaapi:scaling=hq --geometry=640x640 --panscan=1

You change scaling=hq in commandline to scaling=fast, in order to see how it is supposed to work.
Comment 6 Igor Tarasov 2015-10-01 10:00:43 UTC
Now it has became more interesting. I've found a file (http://download.jw.org/files/media_video/6e/ivpro_E_1_r720P.mp4) that is being played as with fish-eye camera if hq scaling is enabled. 

Here are screenshots of what it looks like compared to fast scaling: http://imgur.com/a/EUEgl.
Comment 7 haihao 2016-12-07 05:06:39 UTC
The source ratio (height/weight) and target ratio are different, so hq stretches the surface in a different way than fast.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.