[FFmpeg-devel] [PATCH] checkasm: store and associate contexts with functions and use it for av_tx

Lynne dev at lynne.ee
Sun Dec 19 21:00:23 EET 2021


checkasm: store and associate contexts with functions and use it for av_tx

The issue is the following:
- checkasm/av_tx.c initializes a context and a function
- check_func() receives the function only and returns NULL
- checkasm/av_tx.c runs again with a different CPU flag and creates a new function and context
- check_func() sees a new function for testing and sets func_ref to the function it first received
- call_ref() and call_new() get called with the same, new context

This means that av_tx contexts had to be compatible with both C and assembly functions.
And so each context difference had to be generated twice and duplicated to keep checkasm
working.

The commit introduces a new *cont in the checkasm function struct, which is associated
with each function. Code that doesn't need an additional context requires no changes,
as we use wrapper macros.

A downside is that there's no way to free contexts until the very end. However, as
checkasm is a testing infrastructure, I think it's reasonable, and we're talking a few
tens of kilobytes of heap memory as we only test a limited number of smaller transforms.

Patch attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-checkasm-store-and-associate-contexts-with-functions.patch
Type: text/x-patch
Size: 8035 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20211219/38e19e55/attachment.bin>


More information about the ffmpeg-devel mailing list