[FFmpeg-cvslog] swscale: Mark all init functions as av_cold

Diego Biurrun git at videolan.org
Mon Jul 23 21:55:21 CEST 2012


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sun Jul 22 12:29:28 2012 +0200| [5a6e3c039c0eefaf5684c7e4e1687ccb13ae488a] | committer: Diego Biurrun

swscale: Mark all init functions as av_cold

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a6e3c039c0eefaf5684c7e4e1687ccb13ae488a
---

 libswscale/output.c              |   15 ++++++++-------
 libswscale/ppc/swscale_altivec.c |    3 ++-
 libswscale/ppc/yuv2rgb_altivec.c |   11 +++++++----
 libswscale/rgb2rgb.c             |    3 ++-
 libswscale/sparc/yuv2rgb_vis.c   |    3 ++-
 libswscale/utils.c               |    4 +++-
 libswscale/x86/rgb2rgb.c         |    3 ++-
 libswscale/x86/swscale.c         |    3 ++-
 libswscale/x86/yuv2rgb.c         |    3 ++-
 9 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index b58bda9..43d5435 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "libavutil/attributes.h"
 #include "libavutil/avutil.h"
 #include "libavutil/bswap.h"
 #include "libavutil/cpu.h"
@@ -1260,13 +1261,13 @@ YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB,  0)
 YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full,  PIX_FMT_BGR24, 0)
 YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full,  PIX_FMT_RGB24, 0)
 
-void ff_sws_init_output_funcs(SwsContext *c,
-                              yuv2planar1_fn *yuv2plane1,
-                              yuv2planarX_fn *yuv2planeX,
-                              yuv2interleavedX_fn *yuv2nv12cX,
-                              yuv2packed1_fn *yuv2packed1,
-                              yuv2packed2_fn *yuv2packed2,
-                              yuv2packedX_fn *yuv2packedX)
+av_cold void ff_sws_init_output_funcs(SwsContext *c,
+                                      yuv2planar1_fn *yuv2plane1,
+                                      yuv2planarX_fn *yuv2planeX,
+                                      yuv2interleavedX_fn *yuv2nv12cX,
+                                      yuv2packed1_fn *yuv2packed1,
+                                      yuv2packed2_fn *yuv2packed2,
+                                      yuv2packedX_fn *yuv2packedX)
 {
     enum PixelFormat dstFormat = c->dstFormat;
 
diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c
index 5537707..0e66ec1 100644
--- a/libswscale/ppc/swscale_altivec.c
+++ b/libswscale/ppc/swscale_altivec.c
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "libswscale/swscale.h"
 #include "libswscale/swscale_internal.h"
+#include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
 #include "yuv2rgb_altivec.h"
 
@@ -310,7 +311,7 @@ static void hScale_altivec_real(SwsContext *c, int16_t *dst, int dstW,
         }
 }
 
-void ff_sws_init_swScale_altivec(SwsContext *c)
+av_cold void ff_sws_init_swScale_altivec(SwsContext *c)
 {
     enum PixelFormat dstFormat = c->dstFormat;
 
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 3a140cb..380c76f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -95,6 +95,7 @@
 #include "libswscale/rgb2rgb.h"
 #include "libswscale/swscale.h"
 #include "libswscale/swscale_internal.h"
+#include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
 #include "yuv2rgb_altivec.h"
 
@@ -535,7 +536,7 @@ static int altivec_uyvy_rgb32(SwsContext *c, const unsigned char **in,
  *
  * So we just fall back to the C codes for this.
  */
-SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c)
+av_cold SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c)
 {
     if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
         return NULL;
@@ -595,9 +596,11 @@ SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c)
     return NULL;
 }
 
