Re: [Mesa-dev] [PATCH] radeon/vcn: determine idr by pic type

2017-12-08 Thread Zhang, Boyuan
Am 04.12.2017 um 21:12 schrieb Zhang, Boyuan:
>>> Am 30.11.2017 um 22:18 schrieb Leo Liu:

 On 11/30/2017 04:12 PM, boyuan.zh...@amd.com wrote:
> From: Boyuan Zhang 
>
> 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 
 Reviewed-by: Leo Liu 
>>> Reviewed-by: Christian König 
>>>
>>> As a consequence could you remove the is_idr flag from the picture 
>>> structure or is that used somewhere else as well?
>>>
>>> Regards,
>>> Christian.
>> Since Vaapi interface provides the idr flag directly, it's better to have a 
>> 1:1 mapping in driver side and use it directly.
>
> I strongly disagree. The VA-API interface for codecs is broken in quite a 
> number of ways.
>
> We should rather use the specifications as source for internal structures and 
> interfaces.

OK, that makes sense. I managed to remove the flag.

>
>>   And actually, we are using this "is_idr" flag in some functions in st/va 
>> now. So I think it's better to keep it for now.
>
> I think we should fix this as well and use the picture type here as well.

This is fixed as well, all "is_idr" flags are removed. 

Please review the new patch sets that just submitted.

Regards,
Boyuan

>
> Regards,
> Christian.
>
>>
>> Regards,
>> Boyuan
>>
> ---
>    src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
>    1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c
> b/src/gallium/drivers/radeon/radeon_vcn_enc.c
> index 9806a69..5fc9fc7 100644
> --- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
> +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
> @@ -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;
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] radeon/vcn: determine idr by pic type

2017-12-08 Thread boyuan.zhang
From: Boyuan Zhang 

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 
Reviewed-by: Leo Liu 
Reviewed-by: Christian König 
---
 src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c 
b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 9806a69..5fc9fc7 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -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;
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radeon/vcn: determine idr by pic type

2017-12-05 Thread Christian König

Am 04.12.2017 um 21:12 schrieb Zhang, Boyuan:

Am 30.11.2017 um 22:18 schrieb Leo Liu:


On 11/30/2017 04:12 PM, boyuan.zh...@amd.com wrote:

From: Boyuan Zhang 

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 

Reviewed-by: Leo Liu 

Reviewed-by: Christian König 

As a consequence could you remove the is_idr flag from the picture structure or 
is that used somewhere else as well?

Regards,
Christian.

Since Vaapi interface provides the idr flag directly, it's better to have a 1:1 
mapping in driver side and use it directly.


I strongly disagree. The VA-API interface for codecs is broken in quite 
a number of ways.


We should rather use the specifications as source for internal 
structures and interfaces.



  And actually, we are using this "is_idr" flag in some functions in st/va now. 
So I think it's better to keep it for now.


I think we should fix this as well and use the picture type here as well.

Regards,
Christian.



Regards,
Boyuan


---
   src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c
b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 9806a69..5fc9fc7 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -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;

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radeon/vcn: determine idr by pic type

2017-12-04 Thread Zhang, Boyuan
> Am 30.11.2017 um 22:18 schrieb Leo Liu:
>>
>>
>> On 11/30/2017 04:12 PM, boyuan.zh...@amd.com wrote:
>>> From: Boyuan Zhang 
>>>
>>> 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 
>> Reviewed-by: Leo Liu 
>
> Reviewed-by: Christian König 
>
> As a consequence could you remove the is_idr flag from the picture structure 
> or is that used somewhere else as well?
>
> Regards,
> Christian.

Since Vaapi interface provides the idr flag directly, it's better to have a 1:1 
mapping in driver side and use it directly. And actually, we are using this 
"is_idr" flag in some functions in st/va now. So I think it's better to keep it 
for now.

Regards,
Boyuan

>
>>
>>> ---
>>>   src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c
>>> b/src/gallium/drivers/radeon/radeon_vcn_enc.c
>>> index 9806a69..5fc9fc7 100644
>>> --- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
>>> +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
>>> @@ -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;
>>

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radeon/vcn: determine idr by pic type

2017-12-01 Thread Christian König

Am 30.11.2017 um 22:18 schrieb Leo Liu:



On 11/30/2017 04:12 PM, boyuan.zh...@amd.com wrote:

From: Boyuan Zhang 

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 

Reviewed-by: Leo Liu 


Reviewed-by: Christian König 

As a consequence could you remove the is_idr flag from the picture 
structure or is that used somewhere else as well?


Regards,
Christian.




---
  src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c 
b/src/gallium/drivers/radeon/radeon_vcn_enc.c

index 9806a69..5fc9fc7 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -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;




___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radeon/vcn: determine idr by pic type

2017-11-30 Thread Leo Liu



On 11/30/2017 04:12 PM, boyuan.zh...@amd.com wrote:

From: Boyuan Zhang 

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 

Reviewed-by: Leo Liu 


---
  src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c 
b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 9806a69..5fc9fc7 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -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;


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] radeon/vcn: determine idr by pic type

2017-11-30 Thread boyuan.zhang
From: Boyuan Zhang 

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 
---
 src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c 
b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 9806a69..5fc9fc7 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -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;
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev