From patchwork Tue Jan 29 10:14:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 11909 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 CB2E444D98A for ; Tue, 29 Jan 2019 04:23:15 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EAF0268AD82; Tue, 29 Jan 2019 04:23:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 214B968AB9E for ; Tue, 29 Jan 2019 04:22:56 +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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2019 18:23:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,535,1539673200"; d="scan'208";a="295232490" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.13.25]) by orsmga005.jf.intel.com with ESMTP; 28 Jan 2019 18:23:14 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Tue, 29 Jan 2019 18:14:31 +0800 Message-Id: <1548756871-6918-1-git-send-email-yejun.guo@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH] avcodec/libx264: update notes to explain the scale chosen for ROI encoding 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Guo, Yejun --- libavcodec/libx264.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index a3493f3..8c96728 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -383,7 +383,9 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, qoffset = roi->qoffset.num * 1.0f / roi->qoffset.den; qoffset = av_clipf(qoffset, -1.0f, 1.0f); - // 25 is a number that I think it is a possible proper scale value. + /* qp range of x264 is from 0 to 51, just choose 25 as the scale value, + * so the range of final qoffset is [-25.0, 25.0]. + */ qoffset = qoffset * 25; for (int y = starty; y < endy; y++) {