radeon/vcn: determine idr by pic type
authorBoyuan Zhang <boyuan.zhang@amd.com>
Thu, 30 Nov 2017 16:58:32 +0000 (11:58 -0500)
committerLeo Liu <leo.liu@amd.com>
Fri, 15 Dec 2017 21:04:05 +0000 (16:04 -0500)
Vaapi encode interface provides idr frame flags, where omx interface doesn't.
Therefore, change to use picture type to determine idr frame, which will
work for both interfaces.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeon/radeon_vcn_enc.c

index abc89a7c5972ffd0ead70720f3af6abdcd347bfe..06579c83f249e5fdf898228a30a5422e39637eb0 100644 (file)
@@ -47,7 +47,7 @@ static void radeon_vcn_enc_get_param(struct radeon_encoder *enc, struct pipe_h26
        enc->enc_pic.ref_idx_l0 = pic->ref_idx_l0;
        enc->enc_pic.ref_idx_l1 = pic->ref_idx_l1;
        enc->enc_pic.not_referenced = pic->not_referenced;
-       enc->enc_pic.is_idr = pic->is_idr;
+       enc->enc_pic.is_idr = (pic->picture_type == PIPE_H264_ENC_PICTURE_TYPE_IDR);
        enc->enc_pic.crop_left = 0;
        enc->enc_pic.crop_right = (align(enc->base.width, 16) - enc->base.width) / 2;
        enc->enc_pic.crop_top = 0;