nvenc: factor context push/pop into functions