diff options
author | Boyuan Zhang <[email protected]> | 2018-10-17 15:03:23 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2018-10-23 08:50:02 -0400 |
commit | c7a5ef26adecb6454039ae0bed672cbd30dbede6 (patch) | |
tree | 31e8de4d4f57bb3629d7981d2d227fff591d5eab /src/gallium/drivers/radeon/radeon_vcn_dec.c | |
parent | 40fceb55f361eb1e0fb9da8ed607288f956bbb7b (diff) |
radeon/vcn: add jpeg decode implementation
Add a new file to handle VCN Jpeg decode specific functions. Use Jpeg
specific cmd sending function in end_frame call.
Signed-off-by: Boyuan Zhang <[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/radeon_vcn_dec.c')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_dec.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c index 30a98c27867..75ef4a5d401 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_dec.c +++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c @@ -1247,6 +1247,10 @@ static unsigned calc_dpb_size(struct radeon_decoder *dec) dpb_size *= (3 / 2); break; + case PIPE_VIDEO_FORMAT_JPEG: + dpb_size = 0; + break; + default: // something is missing here assert(0); @@ -1547,14 +1551,14 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context, } dpb_size = calc_dpb_size(dec); - - if (!si_vid_create_buffer(dec->screen, &dec->dpb, dpb_size, PIPE_USAGE_DEFAULT)) { - RVID_ERR("Can't allocated dpb.\n"); - goto error; + if (dpb_size) { + if (!si_vid_create_buffer(dec->screen, &dec->dpb, dpb_size, PIPE_USAGE_DEFAULT)) { + RVID_ERR("Can't allocated dpb.\n"); + goto error; + } + si_vid_clear_buffer(context, &dec->dpb); } - si_vid_clear_buffer(context, &dec->dpb); - if (dec->stream_type == RDECODE_CODEC_H264_PERF) { unsigned ctx_size = calc_ctx_size_h264_perf(dec); if (!si_vid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT)) { @@ -1581,7 +1585,10 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context, next_buffer(dec); - dec->send_cmd = send_cmd_dec; + if (stream_type == RDECODE_CODEC_JPEG) + dec->send_cmd = send_cmd_jpeg; + else + dec->send_cmd = send_cmd_dec; return &dec->base; |