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 DF1D34345A for ; Wed, 13 Jul 2022 09:52:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 831AC68B92F; Wed, 13 Jul 2022 12:52:15 +0300 (EEST) Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B06F568B7B0 for ; Wed, 13 Jul 2022 12:52:08 +0300 (EEST) Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-31c89111f23so107204857b3.0 for ; Wed, 13 Jul 2022 02:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=7nOXBFdmVC0kW4LnJab0bXv+YM8/ElS7oq9Oa3nzi9w=; b=h+Edz7DlTux52heA17GkXL+GpLQVs9JZ4r3u7mxmTKpwokmg8M5o0naUSe/g6Rkwxj TWVKLPW7FfJdxWECQWNXTMHPhghGWgbCPKJoqih1NGf/3IAZSDDdZO701p3n1f7ugr+I NxpNgaf2mqdnNT7lL/s5lYMmfIivpcxFHXNsGL5PAeZC0+FZGeVwZBo0jEL80U+2G3EF V7VfebnWx57S9/jQjapFyMP6ohWOGzW1kpqBwEYcwmiwEBMpOizNSVtF1ApOoc1U9s7j VWt7ydrSPtRmg/KRu54v6eAK1shYB1qX1QPk/FYok2f7sKbXPk1p7JP5CO+/53cPV9Kj k0WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=7nOXBFdmVC0kW4LnJab0bXv+YM8/ElS7oq9Oa3nzi9w=; b=087DXdP2VCkBoy6bohYk53lJxrKWCaDemyF7cFrS29zc9hWkBQXJWbDva9mhU+HNZD lT2GP0KDhVjZ2lg26saeS/NaHDbyTEAJArHQ3sv1YQgMchAb4u6w1ethpUVqMW5G8xub 6ci1T0LVPMzS5DcSxdGyymC95OVWe0tnym1NlP2s54gdl+sBVp8agogOW8ruPwTzKqxK mf9HqzKFwXwiPn31GSKXTRjsshWJdsK77U4+NmGRz1S3vK4jqETU86+c/H8O3MkXmzln spzgACBA0nH8BLEe6FvdR+n2WdtyVjNICHKv+zMKtQgGHHiTmNDAd+xg2B4IblZJvPRn dwXw== X-Gm-Message-State: AJIora/jQl89OZlsQvuwrv5qoeNXxPdKXjUo5Id7+9oqRWMwUwG1qMVI v7jdj01hbMpujKovkyHo6fb57inhQgz5mDLnKnL+A2f8 X-Google-Smtp-Source: AGRyM1t86POsjCWAaPJuzlu3cokWxgn+WSc83QdoQctiLvN2A6wwfhisr590ah4y6DG0SRQMsoOh956WBoyZwYUMJgs= X-Received: by 2002:a81:1257:0:b0:31c:97fe:e416 with SMTP id 84-20020a811257000000b0031c97fee416mr3288251yws.34.1657705926491; Wed, 13 Jul 2022 02:52:06 -0700 (PDT) MIME-Version: 1.0 References: <632087708.1175797.1657705107285.ref@mail.yahoo.com> <632087708.1175797.1657705107285@mail.yahoo.com> In-Reply-To: <632087708.1175797.1657705107285@mail.yahoo.com> From: Paul B Mahol Date: Wed, 13 Jul 2022 11:54:44 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] Performances improvement in "image_copy_plane" 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: On Wed, Jul 13, 2022 at 11:38 AM Marco Vianini < marco_vianini-at-yahoo.it@ffmpeg.org> wrote: > You can get a very big improvement of performances in the special (but > very likely) case of: "(dst_linesize == bytewidth && src_linesize == > bytewidth)" > > In this case in fact We can "Coalesce rows", that is using ONLY ONE > MEMCPY, instead of a smaller memcpy for every row (that is looping for > height times). > > Code:"static void image_copy_plane(uint8_t *dst, ptrdiff_t > dst_linesize, const uint8_t *src, ptrdiff_t > src_linesize, ptrdiff_t bytewidth, int > height){ if (!dst || !src) return; > av_assert0(abs(src_linesize) >= bytewidth); av_assert0(abs(dst_linesize) > >= bytewidth); // MY PATCH START // Coalesce rows. if (dst_linesize > == bytewidth && src_linesize == bytewidth) { bytewidth *= height; > height = 1; src_linesize = dst_linesize = 0; }// MY PATCH STOP > for (;height > 0; height--) { memcpy(dst, src, bytewidth); > dst += dst_linesize; src += src_linesize; }}" > What do You think about?Thank You > Show the benchmark numbers. > Marco Vianini > _______________________________________________ > 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". > _______________________________________________ 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".