[Mesa-dev] radeon/video: only support h264 baseline encode

Submitted by Zhang, Boyuan on April 4, 2017, 3:38 p.m.

Details

Message ID 1491320311-2472-1-git-send-email-boyuan.zhang@amd.com
State New
Headers show
Series "radeon/video: only support h264 baseline encode" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhang, Boyuan April 4, 2017, 3:38 p.m.
From: Boyuan Zhang <boyuan.zhang@amd.com>

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
---
 src/gallium/drivers/radeon/radeon_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeon/radeon_video.c b/src/gallium/drivers/radeon/radeon_video.c
index 605a2c7..02e8dcf 100644
--- a/src/gallium/drivers/radeon/radeon_video.c
+++ b/src/gallium/drivers/radeon/radeon_video.c
@@ -221,7 +221,7 @@  int rvid_get_video_param(struct pipe_screen *screen,
 	if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
 		switch (param) {
 		case PIPE_VIDEO_CAP_SUPPORTED:
-			return codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
+			return profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
 				rvce_is_fw_version_supported(rscreen);
 		case PIPE_VIDEO_CAP_NPOT_TEXTURES:
 			return 1;

Comments

Am 04.04.2017 um 17:38 schrieb boyuan.zhang@amd.com:
> From: Boyuan Zhang <boyuan.zhang@amd.com>
>
> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   src/gallium/drivers/radeon/radeon_video.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeon/radeon_video.c b/src/gallium/drivers/radeon/radeon_video.c
> index 605a2c7..02e8dcf 100644
> --- a/src/gallium/drivers/radeon/radeon_video.c
> +++ b/src/gallium/drivers/radeon/radeon_video.c
> @@ -221,7 +221,7 @@ int rvid_get_video_param(struct pipe_screen *screen,
>   	if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
>   		switch (param) {
>   		case PIPE_VIDEO_CAP_SUPPORTED:
> -			return codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
> +			return profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
>   				rvce_is_fw_version_supported(rscreen);
>   		case PIPE_VIDEO_CAP_NPOT_TEXTURES:
>   			return 1;
2017-04-04 17:58 GMT+02:00 Christian König <deathsimple@vodafone.de>:
> Am 04.04.2017 um 17:38 schrieb boyuan.zhang@amd.com:
>>
>> From: Boyuan Zhang <boyuan.zhang@amd.com>
>>
>> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>

Cc: stable?

>> ---
>>   src/gallium/drivers/radeon/radeon_video.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeon/radeon_video.c
>> b/src/gallium/drivers/radeon/radeon_video.c
>> index 605a2c7..02e8dcf 100644
>> --- a/src/gallium/drivers/radeon/radeon_video.c
>> +++ b/src/gallium/drivers/radeon/radeon_video.c
>> @@ -221,7 +221,7 @@ int rvid_get_video_param(struct pipe_screen *screen,
>>         if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
>>                 switch (param) {
>>                 case PIPE_VIDEO_CAP_SUPPORTED:
>> -                       return codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
>> +                       return profile ==
>> PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
>>                                 rvce_is_fw_version_supported(rscreen);
>>                 case PIPE_VIDEO_CAP_NPOT_TEXTURES:
>>                         return 1;
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Well it's a tricky situation with cabac which would be a shame to loose.

Currently I guess it's a bit strange advertising main/high - but then
others do without having mbaff support ....

As it stands with cabac on I can make (what I think is) a perfectly
legal stream with ffmpeg or gstreamer (ignoring current mesa issue).

... -c:v h264_vaapi -profile:v 77 -bf 0 ...

... max-bframes=0 ! video/x-h264, profile=main ...


Christian König wrote:
> Am 04.04.2017 um 17:38 schrieb boyuan.zhang@amd.com:
>> From: Boyuan Zhang <boyuan.zhang@amd.com>
>>
>> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
>> ---
>>   src/gallium/drivers/radeon/radeon_video.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeon/radeon_video.c
>> b/src/gallium/drivers/radeon/radeon_video.c
>> index 605a2c7..02e8dcf 100644
>> --- a/src/gallium/drivers/radeon/radeon_video.c
>> +++ b/src/gallium/drivers/radeon/radeon_video.c
>> @@ -221,7 +221,7 @@ int rvid_get_video_param(struct pipe_screen *screen,
>>       if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
>>           switch (param) {
>>           case PIPE_VIDEO_CAP_SUPPORTED:
>> -            return codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
>> +            return profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
>>                   rvce_is_fw_version_supported(rscreen);
>>           case PIPE_VIDEO_CAP_NPOT_TEXTURES:
>>               return 1;
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
On 4 April 2017 at 17:13, Andreas Boll <andreas.boll.dev@gmail.com> wrote:
> 2017-04-04 17:58 GMT+02:00 Christian König <deathsimple@vodafone.de>:
>> Am 04.04.2017 um 17:38 schrieb boyuan.zhang@amd.com:
>>>
>>> From: Boyuan Zhang <boyuan.zhang@amd.com>
>>>
>>> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
>>
>>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>
> Cc: stable?
>
Good idea, but we really want a commit message in there ;-)

Is that due to hardware limitation or there's something more to it ?

-Emil
Andy Furniss wrote:
> Well it's a tricky situation with cabac which would be a shame to loose.
>
> Currently I guess it's a bit strange advertising main/high - but then
> others do without having mbaff support ....
>
> As it stands with cabac on I can make (what I think is) a perfectly
> legal stream with ffmpeg or gstreamer (ignoring current mesa issue).
>
> ... -c:v h264_vaapi -profile:v 77 -bf 0 ...

FWIW ffmpeg actually detects the lack of b-frame support, omitting -bf 0
from above will throw an error.

[h264_vaapi @ 0x3075aa0] B frames are not supported (0x1).

I guess that means that gstreamer could in theory do the same.

Looking at a ReLive sample shows it's flagged as main, has cabac
and doesn't have any b-frames.
Andy Furniss wrote:
> Well it's a tricky situation with cabac which would be a shame to loose.
>
> Currently I guess it's a bit strange advertising main/high - but then
> others do without having mbaff support ....
>
> As it stands with cabac on I can make (what I think is) a perfectly
> legal stream with ffmpeg or gstreamer (ignoring current mesa issue).
>
> ... -c:v h264_vaapi -profile:v 77 -bf 0 ...
>
> ... max-bframes=0 ! video/x-h264, profile=main ...

Hmm, maybe some tweaking would be needed for that to work properly
testing shows that it comes out as 88 - maybe to do with the constrained
flags being set in the driver that's expecting baseline?
Am 04.04.2017 um 18:40 schrieb Andy Furniss:
> Well it's a tricky situation with cabac which would be a shame to loose.
Yeah, completely agree.

>
> Currently I guess it's a bit strange advertising main/high - but then
> others do without having mbaff support ....

As noted before mbaff isn't so much of a problem. I mean the stream 
wouldn't be what the application requested, but it would still be 
correctly encoded.

The bigger problem is that we can't convince our firmware team to 
support B-frames.

I've added my manager and going to raise the topic on our next 
multimedia call once more.

Regards,
Christian.

>
> As it stands with cabac on I can make (what I think is) a perfectly
> legal stream with ffmpeg or gstreamer (ignoring current mesa issue).
>
> ... -c:v h264_vaapi -profile:v 77 -bf 0 ...
>
> ... max-bframes=0 ! video/x-h264, profile=main ...
>
>
> Christian König wrote:
>> Am 04.04.2017 um 17:38 schrieb boyuan.zhang@amd.com:
>>> From: Boyuan Zhang <boyuan.zhang@amd.com>
>>>
>>> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
>>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>>> ---
>>>   src/gallium/drivers/radeon/radeon_video.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/gallium/drivers/radeon/radeon_video.c
>>> b/src/gallium/drivers/radeon/radeon_video.c
>>> index 605a2c7..02e8dcf 100644
>>> --- a/src/gallium/drivers/radeon/radeon_video.c
>>> +++ b/src/gallium/drivers/radeon/radeon_video.c
>>> @@ -221,7 +221,7 @@ int rvid_get_video_param(struct pipe_screen 
>>> *screen,
>>>       if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
>>>           switch (param) {
>>>           case PIPE_VIDEO_CAP_SUPPORTED:
>>> -            return codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
>>> +            return profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
>>>                   rvce_is_fw_version_supported(rscreen);
>>>           case PIPE_VIDEO_CAP_NPOT_TEXTURES:
>>>               return 1;
>>
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
Christian König wrote:
> Am 04.04.2017 um 18:40 schrieb Andy Furniss:
>> Well it's a tricky situation with cabac which would be a shame to loose.
> Yeah, completely agree.
>
>>
>> Currently I guess it's a bit strange advertising main/high - but then
>> others do without having mbaff support ....
>
> As noted before mbaff isn't so much of a problem. I mean the stream
> wouldn't be what the application requested, but it would still be
> correctly encoded.
>
> The bigger problem is that we can't convince our firmware team to
> support B-frames.
>
> I've added my manager and going to raise the topic on our next
> multimedia call once more.

Thanks, it would be really good to have b-frames (like the competition).

>
> Regards,
> Christian.
>
>>
>> As it stands with cabac on I can make (what I think is) a perfectly
>> legal stream with ffmpeg or gstreamer (ignoring current mesa issue).
>>
>> ... -c:v h264_vaapi -profile:v 77 -bf 0 ...
>>
>> ... max-bframes=0 ! video/x-h264, profile=main ...
>>
>>
>> Christian König wrote:
>>> Am 04.04.2017 um 17:38 schrieb boyuan.zhang@amd.com:
>>>> From: Boyuan Zhang <boyuan.zhang@amd.com>
>>>>
>>>> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
>>>
>>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>>
>>>> ---
>>>>   src/gallium/drivers/radeon/radeon_video.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/src/gallium/drivers/radeon/radeon_video.c
>>>> b/src/gallium/drivers/radeon/radeon_video.c
>>>> index 605a2c7..02e8dcf 100644
>>>> --- a/src/gallium/drivers/radeon/radeon_video.c
>>>> +++ b/src/gallium/drivers/radeon/radeon_video.c
>>>> @@ -221,7 +221,7 @@ int rvid_get_video_param(struct pipe_screen
>>>> *screen,
>>>>       if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
>>>>           switch (param) {
>>>>           case PIPE_VIDEO_CAP_SUPPORTED:
>>>> -            return codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
>>>> +            return profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
>>>>                   rvce_is_fw_version_supported(rscreen);
>>>>           case PIPE_VIDEO_CAP_NPOT_TEXTURES:
>>>>               return 1;
>>>
>>>
>>> _______________________________________________
>>> mesa-dev mailing list
>>> mesa-dev@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>
>