• Philip Langdale's avatar
    avcodec/nvdec: Round up odd width/height values · 4186a77f
    Philip Langdale authored
    nvdec will not produce odd width/height output, and while this is
    basically never an issue with most codecs, due to internal alignment
    requirements, you can get odd sized jpegs.
    
    If an odd-sized jpeg is encountered, nvdec will actually round down
    internally and produce output that is slightly smaller. This isn't
    the end of the world, as long as you know the output size doesn't
    match the original image resolution.
    
    However, with an hwaccel, we don't know. The decoder controls
    the reported output size and the hwaccel cannot change it. I was
    able to trigger an error in mpv where it tries to copy the output
    surface as part of rendering and triggers a cuda error because
    cuda knows the output frame is smaller than expected.
    
    To fix this, we can round up the configured width/height passed
    to nvdec so that the frames are always at least as large as the
    decoder's reported size, and data can be copied out safely.
    
    In this particular jpeg case, you end up with a blank (green) line
    at the bottom due to nvdec refusing to decode the last line, but
    the behaviour matches cuviddec, so it's as good as you're going to
    get.
    4186a77f
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...