gstreamer/subprojects
Marek Vasut e6d83d8f96 jpegdec: Support libjpeg-turbo colorspace conversion
The libjpeg-turbo has a built-in support for performing colorspace
conversion. The performance of this conversion is much better than
doing the same separately using videoconvert. Implement support for
this conversion to RGBx/xRGB/BGRx/xBGR formats. Other formats can
be easily added later.

- The decoding of various pixel formats can be tested and compared to
  non-libjpeg-turbo decoding as follows:
  for gfmt in {RGB,BGR}{,x} x{RGB,BGR} ; do
      echo "$gfmt"
      gst-launch-1.0 -q \
          videotestsrc pattern=colors ! \
          video/x-raw,format=${gfmt} ! \
          fakesink dump=true | \
	  head -n 200 | tail -n 1
      gst-launch-1.0 -q --gst-plugin-path=build/ext/jpeg/ \
          videotestsrc pattern=colors ! \
          video/x-raw,format=${gfmt} ! \
	  jpegenc ! \
	  jpegdec ! \
	  video/x-raw,format=${gfmt} ! \
	  fakesink dump=true | \
	  head -n 200 | tail -n 1
      done
  Result looks as follows, i.e. comparable:
  RGB
  00000c70 (0x7f7736fbdd10): 05 33 19 05 33 26 05 33 33 05 33 40 05 33 4c 05  .3..3&.33.3@.3L.
  00000c70 (0x7f389e8f7d10): 05 32 17 04 32 22 04 32 31 04 32 3e 04 32 4a 04  .2..2".21.2>.2J.
  RGBx
  00000c70 (0x7f79efd0ad10): cc 07 22 ff d9 07 22 ff e6 07 22 ff f3 07 22 ff  .."..."..."...".
  00000c70 (0x7fb6989f3d10): cd 06 22 00 d9 06 22 00 e6 06 22 00 f4 06 22 00  .."..."..."...".
  BGR
  00000c70 (0x7fa0a6c42d10): 05 0c 33 05 19 33 05 26 33 05 33 33 05 40 33 05  ..3..3.&3.33.@3.
  00000c70 (0x7fc74165fd10): 05 08 32 04 17 32 04 22 32 04 31 32 04 3e 32 04  ..2..2."2.12.>2.
  BGRx
  00000c70 (0x7fbf399f1d10): 22 07 cc ff 22 07 d9 ff 22 07 e6 ff 22 07 f3 ff  "..."..."..."...
  00000c70 (0x7f50e3d1cd10): 22 06 cd 00 22 06 d9 00 22 06 e6 00 22 06 f4 00  "..."..."..."...
  xRGB
  00000c70 (0x7f0b950a2d10): ff cc 07 22 ff d9 07 22 ff e6 07 22 ff f3 07 22  ..."..."..."..."
  00000c70 (0x7f4416b8dd10): 00 cd 06 22 00 d9 06 22 00 e6 06 22 00 f4 06 22  ..."..."..."..."
  xBGR
  00000c70 (0x7f237d74dd10): ff 22 07 cc ff 22 07 d9 ff 22 07 e6 ff 22 07 f3  ."..."..."..."..
  00000c70 (0x7f095547dd10): 00 22 06 cd 00 22 06 d9 00 22 06 e6 00 22 06 f4  ."..."..."..."..
                             ^^          ^^          ^^          ^^
  Notice how the alpha channel is set to arbitrary value in case of the
  libjpeg-turbo decoding into RGBx/BGRx/xRGB/xBGR pixel formats. This is
  documented in libjpeg-turbo README.md as follows:
    "
    When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
    X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
    can set that byte to whatever value it wishes.
    "

