radeon/vce: move CPB handling function into common code