merge with hevc branch from smarter