Revision a959e247

View differences:

libswscale/rgb2rgb.c
74 74
                    long lumStride, long chromStride, long srcStride);
75 75
void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
76 76
                 long srcStride, long dstStride);
77
void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst,
77
void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
78 78
                        long width, long height, long src1Stride,
79 79
                        long src2Stride, long dstStride);
80 80
void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
libswscale/rgb2rgb.h
126 126
extern void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
127 127
                        long srcStride, long dstStride);
128 128

  
129
extern void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst,
129
extern void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
130 130
                               long width, long height, long src1Stride,
131 131
                               long src2Stride, long dstStride);
132 132

  
libswscale/rgb2rgb_template.c
2352 2352
    }
2353 2353
}
2354 2354

  
2355
static void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
2355
static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest,
2356 2356
                             long width, long height, long src1Stride,
2357 2357
                             long src2Stride, long dstStride)
2358 2358
{
libswscale/swscale.c
1901 1901
#endif //!CONFIG_RUNTIME_CPUDETECT
1902 1902
}
1903 1903

  
1904
static int PlanarToNV12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1904
static int PlanarToNV12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1905 1905
                               int srcSliceH, uint8_t* dstParam[], int dstStride[])
1906 1906
{
1907 1907
    uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY;
......
1927 1927
    return srcSliceH;
1928 1928
}
1929 1929

  
1930
static int PlanarToYuy2Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1930
static int PlanarToYuy2Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1931 1931
                               int srcSliceH, uint8_t* dstParam[], int dstStride[])
1932 1932
{
1933 1933
    uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY;
......
1937 1937
    return srcSliceH;
1938 1938
}
1939 1939

  
1940
static int PlanarToUyvyWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1940
static int PlanarToUyvyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1941 1941
                               int srcSliceH, uint8_t* dstParam[], int dstStride[])
1942 1942
{
1943 1943
    uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY;
......
1947 1947
    return srcSliceH;
1948 1948
}
1949 1949

  
1950
static int YUV422PToYuy2Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1950
static int YUV422PToYuy2Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1951 1951
                                int srcSliceH, uint8_t* dstParam[], int dstStride[])
1952 1952
{
1953 1953
    uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY;
......
1957 1957
    return srcSliceH;
1958 1958
}
1959 1959

  
1960
static int YUV422PToUyvyWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1960
static int YUV422PToUyvyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1961 1961
                                int srcSliceH, uint8_t* dstParam[], int dstStride[])
1962 1962
{
1963 1963
    uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY;
......
1967 1967
    return srcSliceH;
1968 1968
}
1969 1969

  
1970
static int YUYV2YUV420Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1970
static int YUYV2YUV420Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1971 1971
                               int srcSliceH, uint8_t* dstParam[], int dstStride[])
1972 1972
{
1973 1973
    uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
......
1982 1982
    return srcSliceH;
1983 1983
}
1984 1984

  
1985
static int YUYV2YUV422Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1985
static int YUYV2YUV422Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1986 1986
                               int srcSliceH, uint8_t* dstParam[], int dstStride[])
1987 1987
{
1988 1988
    uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
......
1994 1994
    return srcSliceH;
1995 1995
}
1996 1996

  
1997
static int UYVY2YUV420Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
1997
static int UYVY2YUV420Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
1998 1998
                               int srcSliceH, uint8_t* dstParam[], int dstStride[])
1999 1999
{
2000 2000
    uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
......
2009 2009
    return srcSliceH;
2010 2010
}
2011 2011

  
2012
static int UYVY2YUV422Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2012
static int UYVY2YUV422Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2013 2013
                               int srcSliceH, uint8_t* dstParam[], int dstStride[])
2014 2014
{
2015 2015
    uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
......
2021 2021
    return srcSliceH;
2022 2022
}
2023 2023

  
2024
static int pal2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2024
static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2025 2025
                          int srcSliceH, uint8_t* dst[], int dstStride[])
