[FFmpeg-cvslog] Move some definitions to header file.
Vitaliy E Sugrobov
git at videolan.org
Fri Nov 30 15:59:47 CET 2012
ffmpeg | branch: master | Vitaliy E Sugrobov <vsugrob at hotmail.com> | Fri Nov 30 12:58:55 2012 +0400| [005cb97e3e710a5266cbcad47b1c5060933646bd] | committer: Paul B Mahol
Move some definitions to header file.
Share them with upcoming demuxer module.
Signed-off-by: Vitaliy E Sugrobov <vsugrob at hotmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=005cb97e3e710a5266cbcad47b1c5060933646bd
---
libavcodec/gif.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
libavcodec/gifdec.c | 11 +----------
2 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/libavcodec/gif.h b/libavcodec/gif.h
new file mode 100755
index 0000000..b557534
--- /dev/null
+++ b/libavcodec/gif.h
@@ -0,0 +1,47 @@
+/*
+ * GIF format definitions
+ * Copyright (c) 2003 Fabrice Bellard
+ * Copyright (c) 2006 Baptiste Coudurier
+ * Copyright (c) 2012 Vitaliy E Sugrobov
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * GIF format definitions.
+ */
+
+#ifndef AVCODEC_GIFDEFS_H
+#define AVCODEC_GIFDEFS_H
+
+#include <stdint.h>
+
+static const uint8_t gif87a_sig[6] = "GIF87a";
+static const uint8_t gif89a_sig[6] = "GIF89a";
+
+#define GCE_DISPOSAL_NONE 0
+#define GCE_DISPOSAL_INPLACE 1
+#define GCE_DISPOSAL_BACKGROUND 2
+#define GCE_DISPOSAL_RESTORE 3
+
+#define GIF_TRAILER 0x3b
+#define GIF_EXTENSION_INTRODUCER 0x21
+#define GIF_IMAGE_SEPARATOR 0x2c
+#define GIF_GCE_EXT_LABEL 0xf9
+
+#endif /* AVCODEC_GIFDEFS_H */
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 2213733..63a8788 100755
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -28,15 +28,8 @@
#include "avcodec.h"
#include "bytestream.h"
#include "lzw.h"
+#include "gif.h"
-#define GCE_DISPOSAL_NONE 0
-#define GCE_DISPOSAL_INPLACE 1
-#define GCE_DISPOSAL_BACKGROUND 2
-#define GCE_DISPOSAL_RESTORE 3
-#define GIF_TRAILER 0x3b
-#define GIF_EXTENSION_INTRODUCER 0x21
-#define GIF_IMAGE_SEPARATOR 0x2c
-#define GIF_GCE_EXT_LABEL 0xf9
/* This value is intentionally set to "transparent white" color.
* It is much better to have white background instead of black
* when gif image converted to format which not support transparency.
@@ -83,8 +76,6 @@ typedef struct GifState {
int trans_color; /**< color value that is used instead of transparent color */
} GifState;
-static const uint8_t gif87a_sig[6] = "GIF87a";
-static const uint8_t gif89a_sig[6] = "GIF89a";
static void gif_read_palette(const uint8_t **buf, uint32_t *pal, int nb)
{
const uint8_t *pal_end = *buf + nb * 3;
More information about the ffmpeg-cvslog
mailing list