-void ff_yuv2rgb_init_tables_altivec(SwsContext *c, const int inv_table[4],
-                                    int brightness, int contrast,
-                                    int saturation)
+av_cold void ff_yuv2rgb_init_tables_altivec(SwsContext *c,
+                                            const int inv_table[4],
+                                            int brightness,
+                                            int contrast,
+                                            int saturation)
 {
     union {
         DECLARE_ALIGNED(16, signed short, tmp)[8];
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index 14b595f..26ef648 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -25,6 +25,7 @@
 
 #include <inttypes.h>
 
+#include "libavutil/attributes.h"
 #include "libavutil/bswap.h"
 #include "config.h"
 #include "rgb2rgb.h"
@@ -125,7 +126,7 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
  * 32-bit C version, and and&add trick by Michael Niedermayer
  */
 
-void sws_rgb2rgb_init(void)
+av_cold void sws_rgb2rgb_init(void)
 {
     rgb2rgb_init_c();
     if (HAVE_MMX)
diff --git a/libswscale/sparc/yuv2rgb_vis.c b/libswscale/sparc/yuv2rgb_vis.c
index bcd2081..d7102a3 100644
--- a/libswscale/sparc/yuv2rgb_vis.c
+++ b/libswscale/sparc/yuv2rgb_vis.c
@@ -22,6 +22,7 @@
 #include <inttypes.h>
 #include <stdlib.h>
 
+#include "libavutil/attributes.h"
 #include "libswscale/swscale.h"
 #include "libswscale/swscale_internal.h"
 
@@ -184,7 +185,7 @@ static int vis_422P_ARGB32(SwsContext *c, uint8_t *src[], int srcStride[],
     return srcSliceH;
 }
 
-SwsFunc ff_yuv2rgb_init_vis(SwsContext *c)
+av_cold SwsFunc ff_yuv2rgb_init_vis(SwsContext *c)
 {
     c->sparc_coeffs[5] = c->yCoeff;
     c->sparc_coeffs[6] = c->vgCoeff;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index a6b5a18..4960194 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -37,6 +37,7 @@
 #include <windows.h>
 #endif
 
+#include "libavutil/attributes.h"
 #include "libavutil/avutil.h"
 #include "libavutil/bswap.h"
 #include "libavutil/cpu.h"
@@ -823,7 +824,8 @@ SwsContext *sws_alloc_context(void)
     return c;
 }
 
-int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
+av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+                             SwsFilter *dstFilter)
 {
     int i;
     int usesVFilter, usesHFilter;
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index 353b0aa..f940888 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -26,6 +26,7 @@
 #include <stdint.h>
 
 #include "config.h"
+#include "libavutil/attributes.h"
 #include "libavutil/x86_cpu.h"
 #include "libavutil/cpu.h"
 #include "libavutil/bswap.h"
@@ -127,7 +128,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 0x0000001f0000001fULL;
 
 #endif /* HAVE_INLINE_ASM */
 
-void rgb2rgb_init_x86(void)
+av_cold void rgb2rgb_init_x86(void)
 {
 #if HAVE_INLINE_ASM
     int cpu_flags = av_get_cpu_flags();
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index b57b7a4..a0c18c7 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "libswscale/swscale.h"
 #include "libswscale/swscale_internal.h"
+#include "libavutil/attributes.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/x86_cpu.h"
 #include "libavutil/cpu.h"
@@ -300,7 +301,7 @@ INPUT_FUNCS(sse2);
 INPUT_FUNCS(ssse3);
 INPUT_FUNCS(avx);
 
-void ff_sws_init_swScale_mmx(SwsContext *c)
+av_cold void ff_sws_init_swScale_mmx(SwsContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
 
diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c
index f534e0e..b4bcbf5 100644
--- a/libswscale/x86/yuv2rgb.c
+++ b/libswscale/x86/yuv2rgb.c
@@ -33,6 +33,7 @@
 #include "libswscale/rgb2rgb.h"
 #include "libswscale/swscale.h"
 #include "libswscale/swscale_internal.h"
+#include "libavutil/attributes.h"
 #include "libavutil/x86_cpu.h"
 #include "libavutil/cpu.h"
 
@@ -68,7 +69,7 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
 
 #endif /* HAVE_INLINE_ASM */
 
-SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
+av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
 {
 #if HAVE_INLINE_ASM
     int cpu_flags = av_get_cpu_flags();



More information about the ffmpeg-cvslog mailing list