A method of encoding a digital video, comprising: receiving a digital video data set including at least one of high dynamic range and wide color gamut video data, comprising a sequence of images, wherein a coding transfer function maps every possible input value in an HDR range to specific non-linear values ranging from 0 to 255 for 8-bit values or 0 to 1023 for 10 bit values, the 8-bit or 10-bit values suitable for coding with at least one of MPEG-4, Advanced Video Coding and High Efficiency Video Coding; dividing the digital video data set into processing windows by applying a quadtree decomposition to the image data so that a specific set of tone mapping parameters are indicated and applied to each leaf node of the quadtree, where each leaf node of the quadtree decomposition has a different set of tone mapping parameters; wherein the indication and application of a set of tone mapping parameters comprises: determining the maximum, average, and minimum values of each video component in a processing window; adapting the coding transfer function to increase the number of quantization steps assigned between the minimum and maximum values while decreasing the number of quantization steps assigned to values less than the minimum or greater than the maximum; applying the adapted coding transfer function to the portion of the digital video data set in the processing window to generate a modified portion of the digital video data set; encoding the modified portion of the video data set to generate a bit stream; transmitting, to a decoder, the bit stream and metadata that indicates the adaptations to the coding transfer function, and that identifies the processing window. receiving a digital video data set including at least one of high dynamic range and wide color gamut video data, comprising a sequence of images, wherein a coding transfer function maps every possible input value in an HDR range to specific non-linear values ranging from 0 to 255 for 8-bit values or 0 to 1023 for 10 bit values, the 8-bit or 10-bit values suitable for coding with at least one of MPEG-4, Advanced Video Coding and High Efficiency Video Coding; dividing the digital video data set into processing windows by applying a quadtree decomposition to the image data so that a specific set of tone mapping parameters are indicated and applied to each leaf node of the quadtree, where each leaf node of the quadtree decomposition has a different set of tone mapping parameters; wherein the indication and application of a set of tone mapping parameters comprises: determining the maximum, average, and minimum values of each video component in a processing window; adapting the coding transfer function to increase the number of quantization steps assigned between the minimum and maximum values while decreasing the number of quantization steps assigned to values less than the minimum or greater than the maximum; applying the adapted coding transfer function to the portion of the digital video data set in the processing window to generate a modified portion of the digital video data set; encoding the modified portion of the video data set to generate a bit stream; transmitting, to a decoder, the bit stream and metadata that indicates the adaptations to the coding transfer function, and that identifies the processing window. determining the maximum, average, and minimum values of each video component in a processing window; adapting the coding transfer function to increase the number of quantization steps assigned between the minimum and maximum values while decreasing the number of quantization steps assigned to values less than the minimum or greater than the maximum; applying the adapted coding transfer function to the portion of the digital video data set in the processing window to generate a modified portion of the digital video data set; encoding the modified portion of the video data set to generate a bit stream; transmitting, to a decoder, the bit stream and metadata that indicates the adaptations to the coding transfer function, and that identifies the processing window.