cuda: Rewrite colorspace/rescale object
authorSeungha Yang <seungha@centricular.com>
Fri, 11 Nov 2022 19:06:32 +0000 (04:06 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 15 Nov 2022 16:25:44 +0000 (16:25 +0000)
commitc11f8fa930bae5bf9c0cec03ca941c7c0a2aacf6
treee4c62655c2c83f7ddbf18965f0d3e22d15cd2d47
parentc1efa9ac4b6ccac1be9bc649e503a2c3056c6df4
cuda: Rewrite colorspace/rescale object

Rewriting GstCudaConverter object, since the old implementation was not
well organized and it's hard to add new features.
Moreover, the conversion operations were not very optimized.

Major change of this implementation:
* Remove redundant intermediate conversion operations such as
  any RGB -> ARGB(64) conversion or any YUV -> Y444 (or 16bits Y444).
  That's not required most of cases. The only required case is
  converting 24bits (such as RGB/BGR) packed format to 32bits format
  because CUDA texture object does not support sampling 24bits format
* Use normalized sample fetching (i.e., [0, 1] range float value)
  and also normalized coordinates system for CUDA texture.
  It's consistent with the other graphics APIs such as Direct3D
  and OpenGL, that makes sampling operations much easier.
* Support a kind of viewport and adopt math for colorspace conversion
  from GstD3D11 implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
subprojects/gst-plugins-bad/sys/nvcodec/cuda-converter.c [deleted file]
subprojects/gst-plugins-bad/sys/nvcodec/cuda-converter.h [deleted file]
subprojects/gst-plugins-bad/sys/nvcodec/gstcudaconverter.c [new file with mode: 0644]
subprojects/gst-plugins-bad/sys/nvcodec/gstcudaconverter.h [new file with mode: 0644]
subprojects/gst-plugins-bad/sys/nvcodec/gstcudaconvertscale.c
subprojects/gst-plugins-bad/sys/nvcodec/meson.build