video: merge the tiles of grid heif and avif images#17738
video: merge the tiles of grid heif and avif images#17738guidocella wants to merge 1 commit intompv-player:masterfrom
Conversation
| return 0; | ||
| } | ||
|
|
||
| static char *tile_grid_graph(void *ctx, const struct mp_tile_grid *grid) |
There was a problem hiding this comment.
All of these things belong to f_auto_filters.c, not here.
There was a problem hiding this comment.
I added an auto filter at first but it doesn't seem to be able to handle different streams.
|
I tested this PR. If the preferred hwdec is not a copy variant (--hwdec=d3d11va,d3d11va-copy), grid images fail to load entirely, and it is unable to failback to a copy hwdec and reload.
I suspect the problem in #14062 is that the pixel format isn't yuv420, and currently there are no GPUs capable of yuv422/444 av1. |
|
vaapi-copy also works. |
|
This should be merged after scaling individual tiles, preferably in libplacebo. Otherwise big images won't work. EDIT: But after discussion, we don't care about big images > 16k, so it's not needed. |
|
Is that related to tile grids? Non-grid large images don't work all the same. Also changing libplacebo won't work for dmabuf-wayland. |
Nothing will, you need to make compositor support rendering larger textures or split textures in dmabuf-wayland and make compositor stitch it |
|
|
||
| // For a single-tile image the assembled canvas may be larger than | ||
| // the display area due to codec alignment padding. Encode that as a | ||
| // codec-level crop so mpv's normal pipeline trims it. |
There was a problem hiding this comment.
Why this is needed for single tile? And not for multi-tile, when the tiles could overshoot the image display area in similar way?
There was a problem hiding this comment.
tile_grid_graph sets the crop filter with multiple tiles.
There was a problem hiding this comment.
I guess we can just always set a filter even with 1 tile? Not like images ever have a single tile in practice.
There was a problem hiding this comment.
Removed the special casing of nb_tiles == 1.
|
|
||
| struct mp_tile_grid *grid = track->stream->tile_grid; | ||
| if (grid && grid->nb_tiles > 1) { | ||
| // Prevent crashing with heif-conformance/C021.heic in FATE. |
There was a problem hiding this comment.
What is FATE? Needs to be more specific.
Also this looks like another workaround to something that should be handled better, you handle similar case for single-tile images above.
There was a problem hiding this comment.
Do you prefer to not set mp_tile_grid beforehand in demux_lavf.c if invalid?
There was a problem hiding this comment.
Not sure, but this code belong in lavf generally. There is no reason to handle it here.
There was a problem hiding this comment.
Moved to demux_lavf.c.
Fixes mpv-player#13585. Fixes mpv-player#16486. Switching between different grid images added with --external-files is also supported. The prority of independent tracks is reverted for images, because we now want to select a dependent track to trigger the merging, rather than small preview tracks.

Fixes #13585.
Fixes #16486.
Switching between different grid images added with --external-files is also supported.
The prority of independent tracks is reverted for images, because we now want to select a dependent track to trigger the merging, rather than small preview tracks.
Mostly generated by Claude.
--hwdec=vaapiworks for regular heif images, but breaks grid ones.nvdec works.I get CUDA_ERROR_OUT_OF_MEMORY but at least it fallsback to software decoding.I can't test av1, but hardware decoding already doesn't work at least for HDR avif according to #14062.