Optimized encoding kernel to take into account dictionary preloading