#include "radeon/radeon_vce.h"
#include "radeon/radeon_vcn_dec.h"
#include "radeon/radeon_vcn_enc.h"
+#include "radeon/radeon_uvd_enc.h"
+#include "util/u_video.h"
/**
* creates an video buffer with an UVD compatible memory layout
struct si_context *ctx = (struct si_context *)context;
bool vcn = (ctx->b.family == CHIP_RAVEN) ? true : false;
- if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)
- return (vcn) ? radeon_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer) :
- si_vce_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+ if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
+ if (vcn) {
+ radeon_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+ } else {
+ if (u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_HEVC)
+ return radeon_uvd_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+ else
+ return si_vce_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+ }
+ }
return (vcn) ? radeon_create_decoder(context, templ) :
si_common_uvd_create_decoder(context, templ, si_uvd_set_dtb);