2026 2026
{
2027 2027
    const enum PixelFormat srcFormat= c->srcFormat;
......
2030 2030
                 const uint8_t *palette)=NULL;
2031 2031
    int i;
2032 2032
    uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
2033
    uint8_t *srcPtr= src[0];
2033
    const uint8_t *srcPtr= src[0];
2034 2034

  
2035 2035
    if (!usePal(srcFormat))
2036 2036
        av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
......
2058 2058
}
2059 2059

  
2060 2060
/* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
2061
static int rgb2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2061
static int rgb2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2062 2062
                          int srcSliceH, uint8_t* dst[], int dstStride[])
2063 2063
{
2064 2064
    const enum PixelFormat srcFormat= c->srcFormat;
......
2116 2116
    }
2117 2117

  
2118 2118
    if(conv) {
2119
        uint8_t *srcPtr= src[0];
2119
        const uint8_t *srcPtr= src[0];
2120 2120
        if(srcFormat == PIX_FMT_RGB32_1 || srcFormat == PIX_FMT_BGR32_1)
2121 2121
            srcPtr += ALT32_CORR;
2122 2122

  
......
2136 2136
    return srcSliceH;
2137 2137
}
2138 2138

  
2139
static int bgr24toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2139
static int bgr24toyv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2140 2140
                              int srcSliceH, uint8_t* dst[], int dstStride[])
2141 2141
{
2142 2142

  
......
2152 2152
    return srcSliceH;
2153 2153
}
2154 2154

  
2155
static int yvu9toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2155
static int yvu9toyv12Wrapper(SwsContext *c, const const uint8_t* src[], int srcStride[], int srcSliceY,
2156 2156
                             int srcSliceH, uint8_t* dst[], int dstStride[])
2157 2157
{
2158 2158
    int i;
......
2161 2161
    if (srcStride[0]==dstStride[0] && srcStride[0] > 0)
2162 2162
        memcpy(dst[0]+ srcSliceY*dstStride[0], src[0], srcStride[0]*srcSliceH);
2163 2163
    else {
2164
        uint8_t *srcPtr= src[0];
2164
        const uint8_t *srcPtr= src[0];
2165 2165
        uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
2166 2166

  
2167 2167
        for (i=0; i<srcSliceH; i++) {
......
2188 2188
}
2189 2189

  
2190 2190
/* unscaled copy like stuff (assumes nearly identical formats) */
2191
static int packedCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2191
static int packedCopy(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2192 2192
                      int srcSliceH, uint8_t* dst[], int dstStride[])
