From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 0C2464092A for ; Fri, 24 Dec 2021 08:19:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C67D68B279; Fri, 24 Dec 2021 10:19:15 +0200 (EET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 795E668B21B for ; Fri, 24 Dec 2021 10:19:08 +0200 (EET) Received: by mail-pf1-f180.google.com with SMTP id c2so7290496pfc.1 for ; Fri, 24 Dec 2021 00:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=5uTV5Q2onxHAi15SeToBHfMNiy5mTBvH0GN1TgrOxHA=; b=du+6ValBX6rg/nWLHM5vSeKEEZOL6afPz+c40sybjjnF8LcwSIagByQZlRzFsyJjdC J+joB76fv9rkBpNd/cQwOVLfd7c2eO6FDX+0yEFmOKoHvoj/MWFx7uouzwkKpix2F/Os SnXZ0w8AY84YknQzgRqKegbZoKr/cUlI88pb4YhmqPxWUAZm3eNRdN6rnbxLHk4eWa9q voizu80mp49bcfke2evWh1/sxcYkcStYfdMElpnkgEBqmT78dR5F40OcHD1c9uQzeX9i Gmv/koxK/ef7PqptOf+xLimO2fG70ga0ZLDISVe1tCKABfmEe0Rkap49m/I9nMmAc8O5 9cJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=5uTV5Q2onxHAi15SeToBHfMNiy5mTBvH0GN1TgrOxHA=; b=qsxwsmO8vr/54luP3NIG/kYOHHxK9wgiIzbQ5vDVZfHHCr7ElqC+ArMJrnCik6eOS4 pl4mHDSvkmQfxcd/SEbOvvFbIwCrom/A/jrPAZqhf/aWqEyYILFTN2jrGaxN5Cw+NsCr iRfTPqfUBNES8qGnWr2RMhcQJD8q5C5b0HsCXAap59tCgBOlIWs3bR3S/Z2xuIqWBcLy pePkJSJEJUMdBj+0LyebmckLipOklAd8PFTQxnWN5rW5LkOrmE5ZjIP3UJCK8wWpxItl LBHwembhyBzIlxIOLd8Sv+49YDsu53/7hK4yQYX4NuglD/gXgc8NRHlnY9EMIaA1RFFb pc1w== X-Gm-Message-State: AOAM533U6F+KtsmZlZGWjPxTMtv4K7yn67Gxp3Qe4jStloBCWkJpckyp H5g+SNIIyWKEPSAhxAFC2uEBuHi2iJU= X-Google-Smtp-Source: ABdhPJwjy9G89z65WeUFdg8hHh3Y2ZhTnq4SQ/WYJQZg28efp7bs/Wesh39Tz2JKQb2UAiY5qWJx0g== X-Received: by 2002:a65:6a0a:: with SMTP id m10mr5191540pgu.82.1640333946572; Fri, 24 Dec 2021 00:19:06 -0800 (PST) Received: from gmail.com ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id oo13sm8386511pjb.25.2021.12.24.00.19.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Dec 2021 00:19:06 -0800 (PST) Date: Fri, 24 Dec 2021 16:19:03 +0800 From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Message-ID: <20211224081903.GB29574@gmail.com> Mail-Followup-To: ffmpeg-devel@ffmpeg.org References: <20210412014724.18563-1-yuankunx.zhang@intel.com> <500807a72989ce22e8e1e2d9602f3c11787dbfb4.camel@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <500807a72989ce22e8e1e2d9602f3c11787dbfb4.camel@intel.com> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/vaapi_encode_vp9: fix > 4k encode fail issue X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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 > > --- > > 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".