summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/csputils.c19
-rw-r--r--video/csputils.h12
-rw-r--r--video/mp_image.c1
3 files changed, 16 insertions, 16 deletions
diff --git a/video/csputils.c b/video/csputils.c
index 91b7d88ec6..8face3164c 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -31,6 +31,7 @@
#include <math.h>
#include <assert.h>
#include <libavutil/common.h>
+#include <libavcodec/avcodec.h>
#include "csputils.h"
@@ -52,12 +53,12 @@ char * const mp_csp_equalizer_names[MP_CSP_EQ_COUNT] = {
"gamma",
};
-enum mp_csp avcol_spc_to_mp_csp(enum AVColorSpace colorspace)
+enum mp_csp avcol_spc_to_mp_csp(int avcolorspace)
{
- switch (colorspace) {
+ switch (avcolorspace) {
case AVCOL_SPC_BT709: return MP_CSP_BT_709;
case AVCOL_SPC_BT470BG: return MP_CSP_BT_601;
- case AVCOL_SPC_SMPTE170M: return MP_CSP_BT_601;
+ case AVCOL_SPC_SMPTE170M: return MP_CSP_BT_601;
case AVCOL_SPC_SMPTE240M: return MP_CSP_SMPTE_240M;
case AVCOL_SPC_RGB: return MP_CSP_RGB;
case AVCOL_SPC_YCOCG: return MP_CSP_YCGCO;
@@ -65,16 +66,16 @@ enum mp_csp avcol_spc_to_mp_csp(enum AVColorSpace colorspace)
}
}
-enum mp_csp_levels avcol_range_to_mp_csp_levels(enum AVColorRange range)
+enum mp_csp_levels avcol_range_to_mp_csp_levels(int avrange)
{
- switch (range) {
+ switch (avrange) {
case AVCOL_RANGE_MPEG: return MP_CSP_LEVELS_TV;
case AVCOL_RANGE_JPEG: return MP_CSP_LEVELS_PC;
default: return MP_CSP_LEVELS_AUTO;
}
}
-enum AVColorSpace mp_csp_to_avcol_spc(enum mp_csp colorspace)
+int mp_csp_to_avcol_spc(enum mp_csp colorspace)
{
switch (colorspace) {
case MP_CSP_BT_709: return AVCOL_SPC_BT709;
@@ -86,7 +87,7 @@ enum AVColorSpace mp_csp_to_avcol_spc(enum mp_csp colorspace)
}
}
-enum AVColorRange mp_csp_levels_to_avcol_range(enum mp_csp_levels range)
+int mp_csp_levels_to_avcol_range(enum mp_csp_levels range)
{
switch (range) {
case MP_CSP_LEVELS_TV: return AVCOL_RANGE_MPEG;
@@ -100,9 +101,9 @@ enum mp_csp mp_csp_guess_colorspace(int width, int height)
return width >= 1280 || height > 576 ? MP_CSP_BT_709 : MP_CSP_BT_601;
}
-enum mp_chroma_location avchroma_location_to_mp(enum AVChromaLocation loc)
+enum mp_chroma_location avchroma_location_to_mp(int avloc)
{
- switch (loc) {
+ switch (avloc) {
case AVCHROMA_LOC_LEFT: return MP_CHROMA_LEFT;
case AVCHROMA_LOC_CENTER: return MP_CHROMA_CENTER;
default: return MP_CHROMA_AUTO;
diff --git a/video/csputils.h b/video/csputils.h
index af510299cf..7c528d1b86 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -27,8 +27,6 @@
#include <stdbool.h>
#include <stdint.h>
-#include "libavcodec/avcodec.h"
-
/* NOTE: the csp and levels AUTO values are converted to specific ones
* above vf/vo level. At least vf_scale relies on all valid settings being
* nonzero at vf/vo level.
@@ -132,17 +130,17 @@ int mp_csp_equalizer_set(struct mp_csp_equalizer *eq, const char *property,
int mp_csp_equalizer_get(struct mp_csp_equalizer *eq, const char *property,
int *out_value);
-enum mp_csp avcol_spc_to_mp_csp(enum AVColorSpace colorspace);
+enum mp_csp avcol_spc_to_mp_csp(int avcolorspace);
-enum mp_csp_levels avcol_range_to_mp_csp_levels(enum AVColorRange range);
+enum mp_csp_levels avcol_range_to_mp_csp_levels(int avrange);
-enum AVColorSpace mp_csp_to_avcol_spc(enum mp_csp colorspace);
+int mp_csp_to_avcol_spc(enum mp_csp colorspace);
-enum AVColorRange mp_csp_levels_to_avcol_range(enum mp_csp_levels range);
+int mp_csp_levels_to_avcol_range(enum mp_csp_levels range);
enum mp_csp mp_csp_guess_colorspace(int width, int height);
-enum mp_chroma_location avchroma_location_to_mp(enum AVChromaLocation loc);
+enum mp_chroma_location avchroma_location_to_mp(int avloc);
void mp_get_chroma_location(enum mp_chroma_location loc, int *x, int *y);
diff --git a/video/mp_image.c b/video/mp_image.c
index 95b59eae28..d395fcf572 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -26,6 +26,7 @@
#include <libavutil/mem.h>
#include <libavutil/common.h>
#include <libavutil/bswap.h>
+#include <libavcodec/avcodec.h>
#include "talloc.h"