2193 2193
{
2194 2194
    if (dstStride[0]==srcStride[0] && srcStride[0] > 0)
2195 2195
        memcpy(dst[0] + dstStride[0]*srcSliceY, src[0], srcSliceH*dstStride[0]);
2196 2196
    else {
2197 2197
        int i;
2198
        uint8_t *srcPtr= src[0];
2198
        const uint8_t *srcPtr= src[0];
2199 2199
        uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
2200 2200
        int length=0;
2201 2201

  
......
2213 2213
    return srcSliceH;
2214 2214
}
2215 2215

  
2216
static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2216
static int planarCopy(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2217 2217
                      int srcSliceH, uint8_t* dst[], int dstStride[])
2218 2218
{
2219 2219
    int plane, i, j;
......
2221 2221
        int length= (plane==0 || plane==3) ? c->srcW  : -((-c->srcW  )>>c->chrDstHSubSample);
2222 2222
        int y=      (plane==0 || plane==3) ? srcSliceY: -((-srcSliceY)>>c->chrDstVSubSample);
2223 2223
        int height= (plane==0 || plane==3) ? srcSliceH: -((-srcSliceH)>>c->chrDstVSubSample);
2224
        uint8_t *srcPtr= src[plane];
2224
        const uint8_t *srcPtr= src[plane];
2225 2225
        uint8_t *dstPtr= dst[plane] + dstStride[plane]*y;
2226 2226

  
2227 2227
        if (!dst[plane]) continue;
......
2928 2928
    return NULL;
2929 2929
}
2930 2930

  
2931
static void reset_ptr(uint8_t* src[], int format)
2931
static void reset_ptr(const uint8_t* src[], int format)
2932 2932
{
2933 2933
    if(!isALPHA(format))
2934 2934
        src[3]=NULL;
......
2948 2948
 * swscale wrapper, so we don't need to export the SwsContext.
2949 2949
 * Assumes planar YUV to be in YUV order instead of YVU.
2950 2950
 */
2951
int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2951
int sws_scale(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2952 2952
              int srcSliceH, uint8_t* dst[], int dstStride[])
2953 2953
{
2954 2954
    int i;
2955
    uint8_t* src2[4]= {src[0], src[1], src[2], src[3]};
2955
    const uint8_t* src2[4]= {src[0], src[1], src[2], src[3]};
2956 2956
    uint8_t* dst2[4]= {dst[0], dst[1], dst[2], dst[3]};
2957 2957

  
2958 2958
    // do not mess up sliceDir if we have a "trailing" 0-size slice
......
3035 3035
        int dstStride2[4]= {dstStride[0], dstStride[1], dstStride[2], dstStride[3]};
3036 3036

  
3037 3037
        reset_ptr(src2, c->srcFormat);
3038
        reset_ptr(dst2, c->dstFormat);
3038
        reset_ptr((const uint8_t**)dst2, c->dstFormat);
3039 3039

  
3040 3040
        /* reset slice direction at end of frame */
3041 3041
        if (srcSliceY + srcSliceH == c->srcH)
......
3058 3058
        dst2[3] += ( c->dstH                      -1)*dstStride[3];
3059 3059

  
3060 3060
        reset_ptr(src2, c->srcFormat);
3061
        reset_ptr(dst2, c->dstFormat);
3061
        reset_ptr((const uint8_t**)dst2, c->dstFormat);
3062 3062

  
3063 3063
        /* reset slice direction at end of frame */
3064 3064
        if (!srcSliceY)
......
3069 3069
}
3070 3070

  
3071 3071
#if LIBSWSCALE_VERSION_MAJOR < 1
3072
int sws_scale_ordered(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
3072
int sws_scale_ordered(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
3073 3073
                      int srcSliceH, uint8_t* dst[], int dstStride[])
3074 3074
{
3075 3075
    return sws_scale(c, src, srcStride, srcSliceY, srcSliceH, dst, dstStride);
libswscale/swscale.h
184 184
 *                  the destination image
185 185
 * @return          the height of the output slice
186 186
 */
187
int sws_scale(struct SwsContext *context, uint8_t* srcSlice[], int srcStride[],
187
int sws_scale(struct SwsContext *context, const uint8_t* srcSlice[], int srcStride[],
188 188
              int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]);
189 189
#if LIBSWSCALE_VERSION_MAJOR < 1
190 190
/**
191 191
 * @deprecated Use sws_scale() instead.
192 192
 */
193
int sws_scale_ordered(struct SwsContext *context, uint8_t* src[],
193
int sws_scale_ordered(struct SwsContext *context, const uint8_t* src[],
194 194
                      int srcStride[], int srcSliceY, int srcSliceH,
195 195
                      uint8_t* dst[], int dstStride[]) attribute_deprecated;
196 196
#endif
libswscale/swscale_internal.h
59 59

  
60 60
struct SwsContext;
61 61

  
62
typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[],
62
typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t* src[],
63 63
                       int srcStride[], int srcSliceY, int srcSliceH,
64 64
                       uint8_t* dst[], int dstStride[]);
65 65

  
libswscale/swscale_template.c
954 954
#if COMPILE_TEMPLATE_MMX
955 955
    if(!(c->flags & SWS_BITEXACT)) {
956 956
        long p= 4;
957
        uint8_t *src[4]= {alpSrc + dstW, lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW};
957
        const uint8_t *src[4]= {alpSrc + dstW, lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW};
958 958
        uint8_t *dst[4]= {aDest, dest, uDest, vDest};
959 959
        x86_reg counter[4]= {dstW, dstW, chrDstW, chrDstW};
960 960

  
......
1235 1235
                    : "%r8"
1236 1236
                );
1237 1237
#else
1238
                *(uint16_t **)(&c->u_temp)=abuf0;
1239
                *(uint16_t **)(&c->v_temp)=abuf1;
1238
                *(const uint16_t **)(&c->u_temp)=abuf0;
1239
                *(const uint16_t **)(&c->v_temp)=abuf1;
1240 1240
                __asm__ volatile(
1241 1241
                    "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
1242 1242
                    "mov        %4, %%"REG_b"               \n\t"
......
2145 2145
#endif
2146 2146
        );
2147 2147
    } else {
2148
        uint8_t *offset = src+filterSize;
2148
        const uint8_t *offset = src+filterSize;
2149 2149
        x86_reg counter= -2*dstW;
2150 2150
        //filter-= counter*filterSize/2;
2151 2151
        filterPos-= counter/2;
......
2554 2554
#define DEBUG_SWSCALE_BUFFERS 0
2555 2555
#define DEBUG_BUFFERS(...) if (DEBUG_SWSCALE_BUFFERS) av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
2556 2556

  
2557
static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
2557
static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
2558 2558
                           int srcSliceH, uint8_t* dst[], int dstStride[])
2559 2559
{
2560 2560
    /* load a few things into local vars to make the code more readable? and faster */
......
2677 2677

  
2678 2678
        //Do horizontal scaling
2679 2679
        while(lastInLumBuf < lastLumSrcY) {
2680
            uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
2681
            uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3];
2680
            const uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
2681
            const uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3];
2682 2682
            lumBufIndex++;
2683 2683
            DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n",
2684 2684
                               lumBufIndex,    lastInLumBuf);
......
2697 2697
            lastInLumBuf++;
2698 2698
        }
2699 2699
        while(lastInChrBuf < lastChrSrcY) {
2700
            uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1];
2701
            uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2];
