diff mbox series

[FFmpeg-devel,3/5] avcodec/libsvtav1: remove the unsupported color format and profile

Message ID 1596280963-15526-3-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/5] avcodec/libsvtav1: fix copy and paste error
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Limin Wang Aug. 1, 2020, 11:22 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

If you enable YUV422 or YUV444, SVT-AV1 library will report "only support 420 now" error,
so it's better to remove the unsupported code.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/libsvtav1.c | 13 -------------
 1 file changed, 13 deletions(-)

Comments

Mark Thompson Aug. 1, 2020, 1:02 p.m. UTC | #1
On 01/08/2020 12:22, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> If you enable YUV422 or YUV444, SVT-AV1 library will report "only support 420 now" error,
> so it's better to remove the unsupported code.

... not that you can even get to that message at the moment, because the encoder wrapper only accepts YUV420P and YUV420P10 anyway.

> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>   libavcodec/libsvtav1.c | 13 -------------
>   1 file changed, 13 deletions(-)
> 
> diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> index eb6043b..3e3b907 100644
> --- a/libavcodec/libsvtav1.c
> +++ b/libavcodec/libsvtav1.c
> @@ -160,10 +160,6 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
>   
>       if (desc->log2_chroma_w == 1 && desc->log2_chroma_h == 1)
>           param->encoder_color_format   = EB_YUV420;
> -    else if (desc->log2_chroma_w == 1 && desc->log2_chroma_h == 0)
> -        param->encoder_color_format   = EB_YUV422;
> -    else if (!desc->log2_chroma_w && !desc->log2_chroma_h)
> -        param->encoder_color_format   = EB_YUV444;
>       else {
>           av_log(avctx, AV_LOG_ERROR , "Unsupported pixel format\n");
>           return AVERROR(EINVAL);
> @@ -175,15 +171,6 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
>       if (avctx->level != FF_LEVEL_UNKNOWN)
>           param->level = avctx->level;
>   
> -    if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10)
> -         && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) {
> -        av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n");
> -        param->profile = FF_PROFILE_AV1_PROFESSIONAL;
> -    } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) {
> -        av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n");
> -        param->profile = FF_PROFILE_AV1_HIGH;
> -    }
> -
>       // Update param from options
>       param->hierarchical_levels      = svt_enc->hierarchical_level;
>       param->enc_mode                 = svt_enc->enc_mode;
> 

Sure, LGTM.

Thanks,

- Mark
Limin Wang Aug. 1, 2020, 3:15 p.m. UTC | #2
On Sat, Aug 01, 2020 at 02:02:33PM +0100, Mark Thompson wrote:
> On 01/08/2020 12:22, lance.lmwang@gmail.com wrote:
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > If you enable YUV422 or YUV444, SVT-AV1 library will report "only support 420 now" error,
> > so it's better to remove the unsupported code.
> 
> ... not that you can even get to that message at the moment, because the encoder wrapper only accepts YUV420P and YUV420P10 anyway.

Sorry, my commit message isn't clear, in fact, I add the code to enable YUV422
and YUV444, but by the testing result, it'll failed, so I remove the unsupported code.

> 
> > 
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> >   libavcodec/libsvtav1.c | 13 -------------
> >   1 file changed, 13 deletions(-)
> > 
> > diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> > index eb6043b..3e3b907 100644
> > --- a/libavcodec/libsvtav1.c
> > +++ b/libavcodec/libsvtav1.c
> > @@ -160,10 +160,6 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
> >       if (desc->log2_chroma_w == 1 && desc->log2_chroma_h == 1)
> >           param->encoder_color_format   = EB_YUV420;
> > -    else if (desc->log2_chroma_w == 1 && desc->log2_chroma_h == 0)
> > -        param->encoder_color_format   = EB_YUV422;
> > -    else if (!desc->log2_chroma_w && !desc->log2_chroma_h)
> > -        param->encoder_color_format   = EB_YUV444;
> >       else {
> >           av_log(avctx, AV_LOG_ERROR , "Unsupported pixel format\n");
> >           return AVERROR(EINVAL);
> > @@ -175,15 +171,6 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
> >       if (avctx->level != FF_LEVEL_UNKNOWN)
> >           param->level = avctx->level;
> > -    if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10)
> > -         && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) {
> > -        av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n");
> > -        param->profile = FF_PROFILE_AV1_PROFESSIONAL;
> > -    } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) {
> > -        av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n");
> > -        param->profile = FF_PROFILE_AV1_HIGH;
> > -    }
> > -
> >       // Update param from options
> >       param->hierarchical_levels      = svt_enc->hierarchical_level;
> >       param->enc_mode                 = svt_enc->enc_mode;
> > 
> 
> Sure, LGTM.
> 
> Thanks,
> 
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index eb6043b..3e3b907 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -160,10 +160,6 @@  static int config_enc_params(EbSvtAv1EncConfiguration *param,
 
     if (desc->log2_chroma_w == 1 && desc->log2_chroma_h == 1)
         param->encoder_color_format   = EB_YUV420;
-    else if (desc->log2_chroma_w == 1 && desc->log2_chroma_h == 0)
-        param->encoder_color_format   = EB_YUV422;
-    else if (!desc->log2_chroma_w && !desc->log2_chroma_h)
-        param->encoder_color_format   = EB_YUV444;
     else {
         av_log(avctx, AV_LOG_ERROR , "Unsupported pixel format\n");
         return AVERROR(EINVAL);
@@ -175,15 +171,6 @@  static int config_enc_params(EbSvtAv1EncConfiguration *param,
     if (avctx->level != FF_LEVEL_UNKNOWN)
         param->level = avctx->level;
 
-    if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10)
-         && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) {
-        av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n");
-        param->profile = FF_PROFILE_AV1_PROFESSIONAL;
-    } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) {
-        av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n");
-        param->profile = FF_PROFILE_AV1_HIGH;
-    }
-
     // Update param from options
     param->hierarchical_levels      = svt_enc->hierarchical_level;
     param->enc_mode                 = svt_enc->enc_mode;