From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AFFDB438D2 for ; Tue, 1 Nov 2022 10:15:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 99B4668BE56; Tue, 1 Nov 2022 12:15:17 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E5C3368BD5B for ; Tue, 1 Nov 2022 12:15:11 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id A8927240499 for ; Tue, 1 Nov 2022 11:15:11 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id dfxm0xIbIhIm for ; Tue, 1 Nov 2022 11:15:11 +0100 (CET) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id ED3A92400F5 for ; Tue, 1 Nov 2022 11:15:10 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 92F021601B2; Tue, 1 Nov 2022 11:15:10 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <166721993346.12287.10742392140936295449@lain.khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Tue, 01 Nov 2022 11:15:10 +0100 Message-ID: <166729771056.20155.6333231353822077707@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [RFC]lavc/tiff: Support dng cropping X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Carl Eugen Hoyos (2022-11-01 03:08:36) > Am Mo., 31. Okt. 2022 um 13:39 Uhr schrieb Anton Khirnov : > > > > Quoting Carl Eugen Hoyos (2022-10-23 20:46:57) > > > Am So., 23. Okt. 2022 um 16:35 Uhr schrieb Carl Eugen Hoyos > > > : > > > > > > > > Hi! > > > > > > > > I tried to implement dng cropping, it unfortunately can only work with > > > > -flags +unaligned, is there an alternative to simply print a warning > > > > if the flag was not supplied? > > > > > > New patch with more parentheses attached. > > > > > > Please comment, Carl Eugen > > > > > > From 1bfe065564604659b7703e75b1bb750c031fdc81 Mon Sep 17 00:00:00 2001 > > > From: Carl Eugen Hoyos > > > Date: Sun, 23 Oct 2022 16:31:53 +0200 > > > Subject: [PATCH] lavc/tiff: Support dng cropping, > > > > A FATE test would be nice. > > The samples are big but will look into this once the patch is ok. > > > > needs -flags +unaligned > > > > AFAICT this is not entirely correct. Applying left cropping in > > libavcodec might need AV_CODEC_FLAG_UNALIGNED, but not always. > > Of course, but evidence indicates that in nearly all cases, it is needed. > > > Users may also set apply_cropping=0 and apply cropping themselves. > > It should be possible to check this. > > > The decoder should not care about it in any case, since it's handled in > > the generic code. > > Could you elaborate? > The reason I added this check (and I would love to see that it is not > necessary) is that there is no (working) generic code afaict and that > decoding just breaks without a useful hint if the check is removed. The generic code I'm talking about is apply_cropping() in libavcodec/decode.c. If you want to add a warning, it should live there and be added in a separate patch. Note how no other decoder has such a warning internally, even though they set crop_left. What will be slightly nontrivial is detecting when the warning is appropriate, i.e. when av_frame_apply_croppying() is unable to apply the cropping fully. What I'd do is change av_frame_apply_croppying() to return 1 in such a case (it is currently documented to return >= 0, so this is backwards compatible). -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".