2700
            const uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1];
2701
            const uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2];
2702 2702
            chrBufIndex++;
2703 2703
            DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n",
2704 2704
                               chrBufIndex,    lastInChrBuf);
......
2737 2737
            if (flags & SWS_ACCURATE_RND) {
2738 2738
                int s= APCK_SIZE / 8;
2739 2739
                for (i=0; i<vLumFilterSize; i+=2) {
2740
                    *(void**)&lumMmxFilter[s*i              ]= lumSrcPtr[i  ];
2741
                    *(void**)&lumMmxFilter[s*i+APCK_PTR2/4  ]= lumSrcPtr[i+(vLumFilterSize>1)];
2740
                    *(const void**)&lumMmxFilter[s*i              ]= lumSrcPtr[i  ];
2741
                    *(const void**)&lumMmxFilter[s*i+APCK_PTR2/4  ]= lumSrcPtr[i+(vLumFilterSize>1)];
2742 2742
                              lumMmxFilter[s*i+APCK_COEF/4  ]=
2743 2743
                              lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i    ]
2744 2744
                        + (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1]<<16 : 0);
2745 2745
                    if (CONFIG_SWSCALE_ALPHA && alpPixBuf) {
2746
                        *(void**)&alpMmxFilter[s*i              ]= alpSrcPtr[i  ];
2747
                        *(void**)&alpMmxFilter[s*i+APCK_PTR2/4  ]= alpSrcPtr[i+(vLumFilterSize>1)];
2746
                        *(const void**)&alpMmxFilter[s*i              ]= alpSrcPtr[i  ];
2747
                        *(const void**)&alpMmxFilter[s*i+APCK_PTR2/4  ]= alpSrcPtr[i+(vLumFilterSize>1)];
2748 2748
                                  alpMmxFilter[s*i+APCK_COEF/4  ]=
2749 2749
                                  alpMmxFilter[s*i+APCK_COEF/4+1]= lumMmxFilter[s*i+APCK_COEF/4  ];
2750 2750
                    }
