R3D SDK initialization, installation and instantiation
------------------------------------------------------------------------------
* R3D SDK dynamic libraries should be installed side-by-side with your
  application. Do not install them in a central location, as they could
  conflict with other SDK based applications a user may have installed.

* InitializeSdk() must be called once on program startup before any SDK
  objects are instantiated or SDK functions are called. Important notes:
  
    * Global SDK objects must be pointers.
    
    * Stack based objects that are not pointers must be in a different
      function or deeper scope to where IntializedSdk() or FinalizeSdk()
      get called.

* FinalizeSdk() must be called once on program shutdown after all SDK objects
  have been released. Do not instantiate SDK objects or call SDK functions
  after calling FinalizeSdk().
  
* Provide the full path to the dynamic libraries in the InitializeSdk() call
  as the current/working folder may not always be the same.
  
* Several different GPU acceleration API's can be selected in InitializeSdk().
  Please note the CUDA runtime requirements under Linking to the R3D SDK.
  
* If possible log the output of GetSdkVersion() after calling InitializeSdk().
  This can be called if InitializeSdk() failed to initialize the SDK properly.

  
Build requirements
------------------------------------------------------------------------------
R3D SDK is developed for compatibility with the following development and
runtime platforms:

- Apple Xcode 7 or later, macOS 10.9 (10.11 for Metal) or later
- Microsoft Visual Studio 2010 - 2017 (2019 & later can use 2017 libraries),
  Windows 7 or later
- GLIBC 2.27+/GLIBCXX 3.4.22+ on Linux Intel Kernel 2.6.0+, POSIX
  support with pthreads (NPTL), libuuid & Large File Support (LFS)

To use this SDK you will need the same development platforms and develop in
C++ (both Mac & Windows) or Objective-C (Mac only). The Windows libraries are
available using both multi-threaded static and dynamic runtime libraries.


Linking to the R3D SDK
------------------------------------------------------------------------------
Windows: to not get link errors and/or runtime crashes you need to link to
the same runtime library in your Visual Studio project as the SDK library
you are using (either multi-threaded [/MT] or multi-threaded DLL [/MD] for
release or multi-threaded debug [/MTd] or multi-threaded debug DLL [/MDd]
for your debug projects).

Mac: also link in Metal framework if using Metal

Linux: also link in dl

REDCuda and REDDecoder require the CUDA 6.5 runtime dynamic library to be
provided in the same folder as the R3D SDK dynamic libraries.

Metal requires v2.3 or higher, macOS 10.11 minimum. 10.14 or higher
recommended for concurrent dispatch support


How to use Simple RED Managed GPU mode (R3DDecoder)
------------------------------------------------------------------------------
1. Setup the options and cards you want to use with the R3DDecoderOptions
   class. A GPU device must be chosen, R3DDecoder will not fall back to CPU
   based processing if a GPU is not present.
   
2. Create an instance of the decoder with R3DDecoder::CreateDecoder

3. Issue decode jobs to the decoder, do not reuse the decode jobs until the
   frame has completed.

4. Release the decoder with R3DDecoder::ReleaseDecoder

See included sample code R3DDecoderSample.cpp for a full example.
NOTE: GPU decode (decompression) & Metal image processing are not supported
      with the R3DDecoder!


How to use Advanced GPU Mode (REDCL, REDCuda, REDMetal)
------------------------------------------------------------------------------
1. Decode a frame with the R3DSDK::AsyncDecoder

2. Upload the result buffer to the GPU.

3. Setup the DebayerJob structure including pointers to the buffer from the
   AsyncDecoder in host memory and GPU memory.
   
   NOTE: the host *and* GPU input buffers must remain valid until
         completeAsync() or process() returns!

4. Pass the DebayerJob into the appropriate GPU Interface.

See included sample code REDOpenCLSample.cpp, REDCudaSample.cpp and
REDMetalSample.mm.


How to use GPU decode using Advanced GPU Mode
------------------------------------------------------------------------------
1. Decode a frame with the R3DSDK::GpuDecoder

2. Upload the result buffer to the GPU.

3. Setup the DebayerJob structure including pointers to the buffer from the
   AsyncDecoder in host memory and GPU memory.

4. Pass the DebayerJob into the appropriate GPU Interface.

See included sample code REDOpenCLGpuDecodeSample.cpp, REDCudaGpuDecodeSample.cpp
and REDMetalGpuDecodeSample.mm.
