From patchwork Fri Feb 14 03:32:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 17781 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 85BBC44A76F for ; Fri, 14 Feb 2020 05:41:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5D41668A1C3; Fri, 14 Feb 2020 05:41:21 +0200 (EET) 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 89CAC688390 for ; Fri, 14 Feb 2020 05:41:14 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2020 19:41:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,439,1574150400"; d="scan'208";a="406867908" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.13.25]) by orsmga005.jf.intel.com with ESMTP; 13 Feb 2020 19:41:11 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 Feb 2020 11:32:05 +0800 Message-Id: <1581651125-25232-1-git-send-email-yejun.guo@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi 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 Cc: yejun.guo@intel.com MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" For some cases, the regions of interest do not change, it is not convenient to always prepare the roi data for every frame. So, add use_last_roi to show it uses the same roi data as last frame. Since a new flag is added into AVFrame, the major version number of lavu is changed. Signed-off-by: Guo, Yejun --- doc/APIchanges | 3 +++ libavutil/frame.h | 8 ++++++++ libavutil/version.h | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 761f37f..eec0f2f 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2020-02-14 - xxxxxxxxxx - lavu 57.0.100 - frame.h + Add use_last_roi in AVFrame. + 2020-02-13 - xxxxxxxxxx - lavu 56.41.100 - tx.h Add AV_TX_INT32_FFT and AV_TX_INT32_MDCT diff --git a/libavutil/frame.h b/libavutil/frame.h index b5afb58..2c786f4 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -634,6 +634,14 @@ typedef struct AVFrame { AVBufferRef *hw_frames_ctx; /** + * It is set if the RegionOfInterest info is the same as last frame, + * so, we don't need to prepare the same thing in side_data. + * If there is roi info in side_data and this variable is also set, + * use the info in side_data. + */ + int8_t use_last_roi; + + /** * AVBufferRef for free use by the API user. FFmpeg will never check the * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when * the frame is unreferenced. av_frame_copy_props() calls create a new diff --git a/libavutil/version.h b/libavutil/version.h index 90cc55b..aade19b 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -78,8 +78,8 @@ * @{ */ -#define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 41 +#define LIBAVUTIL_VERSION_MAJOR 57 +#define LIBAVUTIL_VERSION_MINOR 0 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -106,28 +106,28 @@ */ #ifndef FF_API_VAAPI -#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 58) #endif #ifndef FF_API_FRAME_QP -#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 58) #endif #ifndef FF_API_PLUS1_MINUS1 -#define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 58) #endif #ifndef FF_API_ERROR_FRAME -#define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 58) #endif #ifndef FF_API_PKT_PTS -#define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 58) #endif #ifndef FF_API_CRYPTO_SIZE_T -#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 58) #endif #ifndef FF_API_FRAME_GET_SET -#define FF_API_FRAME_GET_SET (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_FRAME_GET_SET (LIBAVUTIL_VERSION_MAJOR < 58) #endif #ifndef FF_API_PSEUDOPAL -#define FF_API_PSEUDOPAL (LIBAVUTIL_VERSION_MAJOR < 57) +#define FF_API_PSEUDOPAL (LIBAVUTIL_VERSION_MAJOR < 58) #endif