shadow: reduce resource usage in encoder