def mse(original_data, degradated_data):
    """
    This calculates the Mean Squared Error (MSE)
    :param original_data: As Pillow gives it with getdata
    :param degradated_data: As Pillow gives it with getdata
    :return: List containing the MSE in Y, U, V and average of those 3
    """
    error_y = 0
    error_cb = 0
    error_cr = 0

    for i in range(0, len(original_data)):
        dif_y = abs(original_data[i][0] - degradated_data[i][0])
        dif_cb = abs(original_data[i][1] - degradated_data[i][1])
        dif_cr = abs(original_data[i][2] - degradated_data[i][2])
        error_y += dif_y * dif_y
        error_cb += dif_cb * dif_cb
        error_cr += dif_cr * dif_cr

    mse_y = error_y / len(original_data)
    mse_cb = error_cb / len(original_data)
    mse_cr = error_cr / len(original_data)
    mse_avg = (mse_y*4 + mse_cb + mse_cr)/6

    return [mse_y, mse_cb, mse_cr, mse_avg]

    """
    Obtains the PSNR for a list of MSE values
    :param mse_list: A list of mse quantities
    :return: List containing the PSNR. If MSE is 0 the output PSNR is infinite
    """