mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers.
This commit is contained in:
parent
0fb5193156
commit
df91d09174
@ -362,10 +362,13 @@ static inline void yuv2yuvX_c(SwsContext *c, const int16_t *lumFilter,
|
|||||||
static inline void yuv2nv12X_c(SwsContext *c, const int16_t *lumFilter,
|
static inline void yuv2nv12X_c(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc, int chrFilterSize,
|
||||||
int chrFilterSize, uint8_t *dest, uint8_t *uDest,
|
const int16_t **alpSrc, uint8_t *dest, uint8_t *uDest,
|
||||||
int dstW, int chrDstW, enum PixelFormat dstFormat)
|
uint8_t *vDest, uint8_t *aDest,
|
||||||
|
int dstW, int chrDstW)
|
||||||
{
|
{
|
||||||
|
enum PixelFormat dstFormat = c->dstFormat;
|
||||||
|
|
||||||
//FIXME Optimize (just quickly written not optimized..)
|
//FIXME Optimize (just quickly written not optimized..)
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<dstW; i++) {
|
for (i=0; i<dstW; i++) {
|
||||||
@ -1743,14 +1746,7 @@ static int swScale(SwsContext *c, const uint8_t* src[],
|
|||||||
const int16_t **chrUSrcPtr= (const int16_t **) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
|
const int16_t **chrUSrcPtr= (const int16_t **) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
|
||||||
const int16_t **chrVSrcPtr= (const int16_t **) chrVPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
|
const int16_t **chrVSrcPtr= (const int16_t **) chrVPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
|
||||||
const int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? (const int16_t **) alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL;
|
const int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? (const int16_t **) alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL;
|
||||||
if (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21) {
|
if (isPlanarYUV(dstFormat) || dstFormat==PIX_FMT_GRAY8) { //YV12 like
|
||||||
const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
|
|
||||||
if (dstY&chrSkipMask) uDest= NULL; //FIXME split functions in lumi / chromi
|
|
||||||
c->yuv2nv12X(c,
|
|
||||||
vLumFilter+dstY*vLumFilterSize , lumSrcPtr, vLumFilterSize,
|
|
||||||
vChrFilter+chrDstY*vChrFilterSize, chrUSrcPtr, chrVSrcPtr, vChrFilterSize,
|
|
||||||
dest, uDest, dstW, chrDstW, dstFormat);
|
|
||||||
} else if (isPlanarYUV(dstFormat) || dstFormat==PIX_FMT_GRAY8) { //YV12 like
|
|
||||||
const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
|
const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
|
||||||
if ((dstY&chrSkipMask) || isGray(dstFormat)) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
|
if ((dstY&chrSkipMask) || isGray(dstFormat)) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
|
||||||
if (c->yuv2yuv1 && vLumFilterSize == 1 && vChrFilterSize == 1) { // unscaled YV12
|
if (c->yuv2yuv1 && vLumFilterSize == 1 && vChrFilterSize == 1) { // unscaled YV12
|
||||||
@ -1805,8 +1801,8 @@ static int swScale(SwsContext *c, const uint8_t* src[],
|
|||||||
yuv2nv12X_c(c, vLumFilter+dstY*vLumFilterSize,
|
yuv2nv12X_c(c, vLumFilter+dstY*vLumFilterSize,
|
||||||
lumSrcPtr, vLumFilterSize,
|
lumSrcPtr, vLumFilterSize,
|
||||||
vChrFilter+chrDstY*vChrFilterSize,
|
vChrFilter+chrDstY*vChrFilterSize,
|
||||||
chrUSrcPtr, chrVSrcPtr, vChrFilterSize,
|
chrUSrcPtr, chrVSrcPtr, vChrFilterSize, NULL,
|
||||||
dest, uDest, dstW, chrDstW, dstFormat);
|
dest, uDest, NULL, NULL, dstW, chrDstW);
|
||||||
} else if (isPlanarYUV(dstFormat) || dstFormat==PIX_FMT_GRAY8) { //YV12
|
} else if (isPlanarYUV(dstFormat) || dstFormat==PIX_FMT_GRAY8) { //YV12
|
||||||
const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
|
const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
|
||||||
if ((dstY&chrSkipMask) || isGray(dstFormat)) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
|
if ((dstY&chrSkipMask) || isGray(dstFormat)) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
|
||||||
@ -1865,8 +1861,9 @@ static void sws_init_swScale_c(SwsContext *c)
|
|||||||
enum PixelFormat srcFormat = c->srcFormat,
|
enum PixelFormat srcFormat = c->srcFormat,
|
||||||
dstFormat = c->dstFormat;
|
dstFormat = c->dstFormat;
|
||||||
|
|
||||||
c->yuv2nv12X = yuv2nv12X_c;
|
if (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21) {
|
||||||
if (is16BPS(dstFormat)) {
|
c->yuv2yuvX = yuv2nv12X_c;
|
||||||
|
} else if (is16BPS(dstFormat)) {
|
||||||
c->yuv2yuvX = isBE(dstFormat) ? yuv2yuvX16BE_c : yuv2yuvX16LE_c;
|
c->yuv2yuvX = isBE(dstFormat) ? yuv2yuvX16BE_c : yuv2yuvX16LE_c;
|
||||||
} else if (is9_OR_10BPS(dstFormat)) {
|
} else if (is9_OR_10BPS(dstFormat)) {
|
||||||
if (dstFormat == PIX_FMT_YUV420P9BE || dstFormat == PIX_FMT_YUV420P9LE) {
|
if (dstFormat == PIX_FMT_YUV420P9BE || dstFormat == PIX_FMT_YUV420P9LE) {
|
||||||
|
@ -250,12 +250,6 @@ typedef struct SwsContext {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* function pointers for swScale() */
|
/* function pointers for swScale() */
|
||||||
void (*yuv2nv12X )(struct SwsContext *c,
|
|
||||||
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
|
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
|
||||||
const int16_t **chrVSrc, int chrFilterSize,
|
|
||||||
uint8_t *dest, uint8_t *uDest,
|
|
||||||
int dstW, int chrDstW, int dstFormat);
|
|
||||||
void (*yuv2yuv1 )(struct SwsContext *c,
|
void (*yuv2yuv1 )(struct SwsContext *c,
|
||||||
const int16_t *lumSrc, const int16_t *chrUSrc,
|
const int16_t *lumSrc, const int16_t *chrUSrc,
|
||||||
const int16_t *chrVSrc, const int16_t *alpSrc,
|
const int16_t *chrVSrc, const int16_t *alpSrc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user