Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 17/57] avcodec/mpegvideo, mpegpicture: Add buffer pool
Date: Tue, 30 Apr 2024 22:40:26 +0200
Message-ID: <20240430204026.GS6420@pb2> (raw)
In-Reply-To: <AS8P250MB0744A8359CB929AECAA88AF68F1B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>


[-- Attachment #1.1: Type: text/plain, Size: 3567 bytes --]

On Mon, Apr 29, 2024 at 11:13:58PM +0200, Andreas Rheinhardt wrote:
> This avoids constant allocations+frees and will also allow
> to simply switch to the RefStruct API, thereby avoiding
> the overhead of the AVBuffer API.
> It also simplifies the code, because it removes the "needs_realloc"
> field: It was added in 435c0b87d28b48dc2e0360adc404a0e2d66d16a0,
> before the introduction of the AVBuffer API: given that these buffers
> may be used by different threads, they were not freed immediately
> and instead were marked as being freed later by setting needs_realloc.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/mpegpicture.c   | 155 ++++++++-----------------------------
>  libavcodec/mpegpicture.h   |  27 ++++---
>  libavcodec/mpegvideo.c     |  37 +++++++++
>  libavcodec/mpegvideo.h     |   2 +
>  libavcodec/mpegvideo_dec.c |  35 ++++-----
>  libavcodec/mpegvideo_enc.c |  13 ++--
>  6 files changed, 112 insertions(+), 157 deletions(-)

This seems to change the output of:

./ffmpeg -y -bitexact -i fate-suite/svq3/Vertical400kbit.sorenson3.mov -ps 50 -bf 1 -bitexact -an -qscale 5  -ss 40 -error_rate 4 -threads 1 /tmp/out4.avi && ./ffmpeg -y -bitexact -v -1 -loglevel 0 -i /tmp/out4.avi -bitexact -vsync drop -f framecrc -

--- A	2024-04-30 22:01:12.964146819 +0200
+++ B	2024-04-30 22:00:57.407969834 +0200
@@ -38,7 +38,7 @@
 0,         32,         32,        1,   115200, 0x74c44bae
 0,         33,         33,        1,   115200, 0x921c5255
 0,         34,         34,        1,   115200, 0x9a8553a9
-0,         35,         35,        1,   115200, 0x817b6334
+0,         35,         35,        1,   115200, 0x310061fd
 0,         36,         36,        1,   115200, 0x4c9a5f6d
 0,         37,         37,        1,   115200, 0x5ee86279
 0,         38,         38,        1,   115200, 0x04055061
@@ -74,7 +74,7 @@
 0,         68,         68,        1,   115200, 0x49dcbf4e
 0,         69,         69,        1,   115200, 0x1ea1c7d1
 0,         70,         70,        1,   115200, 0xdf77c67b
-0,         71,         71,        1,   115200, 0x33d9d206
+0,         71,         71,        1,   115200, 0x7f6bd16d
 0,         72,         72,        1,   115200, 0x5e37cb3a
 0,         73,         73,        1,   115200, 0x15abcda3
 0,         74,         74,        1,   115200, 0xbf4dcbd4
@@ -86,7 +86,7 @@
 0,         80,         80,        1,   115200, 0x17d1d667
 0,         81,         81,        1,   115200, 0x0c1fdf9c
 0,         82,         82,        1,   115200, 0x7eabde6b
-0,         83,         83,        1,   115200, 0x3bf6e873
+0,         83,         83,        1,   115200, 0xe623e7af
 0,         84,         84,        1,   115200, 0xf480dc82
 0,         85,         85,        1,   115200, 0x5fd6e098
 0,         86,         86,        1,   115200, 0xf520de95
@@ -98,7 +98,7 @@
 0,         92,         92,        1,   115200, 0x34cfe1c2
 0,         93,         93,        1,   115200, 0x1d94e1c3
 0,         94,         94,        1,   115200, 0x6d32e147
-0,         95,         95,        1,   115200, 0x09fbefd0
+0,         95,         95,        1,   115200, 0x7e40ee91
 0,         96,         96,        1,   115200, 0xa5f5eb43
 0,         97,         97,        1,   115200, 0x39b9ec3d
 0,         98,         98,        1,   115200, 0x3256ec18


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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:[~2024-04-30 20:40 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  0:28 [FFmpeg-devel] [PATCH 01/14] avcodec/get_buffer: Remove redundant check Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 02/14] avcodec/mpegpicture: Store linesize in ScratchpadContext Andreas Rheinhardt
2024-04-29 15:09   ` [FFmpeg-devel] [PATCH v2 2/14] " Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 03/14] avcodec/mpegvideo_dec: Sync linesize and uvlinesize between threads Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 04/14] avcodec/mpegvideo_dec: Factor allocating dummy frames out Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 05/14] avcodec/mpegpicture: Mark dummy frames as such Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 06/14] avcodec/mpeg12dec: Allocate dummy frames for non-I fields Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 07/14] avcodec/mpegvideo_motion: Remove dead checks for existence of reference Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 08/14] avcodec/mpegvideo_motion: Optimize check away Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 09/14] " Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 10/14] avcodec/mpegvideo_motion: Avoid constant function argument Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 11/14] avcodec/msmpeg4enc: Only calculate coded_cbp when used Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 12/14] avcodec/mpegvideo: Only allocate coded_block when needed Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 13/14] avcodec/mpegvideo: Don't reset coded_block unnecessarily Andreas Rheinhardt
2024-04-29  0:35 ` [FFmpeg-devel] [PATCH 14/14] avcodec/mpegvideo: Only allocate cbp_table, pred_dir_table when needed Andreas Rheinhardt
2024-04-29 21:13 ` [FFmpeg-devel] [PATCH 15/57] avcodec/mpegpicture: Always reset motion val buffer Andreas Rheinhardt
2024-04-29 21:13 ` [FFmpeg-devel] [PATCH 16/57] avcodec/mpegvideo: Redo aligning mb_height for VC-1 Andreas Rheinhardt
2024-04-29 21:13 ` [FFmpeg-devel] [PATCH 17/57] avcodec/mpegvideo, mpegpicture: Add buffer pool Andreas Rheinhardt
2024-04-30 20:40   ` Michael Niedermayer [this message]
2024-04-30 20:58     ` James Almer
2024-04-30 21:07       ` Andreas Rheinhardt
2024-04-30 21:06     ` Andreas Rheinhardt
2024-04-29 21:13 ` [FFmpeg-devel] [PATCH 18/57] avcodec/mpegpicture: Reindent after the previous commit Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 19/57] avcodec/mpegpicture: Use RefStruct-pool API Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 20/57] avcodec/mpegvideo: Shorten variable names Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 21/57] avcodec/mpegpicture: Reduce value of MAX_PLANES define Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 22/57] avcodec/mpegpicture: Cache AVFrame.data and linesize values Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 23/57] avcodec/rv30, rv34, rv40: Avoid indirection Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 24/57] avcodec/mpegvideo: Add const where appropriate Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 25/57] avcodec/vc1_pred: Remove unused function parameter Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 26/57] avcodec/mpegpicture: Improve error messages and code Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 27/57] avcodec/mpegpicture: Split ff_alloc_picture() into check and alloc part Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 28/57] avcodec/mpegvideo_enc: Pass AVFrame*, not Picture* to alloc_picture() Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 29/57] avcodec/mpegvideo_enc: Move copying properties " Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 30/57] avcodec/mpegpicture: Rename Picture->MPVPicture Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 31/57] avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary Pic Andreas Rheinhardt
2024-04-30 18:57   ` Michael Niedermayer
2024-04-30 19:07     ` Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 32/57] avcodec/error_resilience: Deduplicate cleanup code Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 33/57] avcodec/mpegvideo_enc: Factor setting length of B frame chain out Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 34/57] avcodec/mpegvideo_enc: Return early when getting length of B frame chain Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 35/57] avcodec/mpegvideo_enc: Reindentation Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 36/57] avcodec/mpeg12dec: Don't initialize inter tables for IPU Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 37/57] avcodec/mpeg12dec: Only initialize IDCT " Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 38/57] avcodec/mpeg12dec: Remove write-only assignment Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 39/57] avcodec/mpeg12dec: Set out_format only once Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 40/57] avformat/riff: Declare VCR2 to be MPEG-2 Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 41/57] avcodec/mpegvideo_dec: Add close function for mpegvideo-decoders Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 42/57] avcodec/mpegpicture: Make MPVPicture refcounted Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 43/57] avcodec/mpeg4videoenc: Avoid branch for writing stuffing Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 44/57] avcodec/mpeg4videoenc: Simplify writing startcodes Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 45/57] avcodec/mpegpicture: Use ThreadProgress instead of ThreadFrame API Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 46/57] avcodec/mpegpicture: Avoid loop and branch when setting motion_val Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 47/57] avcodec/mpegpicture: Use union for b_scratchpad and rd_scratchpad Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 48/57] avcodec/mpegpicture: Avoid MotionEstContext in ff_mpeg_framesize_alloc() Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 49/57] avcodec/mpegvideo_enc: Unify initializing PutBitContexts Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 50/57] avcodec/mpeg12enc: Simplify writing startcodes Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 51/57] avcodec/mpegvideo_dec: Simplify check for "does pic exist?" Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 52/57] avcodec/mpegvideo_dec: Don't sync encoder-only coded_picture_number Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 53/57] avcodec/mpeg12dec: Pass Mpeg1Context* in mpeg_field_start() Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 54/57] avcodec/mpeg12dec: Don't initialize inter_scantable Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 55/57] avcodec/mpegvideo: Remove pblocks Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 56/57] avcodec/mpegvideo: Use enum for msmpeg4_version Andreas Rheinhardt
2024-04-29 21:14 ` [FFmpeg-devel] [PATCH 57/57] avcodec/ituh263enc: Remove redundant check Andreas Rheinhardt

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=20240430204026.GS6420@pb2 \
    --to=michael@niedermayer.cc \
    --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