Use reference-counted reference frames instead of copying