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.5 or later (Intel) Target SDK (libc++/libstdc++)
- Microsoft Visual Studio 2010 - 2017, Windows 7 or later
- GCC 5.3.1+, Glibc 2.23+ 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. The CUDA
runtime dynamic library is available in the CUDA SDK toolkit from NVIDIA.
macOS has been tested to support CUDA 6.5 through 9.0 dynamic runtime
libraries named as libcudart.dylib. Linux and Windows require the Cuda 6.5
or later 64-bit dynamic runtime library.


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: Metal is not currently supports for 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.

4. Pass the DebayerJob into the appropriate GPU Interface.

See included sample code REDCLSample.cpp, REDCudaSample.cpp and
REDMetalSample.mm for full examples.


How to use GPU decode using Advanced GPU Mode (REDCuda only)
------------------------------------------------------------------------------
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 CudaGpuDecodeSample.cpp