diff options
author | Jeroen Bakker <jbakker> | 2021-06-11 10:34:31 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-06-11 10:34:44 +0300 |
commit | 28617bb167981ac1e02655c0fc262fe1571d8e1e (patch) | |
tree | 0859547367283e9c87676e5379e48d66a5dd9925 /source/blender/imbuf/IMB_imbuf.h | |
parent | 84f025c6fdba38a1cdf8e3070c9642977837cb33 (diff) |
Sequencer: Transform ImBuf Processor.
Inside the sequencer the cropping and transform of images/buffers were
implemented locally. This reduced the optimizations that a compiler
could do and added confusing code styles. This patch adds
`IMB_transform` to reduce the confusion and increases compiler
optimizations as more code can be inlined and we can keep track of
indices inside the inner loop.
This increases end-user performance by 30% when playing back aa video
in VSE.
Reviewed By: ISS, zeddb
Differential Revision: https://developer.blender.org/D11549
Diffstat (limited to 'source/blender/imbuf/IMB_imbuf.h')
-rw-r--r-- | source/blender/imbuf/IMB_imbuf.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 9c84127105a..651c69726ff 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -70,6 +70,7 @@ extern "C" { */ struct ImBuf; struct rcti; +struct rctf; /** * @@ -323,6 +324,11 @@ typedef enum IMB_Proxy_Size { IMB_PROXY_MAX_SLOT = 4, } IMB_Proxy_Size; +typedef enum eIMBInterpolationFilterMode { + IMB_FILTER_NEAREST, + IMB_FILTER_BILINEAR, +} eIMBInterpolationFilterMode; + /* Defaults to BL_proxy within the directory of the animation. */ void IMB_anim_set_index_dir(struct anim *anim, const char *dir); void IMB_anim_get_fname(struct anim *anim, char *file, int size); @@ -732,6 +738,12 @@ void IMB_processor_apply_threaded_scanlines(int total_scanlines, ScanlineThreadFunc do_thread, void *custom_data); +void IMB_transform(struct ImBuf *src, + struct ImBuf *dst, + float transform_matrix[3][3], + struct rctf *src_crop, + const eIMBInterpolationFilterMode filter); + /* ffmpeg */ void IMB_ffmpeg_init(void); const char *IMB_ffmpeg_last_error(void); |