From patchwork Mon Jun 26 15:12:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4125 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp975494vsb; Mon, 26 Jun 2017 08:21:30 -0700 (PDT) X-Received: by 10.28.30.3 with SMTP id e3mr73187wme.60.1498490490097; Mon, 26 Jun 2017 08:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498490490; cv=none; d=google.com; s=arc-20160816; b=bmmYEbbWtFrNt9w+jBY6WhuEPw64hyjLu4t6oKaeSz+Dydnh+mkwgE4CYgjKzbn9D2 Lqqta85khJdA82TcSeuTR/vQzEbkD/ek7DEiw2HWNjrLyXzfgLhqO1FUrABS62IIpmQT fL6ttCeYZZzRhqLJ+cmuPFNR8+5JFjwjLcSkE1EdYxwBBVL5iyjG1dK03cSzmsaR4b6G NU3iGUuNJZ23A0LVz+u6fGqx9ZtBIivxo2ZQS6syt1GlB8BDZuMiq/eLQsJFnStQWPUm d2UeAiLlAZs8RtdCbRrocenqLTO4lE/Hd1jk8ROyDGfZ0SZtv8ysYY9nKswiWdWa2j0a vo0w== 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: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=QlwnrOAvN4U0gN9XuEDp9yNf+LUtfuJxTT6ErXyGzOI=; b=XkWDz2oRk1TkkRrT3vU0FIHsSHFUpzi6C5u7cJjrMMoGkyTLqxdQBJLfSn5yEzyQSz c7U+vKiB2yNLSEgpaojKdeKZlei3V/9Wr3RIRaQD8MqTISaMw/fN/18dA4suY80PTZPb aAIBkVa8CzjpNxDGbfXI0ztuiDfPnVjzTKLdjH6rBX/o50nUEDxqcf7Hqufxxj6AF2vN ouHwn5fBF4bnnsBQhTxdRUpbHw6vJ11Fv2o0orz8sbgnF+IfxRsuAEiTfIaCaYhcypWL BnlieIsxO+ZwrdqELwEjM3Su6U9WvdVu9WAIgvn65/2dCkyDzHZ9Lb7hzumVT/4Y87W7 f1yA== 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 2si12401374wri.139.2017.06.26.08.21.29; Mon, 26 Jun 2017 08:21:30 -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; 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 F158368A31C; Mon, 26 Jun 2017 18:21:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-3.mx.upcmail.net (vie01a-qmta-pe01-3.mx.upcmail.net [62.179.121.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 05AF368A2C9 for ; Mon, 26 Jun 2017 18:21:20 +0300 (EEST) Received: from [172.31.218.49] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dPVpI-0006xH-Oq for ffmpeg-devel@ffmpeg.org; Mon, 26 Jun 2017 17:21:20 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dPVpD-00040x-0B for ffmpeg-devel@ffmpeg.org; Mon, 26 Jun 2017 17:21:15 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id dTCp1v01k0S5wYM01TCq5N; Mon, 26 Jun 2017 17:12:50 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 26 Jun 2017 17:12:49 +0200 Message-Id: <20170626151249.1346-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/ffv1enc: Allow less than 2 rows of slices for low vertical resolution 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" Fixes: Ticket5548 Signed-off-by: Michael Niedermayer --- libavcodec/ffv1enc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index e59d540737..39b52d5a48 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -850,6 +850,10 @@ FF_ENABLE_DEPRECATION_WARNINGS if (s->version > 1) { int plane_count = 1 + 2*s->chroma_planes + s->transparency; s->num_v_slices = (avctx->width > 352 || avctx->height > 288 || !avctx->slices) ? 2 : 1; + + if (avctx->height < 5) + s->num_v_slices = 1; + for (; s->num_v_slices < 32; s->num_v_slices++) { for (s->num_h_slices = s->num_v_slices; s->num_h_slices < 2*s->num_v_slices; s->num_h_slices++) { int maxw = (avctx->width + s->num_h_slices - 1) / s->num_h_slices;