From patchwork Thu Jan 18 05:03:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 7318 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.78.2 with SMTP id r2csp6450489jaa; Wed, 17 Jan 2018 21:05:30 -0800 (PST) X-Google-Smtp-Source: ACJfBou5Lj+TWtWcLe5fqE1BugrU9XXbpdn79faLMAT5tapWRvA3MF5OjfgRefQZpRHpmNqKfnWN X-Received: by 10.28.22.200 with SMTP id 191mr4118385wmw.117.1516251930293; Wed, 17 Jan 2018 21:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516251930; cv=none; d=google.com; s=arc-20160816; b=otlU1EkV0UrLeMBoRFtLGmu6Lvdpt5hniJicyVcGn8eAiG2nBPaFB7fKWCZutmoJvk 9xAj9BZyrvOrg5fGnQoajcxk2HFhzMrWveWJK1URg+eTmOeVJmILvVkL3jmItAD1FoJX A7R+E24Tv/8w9ZK2oGPGSEHHUQXpc706vPu7GTeEc+GajeiqDfdiJ0OvUT+aBhSpCEnH enGreO50khsQvlqipL4hHipCg4reSGEaiS/5xWkDGDGiFM6m93Xi7JhupfVgjRHJmDJI tTX+B2IWvX2gwMzEMEhDhi1lzhoA11Jh9Z65n8tFzV6bWVOaNB28xJkFjGisrFCcojxQ HTFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=pwlQE74ItN6wI3tQN6iTUnOojVC0VtsuzEiCy3uS1+I=; b=dpLXHu/Nj+RY7ASoyqDv8JoJ9eyvVltQEKhF8YmF4kb2kmZ9NUdMTXhtsMh9gw5CSz Fg6WpIqrTYh4UjEcJhG3QyfrNWZ8N9gIvpV/bluLiUIKTl6h7Y+zxbgaaLQr4czpOcjF zQIrqOyQVcnsNDRi6n9t14SAE+JVzMID8p4DgIleiamndXye8qucv4Puq77hbUoKEBB7 iBVsznlcroMc9q1dthWT58gmXs/DlJsg1R8LVJq4L66gDK6zBTI64p54zw9agw5alFjm qMYMz1s3WjjFwjdsvrIBeuvRh3m2Hfkb4t5ZN+todMAd7dMBSaL7mt6h+MutC0qB/9co 35kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c2si5672895wrb.352.2018.01.17.21.05.29; Wed, 17 Jan 2018 21:05:30 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2B69468A11A; Thu, 18 Jan 2018 07:05:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 04A32689EDA for ; Thu, 18 Jan 2018 07:05:20 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2018 21:05:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,376,1511856000"; d="scan'208";a="11031530" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.13.18]) by orsmga008.jf.intel.com with ESMTP; 17 Jan 2018 21:05:15 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Jan 2018 13:03:33 +0800 Message-Id: <1516251814-6220-1-git-send-email-zhong.li@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH 1/2] lavc: Add coded_w/h to AVCodecParameters 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: Zhong Li MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" coded_width/height may be different from width/height sometimes (e.g, crop or lowres cases). ffprobe always show coded_width/height same as width/height since they are overwritten. This fixes tiket #6958. Signed-off-by: Zhong Li --- libavcodec/avcodec.h | 7 +++++++ libavcodec/utils.c | 4 ++++ libavcodec/version.h | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 8fbbc79..710e90c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3905,6 +3905,13 @@ typedef struct AVCodecParameters { int height; /** + * Video only. The dimensions of the coded video frame in pixels. + * + */ + int coded_width; + int coded_height; + + /** * Video only. The aspect ratio (width / height) which a single pixel * should have when displayed. * diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4c71843..427f612 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -2147,6 +2147,8 @@ int avcodec_parameters_from_context(AVCodecParameters *par, par->format = codec->pix_fmt; par->width = codec->width; par->height = codec->height; + par->coded_width = codec->coded_width; + par->coded_height = codec->coded_height; par->field_order = codec->field_order; par->color_range = codec->color_range; par->color_primaries = codec->color_primaries; @@ -2202,6 +2204,8 @@ int avcodec_parameters_to_context(AVCodecContext *codec, codec->pix_fmt = par->format; codec->width = par->width; codec->height = par->height; + codec->coded_width = par->coded_width; + codec->coded_height = par->coded_height; codec->field_order = par->field_order; codec->color_range = par->color_range; codec->color_primaries = par->color_primaries; diff --git a/libavcodec/version.h b/libavcodec/version.h index 47a15d5..ec536bf 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 9 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \