@@ -3813,7 +3813,7 @@ swresample_suggest="libm libsoxr stdatomic"
swscale_deps="avutil"
swscale_suggest="libm stdatomic"
-avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs"
+avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs lcms2_extralibs"
avfilter_extralibs="pthreads_extralibs"
avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs"
@@ -114,6 +114,7 @@ OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o msmpeg4data.o
OBJS-$(CONFIG_IVIDSP) += ivi_dsp.o
OBJS-$(CONFIG_JNI) += ffjni.o jni.o
OBJS-$(CONFIG_JPEGTABLES) += jpegtables.o
+OBJS-$(CONFIG_LCMS2) += fflcms2.o
OBJS-$(CONFIG_LLAUDDSP) += lossless_audiodsp.o
OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o
OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o
@@ -481,6 +481,10 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_channel_layout_uninit(&avci->initial_ch_layout);
+#if CONFIG_LCMS2
+ ff_icc_context_uninit(&avci->icc);
+#endif
+
av_freep(&avctx->internal);
}
@@ -49,6 +49,10 @@
#include "internal.h"
#include "thread.h"
+#if CONFIG_LCMS2
+# include "fflcms2.h"
+#endif
+
static int apply_param_change(AVCodecContext *avctx, const AVPacket *avpkt)
{
int ret;
@@ -33,6 +33,10 @@
#include "avcodec.h"
#include "config.h"
+#if CONFIG_LCMS2
+# include "fflcms2.h"
+#endif
+
#define FF_SANE_NB_CHANNELS 512U
#if HAVE_SIMD_ALIGN_64
@@ -148,6 +152,10 @@ typedef struct AVCodecInternal {
uint64_t initial_channel_layout;
#endif
AVChannelLayout initial_ch_layout;
+
+#if CONFIG_LCMS2
+ FFIccContext icc; /* used to read and write embedded ICC profiles */
+#endif
} AVCodecInternal;
/**