Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Stefano Sabatini <stefasab@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] lavfi: add quirc filter
Date: Wed, 27 Dec 2023 02:19:38 +0100
Message-ID: <ZYt7qpGA7pf87iNs@mariano> (raw)
In-Reply-To: <9aa042cb-da94-47b8-b2f6-71d0a81755c6@gmail.com>

On date Tuesday 2023-12-26 16:21:55 -0300, James Almer wrote:
> On 12/26/2023 1:20 PM, Stefano Sabatini wrote:
> > +static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
> > +{
> > +    AVFilterContext *ctx = inlink->dst;
> > +    AVFilterLink *outlink = ctx->outputs[0];
> > +    QuircContext *quirc = ctx->priv;
> > +    int codes_count;
> > +    int i, w, h;
> > +    uint8_t *image, *imagep, *srcp;
> > +
> > +    image = quirc_begin(quirc->quirc, &w, &h);
> 

> Can't this fail?

> Or does the allocation take place in the quirc_resize()
> call?

correct

> > +
> > +    /* copy input image to quirc buffer */
> > +    imagep = image;
> > +    srcp = frame->data[0];
> > +    for (i = 0; i < inlink->h; i++) {
> > +        memcpy(imagep, srcp, w);
> 

> Can w differ from inlink->w?

No, given that the resize is done in config_inputs.


> > +        imagep += w;
> > +        srcp += frame->linesize[0];
> > +    }
> 
> Maybe instead do
> 

> av_image_copy_plane(image, w, frame->data[0], frame->linesize[0],
>                     w, inlink->h);

good catch, thanks for the feedback
_______________________________________________
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".

  reply	other threads:[~2023-12-27  1:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 16:20 Stefano Sabatini
2023-12-26 19:08 ` Andreas Rheinhardt
2023-12-27  1:20   ` Stefano Sabatini
2023-12-26 19:21 ` James Almer
2023-12-27  1:19   ` Stefano Sabatini [this message]
2023-12-27  1:25 ` Stefano Sabatini
2023-12-27  1:33   ` James Almer
2023-12-27 11:37     ` Stefano Sabatini
2023-12-27 14:49       ` Tomas Härdin
2023-12-27 17:16       ` James Almer
2023-12-27 23:20         ` Stefano Sabatini
2023-12-28  0:57           ` James Almer
2023-12-29 11:57             ` Stefano Sabatini
2024-01-02 21:13               ` Stefano Sabatini
2023-12-28 10:24           ` Tomas Härdin

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=ZYt7qpGA7pf87iNs@mariano \
    --to=stefasab@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