From patchwork Thu Apr 11 08:37:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zachary Zhou X-Patchwork-Id: 12699 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 77EC2448F0C for ; Thu, 11 Apr 2019 11:37:31 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5439B68ACD6; Thu, 11 Apr 2019 11:37:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 33FB168AC56 for ; Thu, 11 Apr 2019 11:37:23 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 01:37:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="222518807" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 11 Apr 2019 01:37:22 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 11 Apr 2019 01:37:19 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 11 Apr 2019 01:37:19 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.92]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.147]) with mapi id 14.03.0415.000; Thu, 11 Apr 2019 16:37:17 +0800 From: "Zhou, Zachary" To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH RFC v2 2/3] libavcodec: Add thumbnail output to vaapi_h264 decoder Thread-Index: AQHU7eiua+kqdtmzXUqY3DIGj+yLl6Yz5OEAgAC7h4D//4PWgIACgHzA Date: Thu, 11 Apr 2019 08:37:16 +0000 Message-ID: <3257FB79429C93418DB5AB36198F40D6253AEF6E@SHSMSX104.ccr.corp.intel.com> References: <20190408085334.23947-1-zachary.zhou@intel.com> <20190408085334.23947-2-zachary.zhou@intel.com> <3257FB79429C93418DB5AB36198F40D6253AE784@SHSMSX104.ccr.corp.intel.com> <7D9B0A5171224A4A9A6308992BC4469B4189E7A1@shsmsx102.ccr.corp.intel.com> In-Reply-To: <7D9B0A5171224A4A9A6308992BC4469B4189E7A1@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWQ5NzAyM2QtYTE0OC00Mjc0LWJhMmItMjNiNzU1NGIwYzRmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVDdjSWVWK0ZVT2VqXC9uOU5zbjlhM1V6MGhJcG01UEc1cUlsSmgrbWRWYUxKOFwveU5pUjZ3dGR3XC9sQm5ZY05iMyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH RFC v2 2/3] libavcodec: Add thumbnail output to vaapi_h264 decoder X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" > -----Original Message----- > From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of > Li, Zhong > Sent: Wednesday, April 10, 2019 10:14 AM > To: FFmpeg development discussions and patches > Subject: Re: [FFmpeg-devel] [PATCH RFC v2 2/3] libavcodec: Add thumbnail > output to vaapi_h264 decoder > > > As my investigation - > > - This feature can save some power and memory bandwidth. > > - This feature can save the ffmpeg filters code writing for end user. > > it also support ARGB output for some AI use case, I think some AI > > cases may need ARGB input. > > IIUC, vaapi SFC scaling in libavfilter path should can support ARGB output too, > am I wrong? Thanks Zhong, ffmpeg should can do it. but iHD driver has an issue - https://github.com/intel/media-driver/issues/500 and I think ffmpeg may do following changes or iHD support ARGB in vaPutimage and vaGetImage. -Zach > > _______________________________________________ > 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 --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index e60a8f4d34..caa6d02b15 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -855,7 +855,7 @@ static int vaapi_map_frame(AVHWFramesContext *hwfc, // assume for now that the user is not aware of that and would therefore // prefer not to be given direct-mapped memory if they request read access. if (ctx->derive_works && dst->format == hwfc->sw_format && - ((flags & AV_HWFRAME_MAP_DIRECT) || !(flags & AV_HWFRAME_MAP_READ))) { + ((flags & AV_HWFRAME_MAP_DIRECT) || (flags & AV_HWFRAME_MAP_READ))) { vas = vaDeriveImage(hwctx->display, surface_id, &map->image); if (vas != VA_STATUS_SUCCESS) { av_log(hwfc, AV_LOG_ERROR, "Failed to derive image from "