From patchwork Mon Sep 18 21:26:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 5186 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp3926169jaa; Mon, 18 Sep 2017 14:26:40 -0700 (PDT) X-Received: by 10.28.66.65 with SMTP id p62mr10180662wma.159.1505769999906; Mon, 18 Sep 2017 14:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505769999; cv=none; d=google.com; s=arc-20160816; b=0MQuLFCjxmcOCEMbvQpGgvcL+Hl1zxG1kbvJ3C2+d/Ez4Gs5wLJI5xD/uHA70MejL/ o1eE6H66XpfxXI4xJSO4UjCTvseHfQ0AA1hL3RQdT7uMVub/uwzq4W1EkE++tFlTT1O6 K6xUqCjGOk5u0qHznMv6HvWkRZjaohrUwLxmOR7BisbmF60y/zEGWHRuRMZkMLMv1q94 pgx7ICI1RKdgBNQgA6qOmbpGMvon++xIG0Njfum3DZ66nXh9RvV6eFSlwhGmvugvtxD5 SAI5H2Eb/qiLc+onmt+RWlbfLaFrYxT6h3bHMGth+qfL2EXXwxwkgd1RBINsuqEzRelP UBwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to :arc-authentication-results; bh=cYd/OwG+eaQ3XGpiMBsqAdGsTyvLDUxm4ByiPfPakec=; b=h+QR3UdUCgxNMUN12LvkTK7Fnyl6pB1l4jRSzGWTWQYnlMbueuuOWU0VzAkAuVCH1F 67fJQvQvfzuakp7Wv7AY1Uwm7ukpAPp4Ayw6YbgaB7X34BRVxwCVtPf57KeRd9NQsWjS g4poS7lpHsrqYf3G6zAyDAqtFKvgflIe8rpDM1I9zien+ulKfKjULVds1qfIuctgdc9l xuN5WjHbxe3mOoLifjUUvLrAgVV+vxix9nwX3BEXoZ1p+zLEedAp9CQbNwXKYUzSdW8H IfBIR71BXEp2whPRcv6P43abUmPy2Fjcu+mss+EvhVZI3IHoiEoGPoxuDVpREoItOWvg l7QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=qnEbyMPL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o90si6619566wrc.522.2017.09.18.14.26.38; Mon, 18 Sep 2017 14:26:39 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=qnEbyMPL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9C7696805F5; Tue, 19 Sep 2017 00:26:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7704E680598 for ; Tue, 19 Sep 2017 00:26:23 +0300 (EEST) Received: by mail-it0-f50.google.com with SMTP id d123so128263ith.3 for ; Mon, 18 Sep 2017 14:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+JYd2KUb9CgGmq9m2HIyRz90ZlEXAP4mmXiYkb96/r8=; b=qnEbyMPLnP2JO6XFq3pMFiG6XVHvqu7CkYjo45tkCSIjQVahStRWDckb1G1pkop+LW vd1x3eB7zomM4CEV3Ec7wlOudqpNeS3WPrFxsmMYaQmV4IRe9Bwm2CqSVyxUt8kAqmMI hMW94Df72I3NzDn8yBojQCtS/ZxL8VaOcMg5UbmSeHcrbbl7ioOl3y2++Iin/CEaNCgF Z5dpSi7BrWj8OBwhIuC5tuJ6L/gmgHje27U9LuZnFOcqSYYwIsAPQuS5n0seM546b2Gd TmLgPybcYXa6v2dJqhWu3LphS3/cp6UezZJzLJSSMhdqTj9ejnC5qsQjUSxE9jPEahLV Xj/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+JYd2KUb9CgGmq9m2HIyRz90ZlEXAP4mmXiYkb96/r8=; b=ojp7ZMf1QDjBuVzJkSQN96a+ge9rf2SrXaB6CRnBPPN6X0vBwUPFo0ZvlNuCQYfAlQ joDOA1hfMZLVhx8hQXTqOKSOXtUPrJYeVbbfO18llhXuGPfQP2wgBPRPneZfVbnJeXSz iOz0iPXfN5Ax4z/rfo9r/VcT1gTNnB/iE1nik5pVzu1HjdsZlyBqz+/2zuU5DngTCT4+ z2EbUg4TdXXM9bOT1jQCNJRvUNQ8E/wNGfZEseKTEmUl/TIak1iH55cqb4h67rr6puin wbtphObp8j6s3oGZzIk2t7X16SirCAYiiz+zqNeCFNByoTq1PFIR7Adew+uSCLMOcUX3 lOpg== X-Gm-Message-State: AHPjjUhq8WVyQSOsz0amHgVzcOGZFVfhVn7VBELRRh9bW03UmI3x1GcW /uoI7jZvSHmr6CdQmK1h6Qqnd//DdyOP7iH57R4= X-Google-Smtp-Source: AOwi7QB6Usz3F1YXBs7BcyfUPBUzYmI6F/gsDzOeUB37geaN2MdncLQ3aYrG+EILsXboLNnWDxghvpeHyQ5yx9bLKSc= X-Received: by 10.36.172.88 with SMTP id m24mr18221760iti.134.1505769990818; Mon, 18 Sep 2017 14:26:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.139.4 with HTTP; Mon, 18 Sep 2017 14:26:10 -0700 (PDT) From: Carl Eugen Hoyos Date: Mon, 18 Sep 2017 23:26:10 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavfi/stereo3d: Set SAR for every output frame 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" Hi! Attached patch fixes ticket #6672. Please comment, Carl Eugen From c4d3ba1d69e7dd7a60ea7150eb1fc545a86697fe Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 18 Sep 2017 23:10:06 +0200 Subject: [PATCH] lavfi/stereo3d: Set SAR for every output frame. Fixes ticket #6672. --- libavfilter/vf_stereo3d.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c index 3e23890..8b22f88 100644 --- a/libavfilter/vf_stereo3d.c +++ b/libavfilter/vf_stereo3d.c @@ -150,6 +150,7 @@ typedef struct Stereo3DContext { AVFrame *prev; int blanks; int in_off_left[4], in_off_right[4]; + AVRational aspect; Stereo3DDSPContext dsp; } Stereo3DContext; @@ -359,11 +360,11 @@ static int config_output(AVFilterLink *outlink) AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; Stereo3DContext *s = ctx->priv; - AVRational aspect = inlink->sample_aspect_ratio; AVRational fps = inlink->frame_rate; AVRational tb = inlink->time_base; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format); int ret; + s->aspect = inlink->sample_aspect_ratio; switch (s->in.format) { case INTERLEAVE_COLS_LR: @@ -404,25 +405,25 @@ static int config_output(AVFilterLink *outlink) switch (s->in.format) { case SIDE_BY_SIDE_2_LR: - aspect.num *= 2; + s->aspect.num *= 2; case SIDE_BY_SIDE_LR: s->width = inlink->w / 2; s->in.off_right = s->width; break; case SIDE_BY_SIDE_2_RL: - aspect.num *= 2; + s->aspect.num *= 2; case SIDE_BY_SIDE_RL: s->width = inlink->w / 2; s->in.off_left = s->width; break; case ABOVE_BELOW_2_LR: - aspect.den *= 2; + s->aspect.den *= 2; case ABOVE_BELOW_LR: s->in.row_right = s->height = inlink->h / 2; break; case ABOVE_BELOW_2_RL: - aspect.den *= 2; + s->aspect.den *= 2; case ABOVE_BELOW_RL: s->in.row_left = s->height = inlink->h / 2; @@ -486,19 +487,19 @@ static int config_output(AVFilterLink *outlink) break; } case SIDE_BY_SIDE_2_LR: - aspect.den *= 2; + s->aspect.den *= 2; case SIDE_BY_SIDE_LR: s->out.width = s->width * 2; s->out.off_right = s->width; break; case SIDE_BY_SIDE_2_RL: - aspect.den *= 2; + s->aspect.den *= 2; case SIDE_BY_SIDE_RL: s->out.width = s->width * 2; s->out.off_left = s->width; break; case ABOVE_BELOW_2_LR: - aspect.num *= 2; + s->aspect.num *= 2; case ABOVE_BELOW_LR: s->out.height = s->height * 2; s->out.row_right = s->height; @@ -514,7 +515,7 @@ static int config_output(AVFilterLink *outlink) s->out.row_right = s->height + s->blanks; break; case ABOVE_BELOW_2_RL: - aspect.num *= 2; + s->aspect.num *= 2; case ABOVE_BELOW_RL: s->out.height = s->height * 2; s->out.row_left = s->height; @@ -576,7 +577,7 @@ static int config_output(AVFilterLink *outlink) outlink->h = s->out.height; outlink->frame_rate = fps; outlink->time_base = tb; - outlink->sample_aspect_ratio = aspect; + outlink->sample_aspect_ratio = s->aspect; if ((ret = av_image_fill_linesizes(s->linesize, outlink->format, s->width)) < 0) return ret; @@ -1075,6 +1076,7 @@ copy: av_frame_free(&s->prev); av_frame_free(&inpicref); } + out->sample_aspect_ratio = s->aspect; return ff_filter_frame(outlink, out); } -- 1.7.10.4