2751 2751
                }
2752 2752
                for (i=0; i<vChrFilterSize; i+=2) {
2753
                    *(void**)&chrMmxFilter[s*i              ]= chrSrcPtr[i  ];
2754
                    *(void**)&chrMmxFilter[s*i+APCK_PTR2/4  ]= chrSrcPtr[i+(vChrFilterSize>1)];
2753
                    *(const void**)&chrMmxFilter[s*i              ]= chrSrcPtr[i  ];
2754
                    *(const void**)&chrMmxFilter[s*i+APCK_PTR2/4  ]= chrSrcPtr[i+(vChrFilterSize>1)];
2755 2755
                              chrMmxFilter[s*i+APCK_COEF/4  ]=
2756 2756
                              chrMmxFilter[s*i+APCK_COEF/4+1]= vChrFilter[chrDstY*vChrFilterSize + i    ]
2757 2757
                        + (vChrFilterSize>1 ? vChrFilter[chrDstY*vChrFilterSize + i + 1]<<16 : 0);
......
2796 2796
                                  alpSrcPtr, (uint16_t *) dest, (uint16_t *) uDest, (uint16_t *) vDest, (uint16_t *) aDest, dstW, chrDstW,
2797 2797
                                  dstFormat);
2798 2798
                } else if (vLumFilterSize == 1 && vChrFilterSize == 1) { // unscaled YV12
2799
                    int16_t *lumBuf = lumSrcPtr[0];
2800
                    int16_t *chrBuf= chrSrcPtr[0];
2801
                    int16_t *alpBuf= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpSrcPtr[0] : NULL;
2799
                    const int16_t *lumBuf = lumSrcPtr[0];
2800
                    const int16_t *chrBuf= chrSrcPtr[0];
2801
                    const int16_t *alpBuf= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpSrcPtr[0] : NULL;
2802 2802
                    c->yuv2yuv1(c, lumBuf, chrBuf, alpBuf, dest, uDest, vDest, aDest, dstW, chrDstW);
2803 2803
                } else { //General YV12
2804 2804
                    c->yuv2yuvX(c,
libswscale/x86/yuv2rgb_template.c
134 134
    __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );    \
135 135
    for (y= 0; y<srcSliceH; y++ ) {                           \
136 136
        uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; \
137
        uint8_t *py = src[0] + y*srcStride[0];                \
138
        uint8_t *pu = src[1] + (y>>1)*srcStride[1];           \
139
        uint8_t *pv = src[2] + (y>>1)*srcStride[2];           \
137
        const uint8_t *py = src[0] + y*srcStride[0];          \
138
        const uint8_t *pu = src[1] + (y>>1)*srcStride[1];     \
139
        const uint8_t *pv = src[2] + (y>>1)*srcStride[2];     \
140 140
        x86_reg index= -h_size/2;                                \
141 141

  
142 142
#define YUV2RGB_INIT                                                       \
......
179 179
    __asm__ volatile (SFENCE"\n\t"EMMS); \
180 180
    return srcSliceH; \
181 181

  
182
static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
182
static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
183 183
                                       int srcSliceH, uint8_t* dst[], int dstStride[])
184 184
{
185 185
    int y, h_size;
......
236 236
    YUV2RGB_OPERANDS
237 237
}
238 238

  
239
static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
239
static inline int RENAME(yuv420_rgb15)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
240 240
                                       int srcSliceH, uint8_t* dst[], int dstStride[])
241 241
{
242 242
    int y, h_size;
......
396 396
        "pxor      %%mm4, %%mm4     \n\t"
397 397
#endif
398 398

  
399
static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
399
static inline int RENAME(yuv420_rgb24)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
400 400
                                       int srcSliceH, uint8_t* dst[], int dstStride[])
