1. 28 Mar, 2020 1 commit
  2. 16 Feb, 2019 2 commits
    • Philip Langdale's avatar
      avcodec/nvdec: Explicitly mark codecs that support 444 output formats · 83c7ac2e
      Philip Langdale authored
      With the introduction of HEVC 444 support, we technically have two
      codecs that can handle 444 - HEVC and MJPEG. In the case of MJPEG,
      it can decode, but can only output one of the semi-planar formats.
      
      That means we need additional logic to decide whether to use a
      444 output format or not.
      83c7ac2e
    • Philip Langdale's avatar
      avcodec/nvdec: Add support for decoding HEVC 4:4:4 content · e06ccfbe
      Philip Langdale authored
      The latest generation video decoder on the Turing chips supports
      decoding HEVC 4:4:4. Supporting this is relatively straight-forward;
      we need to account for the different chroma format and pick the
      right output and sw formats at the right times.
      
      There was one bug which was the hard-coded assumption that the
      first chroma plane would be half-height; I fixed this to use the
      actual shift value on the plane.
      
      We also need to pass the SPS and PPS range extension flags.
      e06ccfbe
  3. 15 Nov, 2018 1 commit
    • Philip Langdale's avatar
      avutil/hwcontext_cuda: Define and use common CHECK_CU() · 19d3d0c0
      Philip Langdale authored
      We have a pattern of wrapping CUDA calls to print errors and
      normalise return values that is used in a couple of places. To
      avoid duplication and increase consistency, let's put the wrapper
      implementation in a shared place and use it everywhere.
      
      Affects:
      
      * avcodec/cuviddec
      * avcodec/nvdec
      * avcodec/nvenc
      * avfilter/vf_scale_cuda
      * avfilter/vf_scale_npp
      * avfilter/vf_thumbnail_cuda
      * avfilter/vf_transpose_npp
      * avfilter/vf_yadif_cuda
      19d3d0c0
  4. 02 Nov, 2018 1 commit
  5. 24 Oct, 2018 1 commit
  6. 09 May, 2018 2 commits
  7. 21 Feb, 2018 1 commit
  8. 08 Dec, 2017 1 commit
  9. 26 Nov, 2017 1 commit
  10. 24 Nov, 2017 1 commit
    • 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
  11. 20 Nov, 2017 4 commits
    • Mark Thompson's avatar
    • Philip Langdale's avatar
      avcodec: Implement mpeg4 nvdec hwaccel · 6b77a10e
      Philip Langdale authored
      This was predictably nightmarish, given how ridiculous mpeg4 is.
      I had to stare at the cuvid parser output for a long time to work
      out what each field was supposed to be, and even then, I still don't
      fully understand some of them. Particularly:
      
      vop_coded: If I'm reading the decoder correctly, this flag will always
                 be 1 as the decoder will not pass the hwaccel any frame
                 where it is not 1.
      divx_flags: There's obviously no documentation on what the possible
                  flags are. I simply observed that this is '0' for a
                  normal bitstream and '5' for packed b-frames.
      gmc_enabled: I had a number of guesses as to what this mapped to.
                   I picked the condition I did based on when the cuvid
                   parser was setting flag.
      
      Also note that as with the vdpau hwaccel, the decoder needs to
      consume the entire frame and not the slice.
      6b77a10e
    • Philip Langdale's avatar
      avcodec: Implement mpeg1 nvdec hwaccel · 8bca292c
      Philip Langdale authored
      Once I remembered that there's a separate decoder type for mpeg1,
      even though params struct is shared with mpeg2, everything worked.
      8bca292c
    • Philip Langdale's avatar
      avcodec: Refactor common nvdec hwaccel logic · 4c7b023d
      Philip Langdale authored
      The 'simple' hwaccels (not h.264 and hevc) all use the same bitstream
      management and reference lookup logic so let's refactor all that into
      common functions.
      
      I verified that casting a signed int -1 to unsigned char produces 255
      according to the C language specification.
      4c7b023d
  12. 18 Nov, 2017 1 commit
    • Philip Langdale's avatar
      avcodec: Implement mpeg2 nvdec hwaccel · 7c9f739d
      Philip Langdale authored
      This is mostly straight-forward. The weird part is that it should
      just work for mpeg1, but I see corruption in my test cases, so I'm
      going to try and fix that separately.
      7c9f739d
  13. 15 Nov, 2017 1 commit
  14. 13 Nov, 2017 3 commits
  15. 12 Nov, 2017 3 commits
  16. 11 Nov, 2017 2 commits
  17. 10 Nov, 2017 1 commit