Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Jeffrey Chapuis <ashyni1987@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avfilter/vf_cropdetect: add ability to change limit/reset at runtime
Date: Thu, 19 Jan 2023 13:11:25 +0100
Message-ID: <34c27bec-ba11-f58e-565b-b6522b95cc76@gmail.com> (raw)
In-Reply-To: <CAPYw7P6TmmF2-xWHQBpnHdCJWEYmfdvP0K4LTQs3KaXOvQSN5g@mail.gmail.com>

On 17/01/2023 19:11, Paul B Mahol wrote:
> On 1/17/23, Jeffrey Chapuis <ashyni1987@gmail.com> wrote:
>> I'm getting there, don't give up on me.
>>
>> Now 'limit_upscaled' become the variable used in filter_frame() and
>> 'limit' is never change, unless by user
>> We only have to update 'limit_upscaled' if 'limit' really changes.
> 
> probably ok

>-    if (s->limit < 1.0)
>-        s->limit *= (1 << desc->comp[0].depth) - 1;
>+    s->bitdepth = desc->comp[0].depth;
>+    s->limit_upscaled = s->limit;
>+    if (s->limit_upscaled < 1.0)
>+        s->limit_upscaled *= (1 << s->bitdepth) - 1;

Is it better like this? we avoid a double assignment.

-    if (s->limit < 1.0)
-        s->limit *= (1 << desc->comp[0].depth) - 1;
+    s->bitdepth = desc->comp[0].depth;
+
+    if (s->limit_upscaled < 1.0)
+        s->limit_upscaled = s->limit * (1 << s->bitdepth) - 1;
+    else
+        s->limit_upscaled = s->limit;

The full patch without this change is in the previous reply
(https://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/305806.html),
let me know if there is other change to make with formatting/renaming.
I really appreciate your patience with this patch.
_______________________________________________
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".

  parent reply	other threads:[~2023-01-19 12:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 13:15 Jeffrey CHAPUIS
2023-01-10 15:45 ` Paul B Mahol
2023-01-11 11:42   ` Jeffrey Chapuis
2023-01-11 17:46     ` Jeffrey Chapuis
2023-01-12 15:53       ` Jeffrey Chapuis
2023-01-17 11:46         ` Jeffrey Chapuis
2023-01-17 11:52           ` Paul B Mahol
2023-01-17 12:27             ` Jeffrey Chapuis
2023-01-17 12:34               ` Paul B Mahol
2023-01-17 13:31                 ` Jeffrey Chapuis
2023-01-17 13:45                   ` Paul B Mahol
2023-01-17 14:24                     ` Jeffrey Chapuis
2023-01-17 14:29                       ` Paul B Mahol
2023-01-17 15:19                         ` Jeffrey Chapuis
2023-01-17 16:23                           ` Paul B Mahol
2023-01-17 18:00                             ` Jeffrey Chapuis
2023-01-17 18:11                               ` Paul B Mahol
2023-01-17 22:07                                 ` Jeffrey Chapuis
2023-01-19 12:11                                 ` Jeffrey Chapuis [this message]
2023-01-19 13:50                                 ` Jeffrey Chapuis
  -- strict thread matches above, loose matches on Subject: below --
2022-12-28 11:02 Jeffrey CHAPUIS
2022-12-28 11:21 ` Marton Balint
2022-12-28 11:51 ` James Almer
2022-12-28 15:37   ` Jeffrey CHAPUIS
2022-12-27 12:33 Jeffrey CHAPUIS
2022-12-27 11:46 Jeffrey CHAPUIS
2022-12-27 12:34 ` James Almer
2022-12-27 12:57   ` Jeffrey CHAPUIS

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34c27bec-ba11-f58e-565b-b6522b95cc76@gmail.com \
    --to=ashyni1987@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git