- The interlaced num_fields=2 mjpeg stream can be generated and
  tested as follows (this does require mjpegtools):
  $ gst-launch-1.0 videotestsrc num-buffers=10 ! jpegenc ! multifilesink location=in%04d.jpg
  $ jpeg2yuv -f 25 -I t -L 0 -j in%04d.jpg | yuv2lav -f avi -o result.avi
  ...
  $ gst-launch-1.0 --gst-plugin-path=build/ext/jpeg/ filesrc location=result.avi ! \
       avidemux ! jpegdec ! video/x-raw,format=RGBx ! videoconvert ! autovideosink

Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1091>
2021-10-07 12:40:29 +00:00
..
gst-devtools validate:launcher: Sync asset only when passing --sync 2021-10-06 17:00:54 +00:00
gst-docs ci: Fix gst-indent path 2021-10-05 23:44:03 +03:00
gst-editing-services ges:uri-asset: Ignore streams with no ID 2021-10-02 10:44:26 +00:00
gst-examples Back to development 2021-09-26 01:07:02 +01:00
gst-integration-testsuites validate:launcher: Sync asset only when passing --sync 2021-10-06 17:00:54 +00:00
gst-libav doc: update IRC links to OFTC 2021-09-28 10:11:15 +10:00
gst-omx doc: update IRC links to OFTC 2021-09-28 10:11:15 +10:00
gst-plugins-bad codecs: Use GST_VIDEO_DECODER_ERROR() only for decoding error case 2021-10-07 06:48:46 +00:00
gst-plugins-base pbutils: Remove sample entry code "raw" 2021-10-05 09:00:23 +00:00
gst-plugins-good jpegdec: Support libjpeg-turbo colorspace conversion 2021-10-07 12:40:29 +00:00
gst-plugins-ugly doc: update IRC links to OFTC 2021-09-28 10:11:15 +10:00
gst-python doc: update IRC links to OFTC 2021-09-28 10:11:15 +10:00
gst-rtsp-server rtsp-media: Unprepare suspended medias too 2021-10-07 11:16:39 +00:00
gstreamer tests: gstmeta: Fix failure on Windows 2021-10-07 07:43:27 +00:00
gstreamer-sharp Back to development 2021-09-26 01:07:02 +01:00
gstreamer-vaapi doc: update IRC links to OFTC 2021-09-28 10:11:15 +10:00
macos-bison-binary New subproject macos-bison-binary to provide bison on macOS 2021-08-28 23:44:52 +05:30
win-flex-bison-binaries win-flex-bison: Use gstreamer mirror as primary source 2020-01-18 17:54:48 +05:30
win-nasm win-nasm: Use gstreamer mirror as primary source 2020-01-18 17:54:48 +05:30
avtp.wrap Revert "Revert "Add libavtp wrap file"" 2020-06-30 15:47:18 -07:00
bindinator.wrap Move files from gstreamer-sharp into the "subprojects/gstreamer-sharp/" subdir 2021-09-24 16:16:29 -03:00
cairo.wrap Add pango.wrap file and its dependencies 2020-10-06 12:35:14 +00:00
dav1d.wrap Add dav1d wrap file 2020-05-02 09:55:12 +00:00
dssim.wrap dssim: Use http:// git repo 2018-07-13 18:54:34 -04:00
dv.wrap subprojects: add libdv wrap 2021-01-14 19:16:01 +00:00
expat.wrap meson: Update expat.wrap for MSVC fix 2020-11-05 13:09:46 +05:30
FFmpeg.wrap FFmpeg: update to 4.3.1 2020-07-25 13:44:26 +01:00
fontconfig.wrap Fix fontconfig wrap revision 2021-06-30 10:01:04 -04:00
freetype2.wrap Add pango.wrap file and its dependencies 2020-10-06 12:35:14 +00:00
fribidi.wrap Add pango.wrap file and its dependencies 2020-10-06 12:35:14 +00:00
gl-headers.wrap Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
glib-networking.wrap subprojects: update glib-networking.wrap to use the 2.68 branch 2021-06-07 16:54:29 +02:00
glib.wrap subprojects: Update glib to 2.68 and glib-networking to 2.66 branch 2021-04-12 00:14:20 +01:00
graphene.wrap Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gtk-sharp.wrap Move files from gstreamer-sharp into the "subprojects/gstreamer-sharp/" subdir 2021-09-24 16:16:29 -03:00
harfbuzz.wrap harfbuzz.wrap: Use the latest tag instead of tip of git 2021-07-02 17:08:48 +03:00
json-glib.wrap Add wrap file for json-glib 2018-10-23 14:17:06 +02:00
libdrm.wrap subprojects: add libdrm wrap 2020-04-03 10:15:09 +02:00
libffi.wrap subprojects: use libffi and gl-headers from gstreamer gitlab repos 2019-01-28 23:19:19 +01:00
libjpeg-turbo.wrap subprojects: Bump libjpeg-turbo version to 2.1.0-2 for x86 MSVC build 2021-08-04 19:22:30 +09:00
libmicrodns.wrap subprojects: libmicrodns: pin to 0.1.2 release 2020-07-07 15:23:29 +01:00
libnice.wrap subprojects: use upstream libnice 2018-12-18 23:59:01 +00:00
libopenjp2.wrap libopenjp2.wrap: Update to v6 to fix macOS build 2021-08-28 23:44:52 +05:30
libpsl.wrap libpsl.wrap: pin to 0.21.1 tag 2020-10-26 12:13:12 +00:00
libsoup.wrap libsoup: update to 2.74.0 2021-08-26 15:59:08 +03:00
libwpe.wrap subprojects: Update libwpe and wpebackend-fdo for fallback support 2020-10-12 12:29:01 +00:00
libxml2.wrap libxml2: update wrap path to 2.9.7-6 2020-02-19 13:45:52 +01:00
openh264.wrap openh264: update to v2.1.1 2020-05-31 11:11:18 +01:00
opus.wrap Add opus wrap 2020-11-16 19:23:20 +00:00
orc.wrap Revert "subprojects: orc: pin to 0.4.29 release" 2020-10-27 14:33:59 +01:00
pango.wrap subprojects: pin pango wrap to tag 2021-08-08 19:42:24 +01:00
pixman.wrap Add pango.wrap file and its dependencies 2020-10-06 12:35:14 +00:00
proxy-libintl.wrap subprojects: proxy-libintl: fix push-url 2019-08-14 18:51:43 +01:00
pycairo.wrap {pygobject,pycairo}.wrap: point to stable refs 2020-09-15 15:51:42 +03:00
pygobject.wrap {pygobject,pycairo}.wrap: point to stable refs 2020-09-15 15:51:42 +03:00
sqlite3.wrap Update to sqlite3 from wrapdb 2021-08-24 20:52:06 +00:00
webrtc-audio-processing.wrap subprojects: add webrtc-audio-processing.wrap 2020-10-28 16:14:41 +01:00
wpebackend-fdo.wrap subprojects: Update libwpe and wpebackend-fdo for fallback support 2020-10-12 12:29:01 +00:00
x264.wrap x264: update to latest stable 160.3011 2020-07-30 15:52:38 +01:00
zlib.wrap meson: Update zlib.wrap to use wrapdb instead of github fork 2021-01-13 12:55:06 +00:00