avcodec/nvenc: Refactor timestamp generation logic