Refactor YCbCr chroma offset calculation into a separate function.