Commit 6b6a2294 authored by zuxy's avatar zuxy

Const correctness for src pointer. Remove all constness related warnings in

libswscale.


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@30306 b3059339-0415-0410-9bf9-f77b7e298cf2
parent c0976dd0
...@@ -74,7 +74,7 @@ void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *v ...@@ -74,7 +74,7 @@ void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *v
long lumStride, long chromStride, long srcStride); long lumStride, long chromStride, long srcStride);
void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height, void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
long srcStride, long dstStride); long srcStride, long dstStride);
void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst, void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
long width, long height, long src1Stride, long width, long height, long src1Stride,
long src2Stride, long dstStride); long src2Stride, long dstStride);
void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
......
...@@ -126,7 +126,7 @@ extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uin ...@@ -126,7 +126,7 @@ extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uin
extern void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height, extern void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
long srcStride, long dstStride); long srcStride, long dstStride);
extern void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst, extern void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
long width, long height, long src1Stride, long width, long height, long src1Stride,
long src2Stride, long dstStride); long src2Stride, long dstStride);
......
...@@ -2352,7 +2352,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ ...@@ -2352,7 +2352,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
} }
} }
static void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest, static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest,
long width, long height, long src1Stride, long width, long height, long src1Stride,
long src2Stride, long dstStride) long src2Stride, long dstStride)
{ {
......
This diff is collapsed.
...@@ -184,13 +184,13 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat ...@@ -184,13 +184,13 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat
* the destination image * the destination image
* @return the height of the output slice * @return the height of the output slice
*/ */
int sws_scale(struct SwsContext *context, uint8_t* srcSlice[], int srcStride[], int sws_scale(struct SwsContext *context, const uint8_t* srcSlice[], int srcStride[],
int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]); int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]);
#if LIBSWSCALE_VERSION_MAJOR < 1 #if LIBSWSCALE_VERSION_MAJOR < 1
/** /**
* @deprecated Use sws_scale() instead. * @deprecated Use sws_scale() instead.
*/ */
int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int sws_scale_ordered(struct SwsContext *context, const uint8_t* src[],
int srcStride[], int srcSliceY, int srcSliceH, int srcStride[], int srcSliceY, int srcSliceH,
uint8_t* dst[], int dstStride[]) attribute_deprecated; uint8_t* dst[], int dstStride[]) attribute_deprecated;
#endif #endif
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
struct SwsContext; struct SwsContext;
typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t* src[],
int srcStride[], int srcSliceY, int srcSliceH, int srcStride[], int srcSliceY, int srcSliceH,
uint8_t* dst[], int dstStride[]); uint8_t* dst[], int dstStride[]);
......
...@@ -954,7 +954,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, const ...@@ -954,7 +954,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, const
#if COMPILE_TEMPLATE_MMX #if COMPILE_TEMPLATE_MMX
if(!(c->flags & SWS_BITEXACT)) { if(!(c->flags & SWS_BITEXACT)) {
long p= 4; long p= 4;
uint8_t *src[4]= {alpSrc + dstW, lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW}; const uint8_t *src[4]= {alpSrc + dstW, lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW};
uint8_t *dst[4]= {aDest, dest, uDest, vDest}; uint8_t *dst[4]= {aDest, dest, uDest, vDest};
x86_reg counter[4]= {dstW, dstW, chrDstW, chrDstW}; x86_reg counter[4]= {dstW, dstW, chrDstW, chrDstW};
...@@ -1235,8 +1235,8 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, const uint16_t *buf0, cons ...@@ -1235,8 +1235,8 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, const uint16_t *buf0, cons
: "%r8" : "%r8"
); );
#else #else
*(uint16_t **)(&c->u_temp)=abuf0; *(const uint16_t **)(&c->u_temp)=abuf0;
*(uint16_t **)(&c->v_temp)=abuf1; *(const uint16_t **)(&c->v_temp)=abuf1;
__asm__ volatile( __asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t" "mov %4, %%"REG_b" \n\t"
...@@ -2145,7 +2145,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, in ...@@ -2145,7 +2145,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, in
#endif #endif
); );
} else { } else {
uint8_t *offset = src+filterSize; const uint8_t *offset = src+filterSize;
x86_reg counter= -2*dstW; x86_reg counter= -2*dstW;
//filter-= counter*filterSize/2; //filter-= counter*filterSize/2;
filterPos-= counter/2; filterPos-= counter/2;
...@@ -2554,7 +2554,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, ...@@ -2554,7 +2554,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth,
#define DEBUG_SWSCALE_BUFFERS 0 #define DEBUG_SWSCALE_BUFFERS 0
#define DEBUG_BUFFERS(...) if (DEBUG_SWSCALE_BUFFERS) av_log(c, AV_LOG_DEBUG, __VA_ARGS__) #define DEBUG_BUFFERS(...) if (DEBUG_SWSCALE_BUFFERS) av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
/* load a few things into local vars to make the code more readable? and faster */ /* load a few things into local vars to make the code more readable? and faster */
...@@ -2677,8 +2677,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s ...@@ -2677,8 +2677,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
//Do horizontal scaling //Do horizontal scaling
while(lastInLumBuf < lastLumSrcY) { while(lastInLumBuf < lastLumSrcY) {
uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0]; const uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3]; const uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3];
lumBufIndex++; lumBufIndex++;
DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n", DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n",
lumBufIndex, lastInLumBuf); lumBufIndex, lastInLumBuf);
...@@ -2697,8 +2697,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s ...@@ -2697,8 +2697,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
lastInLumBuf++; lastInLumBuf++;
} }
while(lastInChrBuf < lastChrSrcY) { while(lastInChrBuf < lastChrSrcY) {
uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1]; const uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1];
uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2]; const uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2];
chrBufIndex++; chrBufIndex++;
DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n", DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n",
chrBufIndex, lastInChrBuf); chrBufIndex, lastInChrBuf);
...@@ -2737,21 +2737,21 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s ...@@ -2737,21 +2737,21 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
if (flags & SWS_ACCURATE_RND) { if (flags & SWS_ACCURATE_RND) {
int s= APCK_SIZE / 8; int s= APCK_SIZE / 8;
for (i=0; i<vLumFilterSize; i+=2) { for (i=0; i<vLumFilterSize; i+=2) {
*(void**)&lumMmxFilter[s*i ]= lumSrcPtr[i ]; *(const void**)&lumMmxFilter[s*i ]= lumSrcPtr[i ];
*(void**)&lumMmxFilter[s*i+APCK_PTR2/4 ]= lumSrcPtr[i+(vLumFilterSize>1)]; *(const void**)&lumMmxFilter[s*i+APCK_PTR2/4 ]= lumSrcPtr[i+(vLumFilterSize>1)];
lumMmxFilter[s*i+APCK_COEF/4 ]= lumMmxFilter[s*i+APCK_COEF/4 ]=
lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i ] lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i ]
+ (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1]<<16 : 0); + (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1]<<16 : 0);
if (CONFIG_SWSCALE_ALPHA && alpPixBuf) { if (CONFIG_SWSCALE_ALPHA && alpPixBuf) {
*(void**)&alpMmxFilter[s*i ]= alpSrcPtr[i ]; *(const void**)&alpMmxFilter[s*i ]= alpSrcPtr[i ];
*(void**)&alpMmxFilter[s*i+APCK_PTR2/4 ]= alpSrcPtr[i+(vLumFilterSize>1)]; *(const void**)&alpMmxFilter[s*i+APCK_PTR2/4 ]= alpSrcPtr[i+(vLumFilterSize>1)];
alpMmxFilter[s*i+APCK_COEF/4 ]= alpMmxFilter[s*i+APCK_COEF/4 ]=
alpMmxFilter[s*i+APCK_COEF/4+1]= lumMmxFilter[s*i+APCK_COEF/4 ]; alpMmxFilter[s*i+APCK_COEF/4+1]= lumMmxFilter[s*i+APCK_COEF/4 ];
} }
} }
for (i=0; i<vChrFilterSize; i+=2) { for (i=0; i<vChrFilterSize; i+=2) {
*(void**)&chrMmxFilter[s*i ]= chrSrcPtr[i ]; *(const void**)&chrMmxFilter[s*i ]= chrSrcPtr[i ];
*(void**)&chrMmxFilter[s*i+APCK_PTR2/4 ]= chrSrcPtr[i+(vChrFilterSize>1)]; *(const void**)&chrMmxFilter[s*i+APCK_PTR2/4 ]= chrSrcPtr[i+(vChrFilterSize>1)];
chrMmxFilter[s*i+APCK_COEF/4 ]= chrMmxFilter[s*i+APCK_COEF/4 ]=
chrMmxFilter[s*i+APCK_COEF/4+1]= vChrFilter[chrDstY*vChrFilterSize + i ] chrMmxFilter[s*i+APCK_COEF/4+1]= vChrFilter[chrDstY*vChrFilterSize + i ]
+ (vChrFilterSize>1 ? vChrFilter[chrDstY*vChrFilterSize + i + 1]<<16 : 0); + (vChrFilterSize>1 ? vChrFilter[chrDstY*vChrFilterSize + i + 1]<<16 : 0);
...@@ -2796,9 +2796,9 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s ...@@ -2796,9 +2796,9 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
alpSrcPtr, (uint16_t *) dest, (uint16_t *) uDest, (uint16_t *) vDest, (uint16_t *) aDest, dstW, chrDstW, alpSrcPtr, (uint16_t *) dest, (uint16_t *) uDest, (uint16_t *) vDest, (uint16_t *) aDest, dstW, chrDstW,
dstFormat); dstFormat);
} else if (vLumFilterSize == 1 && vChrFilterSize == 1) { // unscaled YV12 } else if (vLumFilterSize == 1 && vChrFilterSize == 1) { // unscaled YV12
int16_t *lumBuf = lumSrcPtr[0]; const int16_t *lumBuf = lumSrcPtr[0];
int16_t *chrBuf= chrSrcPtr[0]; const int16_t *chrBuf= chrSrcPtr[0];
int16_t *alpBuf= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpSrcPtr[0] : NULL; const int16_t *alpBuf= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpSrcPtr[0] : NULL;
c->yuv2yuv1(c, lumBuf, chrBuf, alpBuf, dest, uDest, vDest, aDest, dstW, chrDstW); c->yuv2yuv1(c, lumBuf, chrBuf, alpBuf, dest, uDest, vDest, aDest, dstW, chrDstW);
} else { //General YV12 } else { //General YV12
c->yuv2yuvX(c, c->yuv2yuvX(c,
......
...@@ -134,9 +134,9 @@ ...@@ -134,9 +134,9 @@
__asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); \ __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); \
for (y= 0; y<srcSliceH; y++ ) { \ for (y= 0; y<srcSliceH; y++ ) { \
uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; \ uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; \
uint8_t *py = src[0] + y*srcStride[0]; \ const uint8_t *py = src[0] + y*srcStride[0]; \
uint8_t *pu = src[1] + (y>>1)*srcStride[1]; \ const uint8_t *pu = src[1] + (y>>1)*srcStride[1]; \
uint8_t *pv = src[2] + (y>>1)*srcStride[2]; \ const uint8_t *pv = src[2] + (y>>1)*srcStride[2]; \
x86_reg index= -h_size/2; \ x86_reg index= -h_size/2; \
#define YUV2RGB_INIT \ #define YUV2RGB_INIT \
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
__asm__ volatile (SFENCE"\n\t"EMMS); \ __asm__ volatile (SFENCE"\n\t"EMMS); \
return srcSliceH; \ return srcSliceH; \
static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
int y, h_size; int y, h_size;
...@@ -236,7 +236,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -236,7 +236,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr
YUV2RGB_OPERANDS YUV2RGB_OPERANDS
} }
static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuv420_rgb15)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
int y, h_size; int y, h_size;
...@@ -396,7 +396,7 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -396,7 +396,7 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr
"pxor %%mm4, %%mm4 \n\t" "pxor %%mm4, %%mm4 \n\t"
#endif #endif
static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuv420_rgb24)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
int y, h_size; int y, h_size;
...@@ -413,7 +413,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -413,7 +413,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
YUV2RGB_OPERANDS YUV2RGB_OPERANDS
} }
static inline int RENAME(yuv420_bgr24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
int y, h_size; int y, h_size;
...@@ -491,7 +491,7 @@ etc. ...@@ -491,7 +491,7 @@ etc.
"pxor %%mm4, %%mm4;" /* zero mm4 */ \ "pxor %%mm4, %%mm4;" /* zero mm4 */ \
"movq 8 (%5, %0, 2), %%mm6;" /* Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */ \ "movq 8 (%5, %0, 2), %%mm6;" /* Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */ \
static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
int y, h_size; int y, h_size;
...@@ -508,7 +508,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -508,7 +508,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr
YUV2RGB_OPERANDS YUV2RGB_OPERANDS
} }
static inline int RENAME(yuva420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuva420_rgb32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
#if HAVE_7REGS #if HAVE_7REGS
...@@ -516,7 +516,7 @@ static inline int RENAME(yuva420_rgb32)(SwsContext *c, uint8_t* src[], int srcSt ...@@ -516,7 +516,7 @@ static inline int RENAME(yuva420_rgb32)(SwsContext *c, uint8_t* src[], int srcSt
YUV2RGB_LOOP(4) YUV2RGB_LOOP(4)
uint8_t *pa = src[3] + y*srcStride[3]; const uint8_t *pa = src[3] + y*srcStride[3];
YUV2RGB_INIT YUV2RGB_INIT
YUV2RGB YUV2RGB
"movq (%6, %0, 2), %%mm3;" /* Load 8 A A7 A6 A5 A4 A3 A2 A1 A0 */ "movq (%6, %0, 2), %%mm3;" /* Load 8 A A7 A6 A5 A4 A3 A2 A1 A0 */
...@@ -527,7 +527,7 @@ static inline int RENAME(yuva420_rgb32)(SwsContext *c, uint8_t* src[], int srcSt ...@@ -527,7 +527,7 @@ static inline int RENAME(yuva420_rgb32)(SwsContext *c, uint8_t* src[], int srcSt
#endif #endif
} }
static inline int RENAME(yuv420_bgr32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuv420_bgr32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
int y, h_size; int y, h_size;
...@@ -544,7 +544,7 @@ static inline int RENAME(yuv420_bgr32)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -544,7 +544,7 @@ static inline int RENAME(yuv420_bgr32)(SwsContext *c, uint8_t* src[], int srcStr
YUV2RGB_OPERANDS YUV2RGB_OPERANDS
} }
static inline int RENAME(yuva420_bgr32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
#if HAVE_7REGS #if HAVE_7REGS
...@@ -552,7 +552,7 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, uint8_t* src[], int srcSt ...@@ -552,7 +552,7 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, uint8_t* src[], int srcSt
YUV2RGB_LOOP(4) YUV2RGB_LOOP(4)
uint8_t *pa = src[3] + y*srcStride[3]; const uint8_t *pa = src[3] + y*srcStride[3];
YUV2RGB_INIT YUV2RGB_INIT
YUV2RGB YUV2RGB
"movq (%6, %0, 2), %%mm3;" /* Load 8 A A7 A6 A5 A4 A3 A2 A1 A0 */ "movq (%6, %0, 2), %%mm3;" /* Load 8 A A7 A6 A5 A4 A3 A2 A1 A0 */
......
...@@ -91,7 +91,7 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = { ...@@ -91,7 +91,7 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = {
dst[12*i+10] = dst[12*i+11] = b[Y]; dst[12*i+10] = dst[12*i+11] = b[Y];
#define YUV2RGBFUNC(func_name, dst_type, alpha) \ #define YUV2RGBFUNC(func_name, dst_type, alpha) \
static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, \ static int func_name(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, \
int srcSliceH, uint8_t* dst[], int dstStride[]) \ int srcSliceH, uint8_t* dst[], int dstStride[]) \
{\ {\
int y;\ int y;\
...@@ -105,11 +105,11 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic ...@@ -105,11 +105,11 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic
dst_type *dst_2 = (dst_type*)(dst[0] + (y+srcSliceY+1)*dstStride[0]);\ dst_type *dst_2 = (dst_type*)(dst[0] + (y+srcSliceY+1)*dstStride[0]);\
dst_type av_unused *r, *b;\ dst_type av_unused *r, *b;\
dst_type *g;\ dst_type *g;\
uint8_t *py_1 = src[0] + y*srcStride[0];\ const uint8_t *py_1 = src[0] + y*srcStride[0];\
uint8_t *py_2 = py_1 + srcStride[0];\ const uint8_t *py_2 = py_1 + srcStride[0];\
uint8_t *pu = src[1] + (y>>1)*srcStride[1];\ const uint8_t *pu = src[1] + (y>>1)*srcStride[1];\
uint8_t *pv = src[2] + (y>>1)*srcStride[2];\ const uint8_t *pv = src[2] + (y>>1)*srcStride[2];\
uint8_t av_unused *pa_1, *pa_2;\ const uint8_t av_unused *pa_1, *pa_2;\
unsigned int h_size = c->dstW>>3;\ unsigned int h_size = c->dstW>>3;\
if (alpha) {\ if (alpha) {\
pa_1 = src[3] + y*srcStride[3];\ pa_1 = src[3] + y*srcStride[3];\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment