def BuildDtd(desc_json):
    """Create a list out of a single detailed timing descriptor dictionary.

    Args:
      desc_json: The dictionary of a single detailed timing descriptor info.

    Returns:
      A list of 18 bytes representing a single detailed timing descriptor.
    """
    d = [0] * 18

    # Set pixel clock
    pc = int(desc_json["Pixel clock (MHz)"] * 100)
    d[0] = pc & 0xFF
    d[1] = pc >> 8

    hav = desc_json["Addressable"]["x"]
    hb = desc_json["Blanking"]["x"]
    d[2] = hav & 0xFF
    d[3] = hb & 0xFF
    d[4] = ((hav >> 8) << 4) + (hb >> 8)

    vav = desc_json["Addressable"]["y"]
    hv = desc_json["Blanking"]["y"]
    d[5] = vav & 0xFF
    d[6] = hv & 0xFF
    d[7] = ((vav >> 8) << 4) + (hv >> 8)

    hfp = desc_json["Front porch"]["x"]
    hsp = desc_json["Sync pulse"]["x"]
    vfp = desc_json["Front porch"]["y"]
    vsp = desc_json["Sync pulse"]["y"]
    d[8] = hfp & 0xFF
    d[9] = hsp & 0xFF
    d[10] = ((vfp & 0x0F) << 4) + (vsp & 0x0F)
    d[11] = ((hfp >> 8) << 6) + ((hsp >> 8) << 4) + ((vfp >> 4) << 2) + (vsp >> 4)

    hav = desc_json["Image size (mm)"]["x"]
    vav = desc_json["Image size (mm)"]["y"]
    d[12] = hav & 0xFF
    d[13] = vav & 0xFF
    d[14] = ((hav >> 8) << 4) + (vav >> 8)

    d[15] = desc_json["Border"]["x"]
    d[16] = desc_json["Border"]["y"]

    # Byte 17
    stereo_map = {
        "No stereo": (0x0 << 5) + 0x0,  # Could be 0x00 or 0x01
        "Field sequential stereo, right image when stereo sync signal = 1": (0x1 << 5)
        + 0x0,
        "2-way interleaved stereo, right image on even lines": (0x1 << 5) + 0x1,
        "Field sequential stereo, left image when stereo sync signal = 1": (0x2 << 5)
        + 0x0,
        "2-way interleaved stereo, left image on even lines": (0x2 << 5) + 0x1,
        "4-way interleaved stereo": (0x3 << 5) + 0x0,
        "Side-by-side interleaved stereo": (0x3 << 5) + 0x1,
    }

    stereo = stereo_map[desc_json["Stereo viewing"]]

    sync_json = desc_json["Sync type"]
    if "Digital" in sync_json["Type"]:
        if "Separate" in sync_json["Type"]:
            x = 0x03
            y = int(sync_json["Vertical sync"] == "Positive")

        else:
            x = 0x02
            y = int(sync_json["Serrations"])

        z = int(sync_json["Horizontal sync (outside of V-sync)"] == "Positive")

    else:  # Analog
        x = int("Bipolar" in sync_json["Type"])
        y = int(sync_json["Serrations"])
        z = int(sync_json["Sync on RGB"])

    interlace = int(desc_json["Interlace"])
    sync_type = (x << 3) + (y << 2) + (z << 1)

    d[17] = (interlace << 7) + stereo + sync_type

    return d