mirror of https://github.com/mpv-player/mpv
Add function to translate SWS_CS_* to coefficient array
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30513 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
2762207eed
commit
2e9988220c
|
@ -30,7 +30,7 @@
|
||||||
#include "libavutil/avutil.h"
|
#include "libavutil/avutil.h"
|
||||||
|
|
||||||
#define LIBSWSCALE_VERSION_MAJOR 0
|
#define LIBSWSCALE_VERSION_MAJOR 0
|
||||||
#define LIBSWSCALE_VERSION_MINOR 9
|
#define LIBSWSCALE_VERSION_MINOR 10
|
||||||
#define LIBSWSCALE_VERSION_MICRO 0
|
#define LIBSWSCALE_VERSION_MICRO 0
|
||||||
|
|
||||||
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
|
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
|
||||||
|
@ -103,6 +103,12 @@ const char *swscale_license(void);
|
||||||
#define SWS_CS_SMPTE240M 7
|
#define SWS_CS_SMPTE240M 7
|
||||||
#define SWS_CS_DEFAULT 5
|
#define SWS_CS_DEFAULT 5
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pointer to yuv<->rgb coefficients for the given colorspace
|
||||||
|
* suitable for sws_setColorspaceDetails()
|
||||||
|
* @colorspace one of SWS_CS_* If invalid, SWS_CS_DEFAULT is used.
|
||||||
|
*/
|
||||||
|
const int * sws_getCoefficients(int colorspace);
|
||||||
|
|
||||||
|
|
||||||
// when used for filters they must have an odd number of elements
|
// when used for filters they must have an odd number of elements
|
||||||
|
|
|
@ -49,6 +49,13 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = {
|
||||||
{117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */
|
{117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int * sws_getCoefficients(int colorspace)
|
||||||
|
{
|
||||||
|
if (colorspace > 7 || colorspace < 0)
|
||||||
|
colorspace = SWS_CS_DEFAULT;
|
||||||
|
return ff_yuv2rgb_coeffs[colorspace];
|
||||||
|
}
|
||||||
|
|
||||||
#define LOADCHROMA(i) \
|
#define LOADCHROMA(i) \
|
||||||
U = pu[i]; \
|
U = pu[i]; \
|
||||||
V = pv[i]; \
|
V = pv[i]; \
|
||||||
|
|
Loading…
Reference in New Issue