[FFmpeg-cvslog] huffyuv: avoid duplicated defines

Christophe Gisquet git at videolan.org
Thu May 29 14:18:20 CEST 2014


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Thu May 29 09:10:38 2014 +0000| [c609f803e1c1689e8a557a9a9d624bf53aa4b7d3] | committer: Michael Niedermayer

huffyuv: avoid duplicated defines

Move the defines to the dsp header.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/huffyuv.h    |   12 ------------
 libavcodec/huffyuvdsp.c |   15 ---------------
 libavcodec/huffyuvdsp.h |   12 ++++++++++++
 3 files changed, 12 insertions(+), 27 deletions(-)

diff --git a/libavcodec/huffyuv.h b/libavcodec/huffyuv.h
index 5f4b808..635a8ab 100644
--- a/libavcodec/huffyuv.h
+++ b/libavcodec/huffyuv.h
@@ -45,18 +45,6 @@
 #define MAX_N (1<<MAX_BITS)
 #define MAX_VLC_N 16384
 
-#if HAVE_BIGENDIAN
-#define B 3
-#define G 2
-#define R 1
-#define A 0
-#else
-#define B 0
-#define G 1
-#define R 2
-#define A 3
-#endif
-
 typedef enum Predictor {
     LEFT = 0,
     PLANE,
diff --git a/libavcodec/huffyuvdsp.c b/libavcodec/huffyuvdsp.c
index a0e5444..089f667 100644
--- a/libavcodec/huffyuvdsp.c
+++ b/libavcodec/huffyuvdsp.c
@@ -81,17 +81,6 @@ static int add_hfyu_left_pred_c(uint8_t *dst, const uint8_t *src, int w,
     return acc;
 }
 
-#if HAVE_BIGENDIAN
-#define B 3
-#define G 2
-#define R 1
-#define A 0
-#else
-#define B 0
-#define G 1
-#define R 2
-#define A 3
-#endif
 static void add_hfyu_left_pred_bgr32_c(uint8_t *dst, const uint8_t *src,
                                        int w, int *red, int *green,
                                        int *blue, int *alpha)
@@ -115,10 +104,6 @@ static void add_hfyu_left_pred_bgr32_c(uint8_t *dst, const uint8_t *src,
     *blue  = b;
     *alpha = a;
 }
-#undef B
-#undef G
-#undef R
-#undef A
 
 av_cold void ff_huffyuvdsp_init(HuffYUVDSPContext *c)
 {
diff --git a/libavcodec/huffyuvdsp.h b/libavcodec/huffyuvdsp.h
index e08a96b..cc12c75 100644
--- a/libavcodec/huffyuvdsp.h
+++ b/libavcodec/huffyuvdsp.h
@@ -21,6 +21,18 @@
 
 #include <stdint.h>
 
+#if HAVE_BIGENDIAN
+#define B 3
+#define G 2
+#define R 1
+#define A 0
+#else
+#define B 0
+#define G 1
+#define R 2
+#define A 3
+#endif
+
 typedef struct HuffYUVDSPContext {
     void (*add_bytes)(uint8_t *dst /* align 16 */, uint8_t *src /* align 16 */,
                       int w);



More information about the ffmpeg-cvslog mailing list