% This file contains the content for a main section
\regularsectionformat	% Change formatting to that of "Introduction" section
%% Modify below this line %%
\chapter{Specification}

\section{Naming conventions}
Both the 10-bit and 12-bit logarithmic integer encoding of ACES specified in \autoref{sec:ACESproxy10} and 4.4 of this document shall be known as ACESproxy.

Systems that are limited to the display of 8 characters for control labels shall use the abbreviation \\
ACESPRXY. 

Systems that are limited to the display of 5 to 7 characters for control labels shall use the abbreviation ACSPX.

\section{Color space chromaticities}
\label{sec:colorspace}
ACESproxy uses a different set of primaries than ACES RGB primaries defined in SMPTE ST 2065-1. The CIE 1931 colorimetry of the ACESproxy RGB primaries and white are specified below.

\subsection{Color primaries}
The RGB primaries chromaticity values, known as AP1, shall be those found in \autoref{table:AP1rgb}.

\begin{center}
\begin{tabularx}{4.5in}{XlllXll}
        & R       & G       & B       & & CIE x & CIE y \\ \hline
Red     & 1.00000 & 0.00000 & 0.00000 & & 0.713 & 0.293 \\
Green   & 0.00000 & 1.00000 & 0.00000 & & 0.165 & 0.830 \\
Blue    & 0.00000 & 0.00000 & 1.00000 & & 0.128 & 0.044 \\
\end{tabularx}
\captionof{table}{ACESproxy RGB primaries chromaticity values}    
\label{table:AP1rgb}
\end{center}

\subsection{White Point}
The white point shall be that found in \autoref{table:AP1w}.

\begin{center}
\begin{tabularx}{4.5in}{XlllXll}
        & R       & G       & B       & & CIE x & CIE y \\ \hline
White   & 1.00000 & 1.00000 & 1.00000 & & 0.32168 & 0.33767 \\
\end{tabularx}
\captionof{table}{ACES RGB white point chromaticity values}    
\label{table:AP1w}
\end{center}

\newpage
\section{ACESproxy 10-bit definition}
\label{sec:ACESproxy10}
The following functions shall be used to convert between ACES values, encoded according to SMPTE ST 2065-1, and 10-bit integer ACESproxy values.

\subsection{10-bit ACESproxy encoding}
ACES $R$, $G$, and $B$ values shall be converted to $lin_{AP1}$ $R$, $G$, and $B$ values using the transformation matrix ($TRA_{1}$) calculated and applied using the methods provided in Section 4 of SMPTE RP 177:1993.

$lin_{AP1}$ $R$, $G$, and $B$ values shall be converted to ACESproxy10 values using Equation \ref{eq:linAP12ACESproxy10}.

