Optimize to minimize volatile reads to access next buffer in codec framework