diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-03-20 10:20:53 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-03-20 10:20:53 +0100 |
commit | 9d9ba5b00e5d1853b3f7032e8420996e19393d30 (patch) | |
tree | eb9205ab45b849fafc899baaf9ef94fde1293c70 | |
parent | eb7a146b51dd8bcb74242c1ffba0d0e2d21d3288 (diff) |
alpha: Move color conversion matrixes into stack variables to speed up processing
-rw-r--r-- | gst/alpha/gstalpha.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/gst/alpha/gstalpha.c b/gst/alpha/gstalpha.c index a57b76f6e..51a458d94 100644 --- a/gst/alpha/gstalpha.c +++ b/gst/alpha/gstalpha.c @@ -551,9 +551,11 @@ gst_alpha_set_ayuv_ayuv (const guint8 * src, guint8 * dest, gint width, } } } else { - const gint *matrix = + gint matrix[12]; + + memcpy (matrix, alpha->out_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit : - cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit; + cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint)); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { @@ -633,9 +635,11 @@ gst_alpha_set_i420_ayuv (const guint8 * src, guint8 * dest, gint width, srcY += src_wrap; } } else { - const gint *matrix = + gint matrix[12]; + + memcpy (matrix, alpha->out_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit : - cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit; + cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint)); for (i = 0; i < height; i++) { for (j = 0; j < width / 2; j++) { @@ -718,9 +722,11 @@ gst_alpha_chroma_key_ayuv_ayuv (const guint8 * src, guint8 * dest, gint width, } } } else { - const gint *matrix = + gint matrix[12]; + + memcpy (matrix, alpha->out_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit : - cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit; + cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint)); for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { @@ -807,10 +813,11 @@ gst_alpha_chromakey_row_i420_ayuv (GstAlpha * alpha, guint8 * dest1, dest2 += 8; } } else { - const gint *matrix = + gint matrix[12], y; + + memcpy (matrix, alpha->out_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit : - cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit; - gint y; + cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint)); for (xpos = 0; xpos < width / 2; xpos++) { y = APPLY_MATRIX (matrix, 0, srcY1[0], srcU[0], srcV[0]); |