\begin{floatequ} 
\begin{equation} 
    \resizebox{\textwidth}{!}{$
    ACESproxy10 = \left\{ 
    \begin{array}{l l}
        64;    & lin_{AP1} \leq 2^{-9.72} \\
        \mathrm{FLOAT2CV10}\left[\left(\log_2(lin_{AP1})+2.5\right)\times 50+425\right];        & lin_{AP1} > 2^{-9.72} \\
    \end{array} \right.$
	}
\end{equation}

{\setlength{\parskip}{8pt}
\tabto{0.75in} Where:

\tabto{0.75in} FLOAT2CV10($\mathbf{a}$) returns MAX$(64,$ MIN$(940,$ ROUND$(\mathbf{a})))$

\tabto{0.75in} ROUND($\mathbf{a}$) returns the integer value closest to the floating point value $\mathbf{a}$

\tabto{0.75in} MAX$(\mathbf{a}, \mathbf{b})$ returns the greater of $\mathbf{a}$ or $\mathbf{b}$

\tabto{0.75in} MIN$(\mathbf{a}, \mathbf{b})$ returns the lesser of $\mathbf{a}$ or $\mathbf{b}$
}
\caption{lin\textsubscript{AP1} to ACESproxy10}
\label{eq:linAP12ACESproxy10}
\end{floatequ}

\note{Equation \ref{eq:ACES2linAP110} shows the relationship between ACES $R$, $G$, and $B$ values and $lin_{AP1}$ $R$, $G$, and $B$ values. $TRA_{1}$, rounded to 10 significant digits, is derived from the product of $NPM_{AP1}$ inverse and $NPM_{AP0}$ calculated using methods provided in Section 3.3 of SMPTE RP 177:1993. AP0 are the primaries of ACES specified in SMPTE ST 2065-1:2012. AP1 are the primaries of ACESproxy specified in \autoref{sec:colorspace}.}

\begin{floatequ} 
\begin{gather}
    \begin{bmatrix}
        R_{lin_{AP1}}\\
        G_{lin_{AP1}}\\
        B_{lin_{AP1}}
    \end{bmatrix}
    =
    TRA_{1}
    \cdot
    \begin{bmatrix}
        R_{ACES}\\
        G_{ACES}\\
        B_{ACES}
    \end{bmatrix} \\
    \\
    TRA_{1} =
    \begin{bmatrix*}[r]
        1.4514393161 & -0.2365107469 & -0.2149285693 \\
       -0.0765537734 &  1.1762296998 & -0.0996759264 \\
        0.0083161484 & -0.0060324498 &  0.9977163014 \\
    \end{bmatrix*} \\
    \\
    TRA_{1} = NPM^{-1}_{AP1} \cdot NPM_{AP0}
\end{gather}
\caption{ACES to lin\textsubscript{AP1}}
\label{eq:ACES2linAP110}
\end{floatequ}

\note{ACESproxy values encoded using the equation above are not appropriate for storage or for archiving. They are intended for use only with digital transport interfaces unable to carry half-precision floating-point values, and with integer-based grading systems designed to generate look metadata that will guide the color grading applied to ACES image data later in the post-production process.}


\note{ACESproxy encodes values into the SMPTE ``legal-range'' for video systems; grading systems should use this as their nominal range.}


\subsection{10-bit ACESproxy decoding}
ACESproxy $R$, $G$, and $B$ values shall be converted to $lin_{AP1}$ values using Equation \ref{eq:ACESproxy2linAP110}.

\begin{floatequ} 
\begin{equation} 
    lin_{AP1} = 2^{\left(\dfrac{ACESproxy10-425}{50}-2.5\right)}
\end{equation}
\caption{ACESproxy10 to lin\textsubscript{AP1}}
\label{eq:ACESproxy2linAP110}
\end{floatequ}

$lin_{AP1}$ $R$, $G$, and $B$ values shall be converted to ACES $R$, $G$, and $B$ values using the transformation matrix ($TRA_{2}$) calculated and applied using the methods provided in Section 4 of SMPTE RP 177:1993.

\note{Equation \ref{eq:linAP12ACES10} shows the relationship between ACES $R$, $G$, and $B$ values and $lin_{AP1}$ $R$, $G$, and $B$ values. $TRA_{2}$, rounded to 10 significant digits, is derived from the product of $NPM_{AP0}$ inverse and $NPM_{AP1}$ calculated using methods provided in Section 3.3 of SMPTE RP 177:1993. AP0 are the primaries of ACES specified in SMPTE ST 2065-1:2012. AP1 are the primaries of ACESproxy specified in \autoref{sec:colorspace}.}

\begin{floatequ} 
\begin{gather}
    \begin{bmatrix}
        R_{ACES}\\
        G_{ACES}\\
        B_{ACES}
    \end{bmatrix}
    =
    TRA_{2}
    \cdot
    \begin{bmatrix}
        R_{lin_{AP1}}\\
        G_{lin_{AP1}}\\
        B_{lin_{AP1}}
    \end{bmatrix} \\
    \\
    TRA_{2} =
    \begin{bmatrix*}[r]
        0.6954522414 & 0.1406786965 & 0.1638690622 \\
        0.0447945634 & 0.8596711185 & 0.0955343182 \\
        -0.0055258826 & 0.0040252103 & 1.0015006723 \\
    \end{bmatrix*} \\
    \\
    TRA_{2} = NPM^{-1}_{AP0} \cdot NPM_{AP1}
\end{gather}
\caption{lin\textsubscript{AP1} to ACES}
\label{eq:linAP12ACES10}
\end{floatequ}


\newpage
\section{ACESproxy 12-bit definition}
\label{sec:ACESproxy12}
The following functions shall be used to convert between ACES values, encoded according to SMPTE ST 2065-1, and 12-bit integer ACESproxy values.

\subsection{12-bit ACESproxy encoding}
ACES $R$, $G$, and $B$ values shall be converted to $lin_{AP1}$ $R$, $G$, and $B$ values using the transformation matrix ($TRA_{1}$) calculated and applied using the methods provided in Section 4 of SMPTE RP 177:1993.

$lin_{AP1}$ $R$, $G$, and $B$ values shall be converted to ACESproxy12 values using Equation \ref{eq:linAP12ACESproxy12}.

\begin{floatequ} 
\begin{equation} 
    \resizebox{\textwidth}{!}{$
    ACESproxy12 = \left\{ 
    \begin{array}{l l}
        256;    & lin_{AP1} \leq 2^{-9.72} \\
        \mathrm{FLOAT2CV12}\left[\left(\log_2(lin_{AP1})+2.5\right)\times 200+1700\right];        & lin_{AP1} > 2^{-9.72} \\
    \end{array} \right.$
    }
\end{equation}
{\setlength{\parskip}{8pt}
\tabto{0.75in} Where:

\tabto{0.75in} FLOAT2CV12($\mathbf{a}$) returns MAX$(256,$ MIN$(3760,$ ROUND$(\mathbf{a})))$

\tabto{0.75in} ROUND($\mathbf{a}$) returns the integer value closest to the floating point value $\mathbf{a}$

\tabto{0.75in} MAX$(\mathbf{a}, \mathbf{b})$ returns the greater of $\mathbf{a}$ or $\mathbf{b}$

\tabto{0.75in} MIN$(\mathbf{a}, \mathbf{b})$ returns the lesser of $\mathbf{a}$ or $\mathbf{b}$
}

\caption{lin\textsubscript{AP1} to ACESproxy12}
\label{eq:linAP12ACESproxy12}
\end{floatequ}

\note{Equation \ref{eq:ACES2linAP112} shows the relationship between ACES $R$, $G$, and $B$ values and $lin_{AP1}$ $R$, $G$, and $B$ values. $TRA_{1}$, rounded to 10 significant digits, is derived from the product of $NPM_{AP1}$ inverse and $NPM_{AP0}$ calculated using methods provided in Section 3.3 of SMPTE RP 177:1993. AP0 are the primaries of ACES specified in SMPTE ST 2065-1:2012. AP1 are the primaries of ACESproxy specified in \autoref{sec:colorspace}.}

\begin{floatequ} 
\begin{gather}
    \begin{bmatrix}
        R_{lin_{AP1}}\\
        G_{lin_{AP1}}\\
        B_{lin_{AP1}}
    \end{bmatrix}
    =
    TRA_{1}
    \cdot
    \begin{bmatrix}
        R_{ACES}\\
        G_{ACES}\\
        B_{ACES}
    \end{bmatrix} \\
    \\
    TRA_{1} =
    \begin{bmatrix*}[r]
        1.4514393161 & -0.2365107469 & -0.2149285693 \\
       -0.0765537734 &  1.1762296998 & -0.0996759264 \\
        0.0083161484 & -0.0060324498 &  0.9977163014 \\
    \end{bmatrix*} \\
    \\
    TRA_{1} = NPM^{-1}_{AP1} \cdot NPM_{AP0}
\end{gather}
\caption{ACES to lin\textsubscript{AP1}}
\label{eq:ACES2linAP112}
\end{floatequ}

\note{ACESproxy values encoded using the equation above are not appropriate for storage or for archiving. They are intended for use only with digital transport interfaces unable to carry half-precision floating-point values, and with integer-based grading systems designed to generate look metadata that will guide the color grading applied to ACES image data later in the post-production process.}

\note{ACESproxy encodes values into the SMPTE ``legal-range'' for video systems; grading systems should use this as their nominal range.}


\subsection{12-bit ACESproxy decoding}
ACESproxy $R$, $G$, and $B$ values shall be converted to $lin_{AP1}$ values using Equation \ref{eq:ACESproxy2linAP1}.

\begin{floatequ} 
\begin{equation} 
    lin_{AP1} = 2^{\left(\dfrac{ACESproxy12-1700}{200}-2.5\right)}
\end{equation}
\caption{ACESproxy12 to lin\textsubscript{AP1}}
\label{eq:ACESproxy2linAP1}
\end{floatequ}

$lin_{AP1}$ $R$, $G$, and $B$ values shall be converted to ACES $R$, $G$, and $B$ values using the transformation matrix ($TRA_{2}$) calculated and applied using the methods provided in Section 4 of SMPTE RP 177:1993.

\note{Equation \ref{eq:linAP12ACES12} shows the relationship between ACES $R$, $G$, and $B$ values and $lin_{AP1}$ $R$, $G$, and $B$ values. $TRA_{2}$, rounded to 10 significant digits, is derived from the product of $NPM_{AP0}$ inverse and $NPM_{AP1}$ calculated using methods provided in Section 3.3 of SMPTE RP 177:1993. AP0 are the primaries of ACES specified in SMPTE ST 2065-1:2012. AP1 are the primaries of ACESproxy specified in \autoref{sec:colorspace}.}

\begin{floatequ} 
\begin{gather}
    \begin{bmatrix}
        R_{ACES}\\
        G_{ACES}\\
        B_{ACES}
    \end{bmatrix}
    =
    TRA_{2}
    \cdot
    \begin{bmatrix}
        R_{lin_{AP1}}\\
        G_{lin_{AP1}}\\
        B_{lin_{AP1}}
    \end{bmatrix} \\
    \\
    TRA_{2} =
    \begin{bmatrix*}[r]
        0.6954522414 & 0.1406786965 & 0.1638690622 \\
        0.0447945634 & 0.8596711185 & 0.0955343182 \\
        -0.0055258826 & 0.0040252103 & 1.0015006723 \\
    \end{bmatrix*} \\
    \\
    TRA_{2} = NPM^{-1}_{AP0} \cdot NPM_{AP1}
\end{gather}
\caption{lin\textsubscript{AP1} to ACESproxy}
\label{eq:linAP12ACES12}
\end{floatequ}