This is the brief introduction of "YCbCr to RGB" part in former post.
We use a 3x3 matrix to implement 4:4:4 YCbCr->RGB conversion. If it is 4:2:2->RGB, we need to resample chroma values to get 4:4:4. It is a simple process of interpolating Cb and Cr. We can average the nearest two Cb, Cr values to get the missing Cb, Cr. We can also just replicate a neighbor pixel. For 4:2:2, it is a one-dimensional filter. For 4:2:0, it involves vertical sampling, hence we need a two-dimensional filter.
4:2:2 -> 4:4:4, and 4:4:4 ->RGB are both linear, a combine operation can be used to get 4:2:2 -> RGB.