summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-07-01 18:49:44 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-07-01 18:49:44 +0000
commit2b4abbd6f5f065a41d48622154cb7fd045247f2f (patch)
tree395a9013ac3148bf651a07a35265ab2bd6472f85 /libavcodec
parent39bb30f6640fe1faf4bbc779a79786028febc95d (diff)
Move colorspace.h from libavcodec to libavutil.
Avoid a compile-time dependency of the pad filter on libavcodec. Originally committed as revision 23940 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h2
-rw-r--r--libavcodec/colorspace.h111
-rw-r--r--libavcodec/dvbsub.c2
-rw-r--r--libavcodec/dvbsubdec.c2
-rw-r--r--libavcodec/dvdsubdec.c2
-rw-r--r--libavcodec/imgconvert.c2
-rw-r--r--libavcodec/pgssubdec.c2
7 files changed, 6 insertions, 117 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 2eb2ff683e..5841d6a4c8 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -31,7 +31,7 @@
#define LIBAVCODEC_VERSION_MAJOR 52
#define LIBAVCODEC_VERSION_MINOR 78
-#define LIBAVCODEC_VERSION_MICRO 0
+#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavcodec/colorspace.h b/libavcodec/colorspace.h
deleted file mode 100644
index 4ec081e9d2..0000000000
--- a/libavcodec/colorspace.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Colorspace conversion defines
- * Copyright (c) 2001, 2002, 2003 Fabrice Bellard
- *
- * 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
- * Various defines for YUV<->RGB conversion
- */
-
-#ifndef AVCODEC_COLORSPACE_H
-#define AVCODEC_COLORSPACE_H
-
-#define SCALEBITS 10
-#define ONE_HALF (1 << (SCALEBITS - 1))
-#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
-
-#define YUV_TO_RGB1_CCIR(cb1, cr1)\
-{\
- cb = (cb1) - 128;\
- cr = (cr1) - 128;\
- r_add = FIX(1.40200*255.0/224.0) * cr + ONE_HALF;\
- g_add = - FIX(0.34414*255.0/224.0) * cb - FIX(0.71414*255.0/224.0) * cr + \
- ONE_HALF;\
- b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
-}
-
-#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
-{\
- y = ((y1) - 16) * FIX(255.0/219.0);\
- r = cm[(y + r_add) >> SCALEBITS];\
- g = cm[(y + g_add) >> SCALEBITS];\
- b = cm[(y + b_add) >> SCALEBITS];\
-}
-
-#define YUV_TO_RGB1(cb1, cr1)\
-{\
- cb = (cb1) - 128;\
- cr = (cr1) - 128;\
- r_add = FIX(1.40200) * cr + ONE_HALF;\
- g_add = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\
- b_add = FIX(1.77200) * cb + ONE_HALF;\
-}
-
-#define YUV_TO_RGB2(r, g, b, y1)\
-{\
- y = (y1) << SCALEBITS;\
- r = cm[(y + r_add) >> SCALEBITS];\
- g = cm[(y + g_add) >> SCALEBITS];\
- b = cm[(y + b_add) >> SCALEBITS];\
-}
-
-#define Y_CCIR_TO_JPEG(y)\
- cm[((y) * FIX(255.0/219.0) + (ONE_HALF - 16 * FIX(255.0/219.0))) >> SCALEBITS]
-
-#define Y_JPEG_TO_CCIR(y)\
- (((y) * FIX(219.0/255.0) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
-
-#define C_CCIR_TO_JPEG(y)\
- cm[(((y) - 128) * FIX(127.0/112.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS]
-
-/* NOTE: the clamp is really necessary! */
-static inline int C_JPEG_TO_CCIR(int y) {
- y = (((y - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS);
- if (y < 16)
- y = 16;
- return y;
-}
-
-
-#define RGB_TO_Y(r, g, b) \
-((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \
- FIX(0.11400) * (b) + ONE_HALF) >> SCALEBITS)
-
-#define RGB_TO_U(r1, g1, b1, shift)\
-(((- FIX(0.16874) * r1 - FIX(0.33126) * g1 + \
- FIX(0.50000) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_V(r1, g1, b1, shift)\
-(((FIX(0.50000) * r1 - FIX(0.41869) * g1 - \
- FIX(0.08131) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_Y_CCIR(r, g, b) \
-((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \
- FIX(0.11400*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
-
-#define RGB_TO_U_CCIR(r1, g1, b1, shift)\
-(((- FIX(0.16874*224.0/255.0) * r1 - FIX(0.33126*224.0/255.0) * g1 + \
- FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_V_CCIR(r1, g1, b1, shift)\
-(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.41869*224.0/255.0) * g1 - \
- FIX(0.08131*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#endif /* AVCODEC_COLORSPACE_H */
diff --git a/libavcodec/dvbsub.c b/libavcodec/dvbsub.c
index 0f098266d8..ea55cae317 100644
--- a/libavcodec/dvbsub.c
+++ b/libavcodec/dvbsub.c
@@ -20,7 +20,7 @@
*/
#include "avcodec.h"
#include "bytestream.h"
-#include "colorspace.h"
+#include "libavutil/colorspace.h"
typedef struct DVBSubtitleContext {
int hide_state;
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index a815056c7a..820db53e09 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -21,8 +21,8 @@
#include "avcodec.h"
#include "dsputil.h"
#include "get_bits.h"
-#include "colorspace.h"
#include "bytestream.h"
+#include "libavutil/colorspace.h"
//#define DEBUG
//#define DEBUG_PACKET_CONTENTS
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 75b52566d3..98b766e653 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -20,8 +20,8 @@
*/
#include "avcodec.h"
#include "get_bits.h"
-#include "colorspace.h"
#include "dsputil.h"
+#include "libavutil/colorspace.h"
//#define DEBUG
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 4984f2cb1b..68f1a75746 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -32,9 +32,9 @@
#include "avcodec.h"
#include "dsputil.h"
-#include "colorspace.h"
#include "internal.h"
#include "imgconvert.h"
+#include "libavutil/colorspace.h"
#include "libavutil/pixdesc.h"
#if HAVE_MMX
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index ef7c4f8148..bf2de6ace2 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -26,8 +26,8 @@
#include "avcodec.h"
#include "dsputil.h"
-#include "colorspace.h"
#include "bytestream.h"
+#include "libavutil/colorspace.h"
//#define DEBUG_PACKET_CONTENTS