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 A9AF5423D5 for ; Mon, 17 Jan 2022 12:12:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0814268AFC0; Mon, 17 Jan 2022 14:12:48 +0200 (EET) Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F36B568AE9A for ; Mon, 17 Jan 2022 14:12:41 +0200 (EET) Received: by mail-oi1-f172.google.com with SMTP id bf5so896364oib.4 for ; Mon, 17 Jan 2022 04:12:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=pJZt5MylpjlaTrAsg2ao8tXP6cp7j0H+D77xdDLTgM8=; b=Z4gmDacMdKBFAWx4iUwXnelu0ANmwGlQ/E9qJpFvPH98s/7Vnf830UVUi8hOMeKRtV Rx7hjPLBppx+vJFQ5I0avWRXZnNfa7Yi3HyFPDaz6x2oyVFtQWZvURjYcG6d4BUh7KyP ewY/5S3cckCG8xjl3TFZRxMULS0mTR9tHIQLeX+uv9D8MkY7JFRNzKBzuRoPkaKOjay2 wodhnmlZjbU3uamqhrPb3aVckOkab5P+ouospyO3/36hr8SAAcXtPrgppgrzlj2v1xgl QTLfL4i+iluYP9uII+ZIMgNkMHIoY9AIg+dVZplXbsJKOe4dhxTa1ZMwLrKE49Am4X0A hTdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=pJZt5MylpjlaTrAsg2ao8tXP6cp7j0H+D77xdDLTgM8=; b=Lmn1GP9TJ25N3irMn0W0MY6MGmbb3JmjTv2sZ4m2/q1w6JA4dse3W0osfv5MilxvEE rY6AlXVVKITxwzCihNyELSuZrM8QGC4M9CDaREDsjM3BD74MoPFC1uiDMa7fv49TA/v+ QaVUsinsqywFYuqbvE6NY6ieCxS9HdsXA80hp979m/6u/b75ehK/X7YQDzyqw0u4XCEn d3wVq1Xixfl3dVl5+vP1CD9zD22B7aXtWB3kE3562N0gwwGRtB++gmSnfBCxPnQQuDCS e1DlyHJnhNSHsWQaaa5nQ2JZOyjFunYfTIcXDN2GRqGvNxBxTb3vjk9tTmkWwzZM+4nH pcqQ== X-Gm-Message-State: AOAM532p9P2XPOgu0/FZP9iOQm/lDiQzyP/SLqVVfcfwLeuhDeAoTwIG TPum7aJQyOuZiWKVw9UTzFWpKPj5ya8= X-Google-Smtp-Source: ABdhPJxGFvm20IC+BYtiSsfJa1NtmBNgrq8DsZrWB4FnENOY6om14ppEWOVvb6sMdE+jMl7hGKJntQ== X-Received: by 2002:aca:b103:: with SMTP id a3mr21956072oif.14.1642421559665; Mon, 17 Jan 2022 04:12:39 -0800 (PST) Received: from [192.168.0.13] ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id l21sm2373558otd.20.2022.01.17.04.12.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jan 2022 04:12:39 -0800 (PST) Message-ID: <1c674eab-97ba-b054-f12b-4bf6ad091cc9@gmail.com> Date: Mon, 17 Jan 2022 09:12:35 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220113054525.14057-1-haihao.xiang@intel.com> <2de74c97e30007697825af8d68df3fdf5270350c.camel@intel.com> From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v2] lavc/qsvenc: add tile encoding support for VP9 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 1/17/2022 7:57 AM, Soft Works wrote: > > >> -----Original Message----- >> From: ffmpeg-devel On Behalf Of >> mypopy@gmail.com >> Sent: Monday, January 17, 2022 11:36 AM >> To: FFmpeg development discussions and patches >> Subject: Re: [FFmpeg-devel] [PATCH v2] lavc/qsvenc: add tile encoding support >> for VP9 >> >> On Mon, Jan 17, 2022 at 4:30 PM Xiang, Haihao >> wrote: >>> >>> On Thu, 2022-01-13 at 13:45 +0800, Haihao Xiang wrote: >>>> Add -tile_rows and -tile_cols options to specify the number of tile >>>> rows and columns >>>> >>>> Signed-off-by: Haihao Xiang >>>> --- >>>> v2: add option descriptions in the doc >>>> >>>> doc/encoders.texi | 6 ++++++ >>>> libavcodec/qsvenc.c | 4 ++++ >>>> libavcodec/qsvenc.h | 1 + >>>> libavcodec/qsvenc_vp9.c | 10 ++++++++++ >>>> 4 files changed, 21 insertions(+) >>>> >>>> diff --git a/doc/encoders.texi b/doc/encoders.texi >>>> index 7cc8be1209..a4176089d5 100644 >>>> --- a/doc/encoders.texi >>>> +++ b/doc/encoders.texi >>>> @@ -3457,6 +3457,12 @@ These options are used by vp9_qsv >>>> @item profile2 >>>> @item profile3 >>>> @end table >>>> + >>>> +@item @var{tile_cols} >>>> +Number of columns for tiled encoding (requires libmfx >= 1.29). >>>> + >>>> +@item @var{tile_rows} >>>> +Number of rows for tiled encoding (requires libmfx >= 1.29). >>>> @end table >>>> >>>> @section snow >>>> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c >>>> index 4e7a15f060..4cbc9ff4dc 100644 >>>> --- a/libavcodec/qsvenc.c >>>> +++ b/libavcodec/qsvenc.c >>>> @@ -939,6 +939,10 @@ static int init_video_param(AVCodecContext *avctx, >>>> QSVEncContext *q) >>>> q->extvp9param.Header.BufferId = MFX_EXTBUFF_VP9_PARAM; >>>> q->extvp9param.Header.BufferSz = sizeof(q->extvp9param); >>>> q->extvp9param.WriteIVFHeaders = MFX_CODINGOPTION_OFF; >>>> +#if QSV_HAVE_EXT_VP9_TILES >>>> + q->extvp9param.NumTileColumns = q->tile_cols; >>>> + q->extvp9param.NumTileRows = q->tile_rows; >>>> +#endif >>>> q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer >> *)&q- >>>>> extvp9param; >>>> } >>>> #endif >>>> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h >>>> index 31516b8e55..00ee52a5d1 100644 >>>> --- a/libavcodec/qsvenc.h >>>> +++ b/libavcodec/qsvenc.h >>>> @@ -41,6 +41,7 @@ >>>> >>>> #define QSV_HAVE_EXT_HEVC_TILES QSV_VERSION_ATLEAST(1, 13) >>>> #define QSV_HAVE_EXT_VP9_PARAM QSV_VERSION_ATLEAST(1, 26) >>>> +#define QSV_HAVE_EXT_VP9_TILES QSV_VERSION_ATLEAST(1, 29) >>>> >>>> #define QSV_HAVE_TRELLIS QSV_VERSION_ATLEAST(1, 8) >>>> #define QSV_HAVE_MAX_SLICE_SIZE QSV_VERSION_ATLEAST(1, 9) >>>> diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c >>>> index 9329990d11..1168ddda0e 100644 >>>> --- a/libavcodec/qsvenc_vp9.c >>>> +++ b/libavcodec/qsvenc_vp9.c >>>> @@ -73,6 +73,16 @@ static const AVOption options[] = { >>>> { "profile2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 >> = >>>> MFX_PROFILE_VP9_2 }, INT_MIN, INT_MAX, VE, "profile" }, >>>> { "profile3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 >> = >>>> MFX_PROFILE_VP9_3 }, INT_MIN, INT_MAX, VE, "profile" }, >>>> >>>> +#if QSV_HAVE_EXT_VP9_TILES >>>> + /* The minimum tile width in luma pixels is 256, set maximum >> tile_cols to >>>> 32 for 8K video */ >>>> + { "tile_cols", "Number of columns for tiled >>>> encoding", OFFSET(qsv.tile_cols), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, >> 32, >>>> VE }, >>>> + /* Set maximum tile_rows to 4 per VP9 spec */ >>>> + { "tile_rows", "Number of rows for tiled >>>> encoding", OFFSET(qsv.tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, >> 0, 4, >>>> VE }, >>>> +#else >>>> + { "tile_cols", "(not >>>> supported)", OFFSET(qsv.tile_cols), >> AV_OPT_TYPE_INT, >>>> { .i64 = 0 }, 0, 0, VE }, >>>> + { "tile_rows", "(not >>>> supported)", OFFSET(qsv.tile_rows), >> AV_OPT_TYPE_INT, >>>> { .i64 = 0 }, 0, 0, VE }, >>>> +#endif >>>> + >> perfer one option like "-tile rows x cols" than two options like > > The example is invalid. (spaces) > >> "-tile_rows row -tile_cols col" > > This way, the options are typed, have min, max and default values, > without needing any code to write and maintain. > > if you mean "-tile rowsxcols", there's no option type for this, > unless you would want to mis-use the video size type for it. > Otherwise you'd need to make it string and write all the parsing > and checking code for it. We already have code for this. see libaomenc. > Do you think that it would be worth the effort? > > Also, in most use cases, you will probably have rows or cols, > rather than both.. > > sw > > > _______________________________________________ > 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".