Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-10-26 00:46:06 +0400
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-10-30 23:52:24 +0400
commit4fab08c94f836f24c67f75f3e44e82cdbac5ffb2 (patch)
tree0c1af799012dccbdc34349c5f0bb954e01a55deb /libswscale/swscale_internal.h
parent18802942d1a28b62b2691d06de7b44ef46b5e177 (diff)
Optimize pure C unscaled yuv2rgb.
Aligning the tables reduces the amount of code generated on e.g. ARM as the offset constant then has few enough set bits so it can be encoded inside a single instruction instead of 2. Ideally all should be declared aligned, but the DECLARE_ALIGNED macros does not work with pointer tables, thus also reordered the tables. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libswscale/swscale_internal.h')
-rw-r--r--libswscale/swscale_internal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 33fdfc2771..6ad278e19b 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -362,9 +362,11 @@ typedef struct SwsContext {
int dstY; ///< Last destination vertical line output from last slice.
int flags; ///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
void *yuvTable; // pointer to the yuv->rgb table start so it can be freed()
+ // alignment ensures the offset can be added in a single
+ // instruction on e.g. ARM
+ DECLARE_ALIGNED(16, int, table_gV)[256 + 2*YUVRGB_TABLE_HEADROOM];
uint8_t *table_rV[256 + 2*YUVRGB_TABLE_HEADROOM];
uint8_t *table_gU[256 + 2*YUVRGB_TABLE_HEADROOM];
- int table_gV[256 + 2*YUVRGB_TABLE_HEADROOM];
uint8_t *table_bU[256 + 2*YUVRGB_TABLE_HEADROOM];
DECLARE_ALIGNED(16, int32_t, input_rgb2yuv_table)[16+40*4]; // This table can contain both C and SIMD formatted values, teh C vales are always at the XY_IDX points
#define RY_IDX 0