1. A computer-implemented method, comprising: generating an array comprising a plurality of items, wherein each of the plurality of items comprises one or more instructions representing one or more operations occurring at a point in time in a video sequence; for each one of a plurality of patterns, scanning the array to determine if one or more groups of items in the array match the pattern; for each group of items matching one of the plurality of patterns, replacing the matching group of items in the array with a merged item, wherein each merged item comprises an ordered sequence of the one or more instructions in the corresponding matching group of items; and compositing a frame of the video sequence dependent on the array comprising the one or more merged items.