This directory contains the FDL Tree codec described in the paper [1].
An example is provided in: ../Demo/Demo_FDLTree_Codec.m
Note: before encoding a light field with the FDL tree codec, a FDL model (layers and disparity values) must be generated with the FDL toolbox.
-
Convert the layers to spatial domain:
FDLspat = ifftImgs(FDL);
-
Define encoder's configuration parameters (e.g. HEVC QP, codec bitdepth, chroma format for YUV encoding...):
cfg.QPBase=22; cfg.bitDepth=10; cfg.chromaFormat='444';
See EncodeFDLTree.m for the full list of configuration parameters.
-
Define the encoding tree structure to use. For example, to split each parent layer in two equal halves, as in the paper, use:
treeStruct = genBinTreeMidCut(numLayers);
-
Encode the layers
FDLspat
and disparity valuesD
using the EncodeFDLTree function (see detailed documentation in EncodeFDLTree.m):EncodeFDLTree(FDLspat, D, treeStruct, cfg, resDir);
This will generate subdirectories
bin
andlog
in the resDir containing respectively the binary files of the full encoded tree and the corresponding HEVC log files. The function also generates the reconstructed FDL Tree as output.
-
To decode from binary files: use DecodeFDLTree specifying the codec configuration and the
bin
directory containing the encoded binary files (see detailed documentation of the function in DecodeFDLTree.m).- Decoding may be done only up to a given level of the tree using configuration parameter
cfg.level
(the full tree is decoded by default). - The function also outputs the number of bits
nBits
used and the processing timedecodTime
for decoding up to the specified level (only includes processing time: actual runtime may be longer due to reading/writing files from disk in the current implementation). - Number of bits and decoding times depend on the level of the decoded tree specified with
cfg.level
. If the full tree is decoded, the size (in bytes) of thebin
directory must be equal toceil(nBits/8)
.
- Decoding may be done only up to a given level of the tree using configuration parameter
-
To read a FDL Tree already in memory (e.g. reconstructed FDL Tree generated by EncodeFDLTree or decoded with DecodeFDLTree): use ReadFDLTree (see detailed documentation of the function in ReadFDLTree.m).
- The FDL Tree may be read only up to a level specified as input (read the full tree by default).
- Outputs the FDL (with its disparity values) at the specified level. Similarly to the DecodeFDLTree function, additional outputs
nBits
anddecodTime
are given for the specified level.
For the final display with the FDL toolbox rendering tools, the layers must be converted back to the Fourier domain: e.g. FDL=fftImgs(FDLspat);
Windows is required to run the HEVC encoder/decoder with the modifications described in [2] or [3]. The Windows executables are provided in the HEVC_ILP
subdirectory for:
- Normal HEVC (HM):
TAppEncoder_HM-12.1+RExt-4.2.exe
|TAppDecoder_HM-12.1+RExt-4.2.exe
- Modified HEVC [2] with non-linear inter-layer prediction:
TAppEncoder_ILP_lin_trFast.exe
|TAppDecoder_ILP_lin_tr.exe
- Modified HEVC [3] with linear inter-layer prediction:
TAppEncoder_ILP_lin_trFast.exe
|TAppDecoder_ILP_lin_tr.exe
[3] J.-U. Garbas and H. Thoma, "Inter-layer prediction for backwards compatible high dynamic range video coding with SVC," PCS 2012.