401 401
{
402 402
    int y, h_size;
......
413 413
    YUV2RGB_OPERANDS
414 414
}
415 415

  
416
static inline int RENAME(yuv420_bgr24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
416
static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
417 417
                                       int srcSliceH, uint8_t* dst[], int dstStride[])
418 418
{
419 419
    int y, h_size;
......
491 491
    "pxor         %%mm4, %%mm4;" /* zero mm4 */                         \
492 492
    "movq 8 (%5, %0, 2), %%mm6;" /* Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */ \
493 493

  
494
static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
494
static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
495 495
                                       int srcSliceH, uint8_t* dst[], int dstStride[])
496 496
{
497 497
    int y, h_size;
......
508 508
    YUV2RGB_OPERANDS
509 509
}
510 510

  
511
static inline int RENAME(yuva420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
511
static inline int RENAME(yuva420_rgb32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
512 512
                                        int srcSliceH, uint8_t* dst[], int dstStride[])
513 513
{
514 514
#if HAVE_7REGS
......
516 516

  
517 517
    YUV2RGB_LOOP(4)
518 518

  
519
        uint8_t *pa = src[3] + y*srcStride[3];
519
        const uint8_t *pa = src[3] + y*srcStride[3];
520 520
        YUV2RGB_INIT
521 521
        YUV2RGB
522 522
        "movq     (%6, %0, 2), %%mm3;"            /* Load 8 A A7 A6 A5 A4 A3 A2 A1 A0 */
......
527 527
#endif
528 528
}
529 529

  
530
static inline int RENAME(yuv420_bgr32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
530
static inline int RENAME(yuv420_bgr32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
531 531
                                       int srcSliceH, uint8_t* dst[], int dstStride[])
532 532
{
533 533
    int y, h_size;
......
544 544
    YUV2RGB_OPERANDS
545 545
}
546 546

  
547
static inline int RENAME(yuva420_bgr32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
547
static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
548 548
                                        int srcSliceH, uint8_t* dst[], int dstStride[])
549 549
{
550 550
#if HAVE_7REGS
......
552 552

  
553 553
    YUV2RGB_LOOP(4)
554 554

  
555
        uint8_t *pa = src[3] + y*srcStride[3];
555
        const uint8_t *pa = src[3] + y*srcStride[3];
556 556
        YUV2RGB_INIT
557 557
        YUV2RGB
558 558
        "movq     (%6, %0, 2), %%mm3;"            /* Load 8 A A7 A6 A5 A4 A3 A2 A1 A0 */
libswscale/yuv2rgb.c
91 91
    dst[12*i+10] = dst[12*i+11] = b[Y];
92 92

  
93 93
#define YUV2RGBFUNC(func_name, dst_type, alpha) \
94
static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, \
94
static int func_name(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, \
95 95
                     int srcSliceH, uint8_t* dst[], int dstStride[]) \
96 96
{\
97 97
    int y;\
......
105 105
        dst_type *dst_2 = (dst_type*)(dst[0] + (y+srcSliceY+1)*dstStride[0]);\
106 106
        dst_type av_unused *r, *b;\
107 107
        dst_type *g;\
108
        uint8_t *py_1 = src[0] + y*srcStride[0];\
109
        uint8_t *py_2 = py_1 + srcStride[0];\
110
        uint8_t *pu = src[1] + (y>>1)*srcStride[1];\
111
        uint8_t *pv = src[2] + (y>>1)*srcStride[2];\
112
        uint8_t av_unused *pa_1, *pa_2;\
108
        const uint8_t *py_1 = src[0] + y*srcStride[0];\
109
        const uint8_t *py_2 = py_1 + srcStride[0];\
110
        const uint8_t *pu = src[1] + (y>>1)*srcStride[1];\
111
        const uint8_t *pv = src[2] + (y>>1)*srcStride[2];\
112
        const uint8_t av_unused *pa_1, *pa_2;\
113 113
        unsigned int h_size = c->dstW>>3;\
114 114
        if (alpha) {\
115 115
            pa_1 = src[3] + y*srcStride[3];\

Also available in: Unified diff