Revision a959e247 libswscale/x86/yuv2rgb_template.c

View differences:

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 */

Also available in: Unified diff