From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 3/5] avutil/tx_template: Don't waste space for inexistent factors Date: Sat, 22 Oct 2022 15:59:01 +0200 Message-ID: <AS8P250MB074401A2AF976238F94F118B8F2C9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB0744EEDDFAC2FE05398004DF8F2C9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> It is possible to avoid the factors array for the power-of-two tables for which said array is unused by using a different structure for initialization the same structure for power-of-two tables as for non-power-of-two-tables. This saves 3*15*16B from .data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavutil/tx_template.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c index 6b63cc575f..b44a6189cc 100644 --- a/libavutil/tx_template.c +++ b/libavutil/tx_template.c @@ -55,9 +55,14 @@ TABLE_DEF( 9, 8); typedef struct FFSRTabsInitOnce { void (*func)(void); AVOnce control; - int factors[TX_MAX_SUB]; /* Must be sorted high -> low */ } FFSRTabsInitOnce; +typedef struct FFSRTabsInitOnceExt { + void (*func)(void); + AVOnce control; + int factors[TX_MAX_SUB]; /* Must be sorted high -> low */ +} FFSRTabsInitOnceExt; + #define INIT_FF_SR_TAB(len) \ static av_cold void TX_TAB(ff_tx_init_tab_ ##len)(void) \ { \ @@ -145,7 +150,7 @@ static av_cold void TX_TAB(ff_tx_init_tab_9)(void) TX_TAB(ff_tx_tab_9)[7] = TX_TAB(ff_tx_tab_9)[3] - TX_TAB(ff_tx_tab_9)[4]; } -static FFSRTabsInitOnce nptwo_tabs_init_once[] = { +static FFSRTabsInitOnceExt nptwo_tabs_init_once[] = { { TX_TAB(ff_tx_init_tab_53), AV_ONCE_INIT, { 15, 5, 3 } }, { TX_TAB(ff_tx_init_tab_9), AV_ONCE_INIT, { 9 } }, { TX_TAB(ff_tx_init_tab_7), AV_ONCE_INIT, { 7 } }, -- 2.34.1 _______________________________________________ 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".
next prev parent reply other threads:[~2022-10-22 13:59 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-22 13:57 [FFmpeg-devel] [PATCH 1/5] avformat/argo_cvg: Mark overrides as const Andreas Rheinhardt 2022-10-22 13:59 ` [FFmpeg-devel] [PATCH 2/5] avcodec/aaccoder: Mark function pointer arrays " Andreas Rheinhardt 2022-10-22 13:59 ` Andreas Rheinhardt [this message] 2022-10-22 13:59 ` [FFmpeg-devel] [PATCH 4/5] avutil/tx_template: Avoid code duplication Andreas Rheinhardt 2022-10-22 13:59 ` [FFmpeg-devel] [PATCH 5/5] avutil/tx_template: Move function pointers to const memory Andreas Rheinhardt 2022-10-27 13:56 ` [FFmpeg-devel] [PATCH 1/5] avformat/argo_cvg: Mark overrides as const 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=AS8P250MB074401A2AF976238F94F118B8F2C9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.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