def generate_frame_list(start_frame, frame_key, num_frames_to_optimize):
    frame_key = int(frame_key)
    start_frame = int(start_frame)
    num_frames_to_optimize = int(num_frames_to_optimize)

    frame_list = []

    # Include frames starting from the frame key
    for i in range(num_frames_to_optimize):
        curr_frame = frame_key - i
        if curr_frame >= start_frame:
            frame_list.append(str(curr_frame))
        else:
            break  # Stop adding frames if we reach the start frame

    return frame_list[::-1]  # Reverse the list to maintain chronological order