Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* Re: [FFmpeg-devel] [PATCH] avcodec/vaapi_encode_vp9: fix > 4k encode fail issue
       [not found] <20210412014724.18563-1-yuankunx.zhang@intel.com>
@ 2021-12-24  7:32 ` Xiang, Haihao
  2021-12-24  8:19   ` lance.lmwang
  0 siblings, 1 reply; 3+ messages in thread
From: Xiang, Haihao @ 2021-12-24  7:32 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: yuankunx.zhang

On Mon, 2021-04-12 at 09:47 +0800, Zhang yuankun wrote:
> This patch will fix following command:
> ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i input.264 \
> -vf 'scale_vaapi=w=7680:h=4096' -c:v vp9_vaapi output.ivf
> 
> Max width of a vp9 tile is 4096. If the source frame > 4096, we need split to
> multiple tiles.
> 
> Signed-off-by: Zhang yuankun <yuankunx.zhang@intel.com>
> ---
>  libavcodec/vaapi_encode_vp9.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
> index 0e1c52c92a..ed45cd6d03 100644
> --- a/libavcodec/vaapi_encode_vp9.c
> +++ b/libavcodec/vaapi_encode_vp9.c
> @@ -31,6 +31,7 @@
>  
>  #define VP9_MAX_QUANT 255
>  
> +#define VP9_MAX_TILE_WIDTH 4096
>  
>  typedef struct VAAPIEncodeVP9Picture {
>      int slot;
> @@ -82,10 +83,17 @@ static int
> vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx,
>      VAAPIEncodeVP9Picture          *hpic = pic->priv_data;
>      VAEncPictureParameterBufferVP9 *vpic = pic->codec_picture_params;
>      int i;
> +    int num_tile_columns;
>  
>      vpic->reconstructed_frame = pic->recon_surface;
>      vpic->coded_buf = pic->output_buffer;
>  
> +    // Maximum width of a tile in units of superblocks is
> MAX_TILE_WIDTH_B64(64)
> +    // So the number of tile columns is related to the width of the picture.
> +    // We set the minimum possible number for num_tile_columns as defualt
> value.
> +    num_tile_columns = (vpic->frame_width_src + VP9_MAX_TILE_WIDTH - 1) /
> VP9_MAX_TILE_WIDTH;
> +    vpic->log2_tile_columns = num_tile_columns == 1 ? 0 :
> av_log2(num_tile_columns - 1) + 1;
> +
>      switch (pic->type) {
>      case PICTURE_TYPE_IDR:
>          av_assert0(pic->nb_refs == 0);

LGTM, will apply

-Haihao

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/vaapi_encode_vp9: fix > 4k encode fail issue
  2021-12-24  7:32 ` [FFmpeg-devel] [PATCH] avcodec/vaapi_encode_vp9: fix > 4k encode fail issue Xiang, Haihao
@ 2021-12-24  8:19   ` lance.lmwang
  2021-12-24  8:34     ` Xiang, Haihao
  0 siblings, 1 reply; 3+ messages in thread
From: lance.lmwang @ 2021-12-24  8:19 UTC (permalink / raw)
  To: ffmpeg-devel

On Fri, Dec 24, 2021 at 07:32:28AM +0000, Xiang, Haihao wrote:
> On Mon, 2021-04-12 at 09:47 +0800, Zhang yuankun wrote:
> > This patch will fix following command:
> > ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i input.264 \
> > -vf 'scale_vaapi=w=7680:h=4096' -c:v vp9_vaapi output.ivf
> > 
> > Max width of a vp9 tile is 4096. If the source frame > 4096, we need split to
> > multiple tiles.
> > 
> > Signed-off-by: Zhang yuankun <yuankunx.zhang@intel.com>
> > ---
> >  libavcodec/vaapi_encode_vp9.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
> > index 0e1c52c92a..ed45cd6d03 100644
> > --- a/libavcodec/vaapi_encode_vp9.c
> > +++ b/libavcodec/vaapi_encode_vp9.c
> > @@ -31,6 +31,7 @@
> >  
> >  #define VP9_MAX_QUANT 255
> >  
> > +#define VP9_MAX_TILE_WIDTH 4096
> >  
> >  typedef struct VAAPIEncodeVP9Picture {
> >      int slot;
> > @@ -82,10 +83,17 @@ static int
> > vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx,
> >      VAAPIEncodeVP9Picture          *hpic = pic->priv_data;
> >      VAEncPictureParameterBufferVP9 *vpic = pic->codec_picture_params;
> >      int i;
> > +    int num_tile_columns;
> >  
> >      vpic->reconstructed_frame = pic->recon_surface;
> >      vpic->coded_buf = pic->output_buffer;
> >  
> > +    // Maximum width of a tile in units of superblocks is
> > MAX_TILE_WIDTH_B64(64)
> > +    // So the number of tile columns is related to the width of the picture.
> > +    // We set the minimum possible number for num_tile_columns as defualt

defualt -> default

> > value.
> > +    num_tile_columns = (vpic->frame_width_src + VP9_MAX_TILE_WIDTH - 1) /
> > VP9_MAX_TILE_WIDTH;
> > +    vpic->log2_tile_columns = num_tile_columns == 1 ? 0 :
> > av_log2(num_tile_columns - 1) + 1;
> > +
> >      switch (pic->type) {
> >      case PICTURE_TYPE_IDR:
> >          av_assert0(pic->nb_refs == 0);
> 
> LGTM, will apply
> 
> -Haihao
> 
> _______________________________________________
> 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".

-- 
Thanks,
Limin Wang
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/vaapi_encode_vp9: fix > 4k encode fail issue
  2021-12-24  8:19   ` lance.lmwang
@ 2021-12-24  8:34     ` Xiang, Haihao
  0 siblings, 0 replies; 3+ messages in thread
From: Xiang, Haihao @ 2021-12-24  8:34 UTC (permalink / raw)
  To: ffmpeg-devel

On Fri, 2021-12-24 at 16:19 +0800, lance.lmwang@gmail.com wrote:
> On Fri, Dec 24, 2021 at 07:32:28AM +0000, Xiang, Haihao wrote:
> > On Mon, 2021-04-12 at 09:47 +0800, Zhang yuankun wrote:
> > > This patch will fix following command:
> > > ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i input.264 \
> > > -vf 'scale_vaapi=w=7680:h=4096' -c:v vp9_vaapi output.ivf
> > > 
> > > Max width of a vp9 tile is 4096. If the source frame > 4096, we need split
> > > to
> > > multiple tiles.
> > > 
> > > Signed-off-by: Zhang yuankun <yuankunx.zhang@intel.com>
> > > ---
> > >  libavcodec/vaapi_encode_vp9.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > > diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
> > > index 0e1c52c92a..ed45cd6d03 100644
> > > --- a/libavcodec/vaapi_encode_vp9.c
> > > +++ b/libavcodec/vaapi_encode_vp9.c
> > > @@ -31,6 +31,7 @@
> > >  
> > >  #define VP9_MAX_QUANT 255
> > >  
> > > +#define VP9_MAX_TILE_WIDTH 4096
> > >  
> > >  typedef struct VAAPIEncodeVP9Picture {
> > >      int slot;
> > > @@ -82,10 +83,17 @@ static int
> > > vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx,
> > >      VAAPIEncodeVP9Picture          *hpic = pic->priv_data;
> > >      VAEncPictureParameterBufferVP9 *vpic = pic->codec_picture_params;
> > >      int i;
> > > +    int num_tile_columns;
> > >  
> > >      vpic->reconstructed_frame = pic->recon_surface;
> > >      vpic->coded_buf = pic->output_buffer;
> > >  
> > > +    // Maximum width of a tile in units of superblocks is
> > > MAX_TILE_WIDTH_B64(64)
> > > +    // So the number of tile columns is related to the width of the
> > > picture.
> > > +    // We set the minimum possible number for num_tile_columns as defualt
> 
> defualt -> default

Thanks, will fix this typo when pushing the patch. 

> 
> > > value.
> > > +    num_tile_columns = (vpic->frame_width_src + VP9_MAX_TILE_WIDTH - 1) /
> > > VP9_MAX_TILE_WIDTH;
> > > +    vpic->log2_tile_columns = num_tile_columns == 1 ? 0 :
> > > av_log2(num_tile_columns - 1) + 1;
> > > +
> > >      switch (pic->type) {
> > >      case PICTURE_TYPE_IDR:
> > >          av_assert0(pic->nb_refs == 0);
> > 
> > LGTM, will apply
> > 
> > -Haihao
> > 
> > _______________________________________________
> > 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".
> 
> 
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-24  8:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210412014724.18563-1-yuankunx.zhang@intel.com>
2021-12-24  7:32 ` [FFmpeg-devel] [PATCH] avcodec/vaapi_encode_vp9: fix > 4k encode fail issue Xiang, Haihao
2021-12-24  8:19   ` lance.lmwang
2021-12-24  8:34     ` Xiang, Haihao

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git