Revision bb53e1d1 libswscale/swscale_template.c

View differences:

libswscale/swscale_template.c
2283 2283
    int16_t av_unused *mmx2Filter    = c->lumMmx2Filter;
2284 2284
    int     av_unused canMMX2BeUsed  = c->canMMX2BeUsed;
2285 2285
    void    av_unused *mmx2FilterCode= c->lumMmx2FilterCode;
2286
    void (*internal_func)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->hascale_internal : c->hyscale_internal;
2286
    void (*toYV12)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->alpToYV12 : c->lumToYV12;
2287 2287
    void (*convertRange)(uint16_t *, int) = isAlpha ? NULL : c->lumConvertRange;
2288 2288

  
2289 2289
    src += isAlpha ? c->alpSrcOffset : c->lumSrcOffset;
2290 2290

  
2291
    if (internal_func) {
2292
        internal_func(formatConvBuffer, src, srcW, pal);
2291
    if (toYV12) {
2292
        toYV12(formatConvBuffer, src, srcW, pal);
2293 2293
        src= formatConvBuffer;
2294 2294
    }
2295 2295

  
......
2441 2441
    src1 += c->chrSrcOffset;
2442 2442
    src2 += c->chrSrcOffset;
2443 2443

  
2444
    if (c->hcscale_internal) {
2445
        c->hcscale_internal(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2444
    if (c->chrToYV12) {
2445
        c->chrToYV12(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2446 2446
        src1= formatConvBuffer;
2447 2447
        src2= formatConvBuffer+VOFW;
2448 2448
    }
......
2946 2946
        c->hcscale_fast = RENAME(hcscale_fast);
2947 2947
    }
2948 2948

  
2949
    c->hcscale_internal = NULL;
2949
    c->chrToYV12 = NULL;
2950 2950
    switch(srcFormat) {
2951
        case PIX_FMT_YUYV422  : c->hcscale_internal = RENAME(yuy2ToUV); break;
2952
        case PIX_FMT_UYVY422  : c->hcscale_internal = RENAME(uyvyToUV); break;
2953
        case PIX_FMT_NV12     : c->hcscale_internal = RENAME(nv12ToUV); break;
2954
        case PIX_FMT_NV21     : c->hcscale_internal = RENAME(nv21ToUV); break;
2951
        case PIX_FMT_YUYV422  : c->chrToYV12 = RENAME(yuy2ToUV); break;
2952
        case PIX_FMT_UYVY422  : c->chrToYV12 = RENAME(uyvyToUV); break;
2953
        case PIX_FMT_NV12     : c->chrToYV12 = RENAME(nv12ToUV); break;
2954
        case PIX_FMT_NV21     : c->chrToYV12 = RENAME(nv21ToUV); break;
2955 2955
        case PIX_FMT_RGB8     :
2956 2956
        case PIX_FMT_BGR8     :
2957 2957
        case PIX_FMT_PAL8     :
2958 2958
        case PIX_FMT_BGR4_BYTE:
2959
        case PIX_FMT_RGB4_BYTE: c->hcscale_internal = palToUV; break;
2959
        case PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV; break;
2960 2960
        case PIX_FMT_YUV420P16BE:
2961 2961
        case PIX_FMT_YUV422P16BE:
2962
        case PIX_FMT_YUV444P16BE: c->hcscale_internal = RENAME(BEToUV); break;
2962
        case PIX_FMT_YUV444P16BE: c->chrToYV12 = RENAME(BEToUV); break;
2963 2963
        case PIX_FMT_YUV420P16LE:
2964 2964
        case PIX_FMT_YUV422P16LE:
2965
        case PIX_FMT_YUV444P16LE: c->hcscale_internal = RENAME(LEToUV); break;
2965
        case PIX_FMT_YUV444P16LE: c->chrToYV12 = RENAME(LEToUV); break;
2966 2966
    }
2967 2967
    if (c->chrSrcHSubSample) {
2968 2968
        switch(srcFormat) {
2969 2969
        case PIX_FMT_RGB48BE:
2970
        case PIX_FMT_RGB48LE: c->hcscale_internal = rgb48ToUV_half; break;
2970
        case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48ToUV_half; break;
2971 2971
        case PIX_FMT_RGB32  :
2972
        case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV_half; break;
2973
        case PIX_FMT_BGR24  : c->hcscale_internal = RENAME(bgr24ToUV_half); break;
2974
        case PIX_FMT_BGR565 : c->hcscale_internal = bgr16ToUV_half; break;
2975
        case PIX_FMT_BGR555 : c->hcscale_internal = bgr15ToUV_half; break;
2972
        case PIX_FMT_RGB32_1: c->chrToYV12 = bgr32ToUV_half; break;
2973
        case PIX_FMT_BGR24  : c->chrToYV12 = RENAME(bgr24ToUV_half); break;
2974
        case PIX_FMT_BGR565 : c->chrToYV12 = bgr16ToUV_half; break;
2975
        case PIX_FMT_BGR555 : c->chrToYV12 = bgr15ToUV_half; break;
2976 2976
        case PIX_FMT_BGR32  :
2977
        case PIX_FMT_BGR32_1: c->hcscale_internal = rgb32ToUV_half; break;
2978
        case PIX_FMT_RGB24  : c->hcscale_internal = RENAME(rgb24ToUV_half); break;
2979
        case PIX_FMT_RGB565 : c->hcscale_internal = rgb16ToUV_half; break;
2980
        case PIX_FMT_RGB555 : c->hcscale_internal = rgb15ToUV_half; break;
2977
        case PIX_FMT_BGR32_1: c->chrToYV12 = rgb32ToUV_half; break;
2978
        case PIX_FMT_RGB24  : c->chrToYV12 = RENAME(rgb24ToUV_half); break;
2979
        case PIX_FMT_RGB565 : c->chrToYV12 = rgb16ToUV_half; break;
2980
        case PIX_FMT_RGB555 : c->chrToYV12 = rgb15ToUV_half; break;
2981 2981
        }
2982 2982
    } else {
2983 2983
        switch(srcFormat) {
2984 2984
        case PIX_FMT_RGB48BE:
2985
        case PIX_FMT_RGB48LE: c->hcscale_internal = rgb48ToUV; break;
2985
        case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48ToUV; break;
2986 2986
        case PIX_FMT_RGB32  :
2987
        case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV; break;
2988
        case PIX_FMT_BGR24  : c->hcscale_internal = RENAME(bgr24ToUV); break;
2989
        case PIX_FMT_BGR565 : c->hcscale_internal = bgr16ToUV; break;
2990
        case PIX_FMT_BGR555 : c->hcscale_internal = bgr15ToUV; break;
2987
        case PIX_FMT_RGB32_1: c->chrToYV12 = bgr32ToUV; break;
2988
        case PIX_FMT_BGR24  : c->chrToYV12 = RENAME(bgr24ToUV); break;
2989
        case PIX_FMT_BGR565 : c->chrToYV12 = bgr16ToUV; break;
2990
        case PIX_FMT_BGR555 : c->chrToYV12 = bgr15ToUV; break;
2991 2991
        case PIX_FMT_BGR32  :
2992
        case PIX_FMT_BGR32_1: c->hcscale_internal = rgb32ToUV; break;
2993
        case PIX_FMT_RGB24  : c->hcscale_internal = RENAME(rgb24ToUV); break;
2994
        case PIX_FMT_RGB565 : c->hcscale_internal = rgb16ToUV; break;
2995
        case PIX_FMT_RGB555 : c->hcscale_internal = rgb15ToUV; break;
2992
        case PIX_FMT_BGR32_1: c->chrToYV12 = rgb32ToUV; break;
2993
        case PIX_FMT_RGB24  : c->chrToYV12 = RENAME(rgb24ToUV); break;
2994
        case PIX_FMT_RGB565 : c->chrToYV12 = rgb16ToUV; break;
2995
        case PIX_FMT_RGB555 : c->chrToYV12 = rgb15ToUV; break;
2996 2996
        }
2997 2997
    }
2998 2998

  
2999
    c->hyscale_internal = NULL;
3000
    c->hascale_internal = NULL;
2999
    c->lumToYV12 = NULL;
3000
    c->alpToYV12 = NULL;
3001 3001
    switch (srcFormat) {
3002 3002
    case PIX_FMT_YUYV422  :
3003 3003
    case PIX_FMT_YUV420P16BE:
3004 3004
    case PIX_FMT_YUV422P16BE:
3005 3005
    case PIX_FMT_YUV444P16BE:
3006
    case PIX_FMT_GRAY16BE : c->hyscale_internal = RENAME(yuy2ToY); break;
3006
    case PIX_FMT_GRAY16BE : c->lumToYV12 = RENAME(yuy2ToY); break;
3007 3007
    case PIX_FMT_UYVY422  :
3008 3008
    case PIX_FMT_YUV420P16LE:
3009 3009
    case PIX_FMT_YUV422P16LE:
3010 3010
    case PIX_FMT_YUV444P16LE:
3011
    case PIX_FMT_GRAY16LE : c->hyscale_internal = RENAME(uyvyToY); break;
3012
    case PIX_FMT_BGR24    : c->hyscale_internal = RENAME(bgr24ToY); break;
3013
    case PIX_FMT_BGR565   : c->hyscale_internal = bgr16ToY; break;
3014
    case PIX_FMT_BGR555   : c->hyscale_internal = bgr15ToY; break;
3015
    case PIX_FMT_RGB24    : c->hyscale_internal = RENAME(rgb24ToY); break;
3016
    case PIX_FMT_RGB565   : c->hyscale_internal = rgb16ToY; break;
3017
    case PIX_FMT_RGB555   : c->hyscale_internal = rgb15ToY; break;
3011
    case PIX_FMT_GRAY16LE : c->lumToYV12 = RENAME(uyvyToY); break;
3012
    case PIX_FMT_BGR24    : c->lumToYV12 = RENAME(bgr24ToY); break;
3013
    case PIX_FMT_BGR565   : c->lumToYV12 = bgr16ToY; break;
3014
    case PIX_FMT_BGR555   : c->lumToYV12 = bgr15ToY; break;
3015
    case PIX_FMT_RGB24    : c->lumToYV12 = RENAME(rgb24ToY); break;
3016
    case PIX_FMT_RGB565   : c->lumToYV12 = rgb16ToY; break;
3017
    case PIX_FMT_RGB555   : c->lumToYV12 = rgb15ToY; break;
3018 3018
    case PIX_FMT_RGB8     :
3019 3019
    case PIX_FMT_BGR8     :
3020 3020
    case PIX_FMT_PAL8     :
3021 3021
    case PIX_FMT_BGR4_BYTE:
3022
    case PIX_FMT_RGB4_BYTE: c->hyscale_internal = palToY; break;
3023
    case PIX_FMT_MONOBLACK: c->hyscale_internal = monoblack2Y; break;
3024
    case PIX_FMT_MONOWHITE: c->hyscale_internal = monowhite2Y; break;
3022
    case PIX_FMT_RGB4_BYTE: c->lumToYV12 = palToY; break;
3023
    case PIX_FMT_MONOBLACK: c->lumToYV12 = monoblack2Y; break;
3024
    case PIX_FMT_MONOWHITE: c->lumToYV12 = monowhite2Y; break;
3025 3025
    case PIX_FMT_RGB32  :
3026
    case PIX_FMT_RGB32_1: c->hyscale_internal = bgr32ToY; break;
3026
    case PIX_FMT_RGB32_1: c->lumToYV12 = bgr32ToY; break;
3027 3027
    case PIX_FMT_BGR32  :
3028
    case PIX_FMT_BGR32_1: c->hyscale_internal = rgb32ToY; break;
3028
    case PIX_FMT_BGR32_1: c->lumToYV12 = rgb32ToY; break;
3029 3029
    case PIX_FMT_RGB48BE:
3030
    case PIX_FMT_RGB48LE: c->hyscale_internal = rgb48ToY; break;
3030
    case PIX_FMT_RGB48LE: c->lumToYV12 = rgb48ToY; break;
3031 3031
    }
3032 3032
    if (c->alpPixBuf) {
3033 3033
        switch (srcFormat) {
3034 3034
        case PIX_FMT_RGB32  :
3035 3035
        case PIX_FMT_RGB32_1:
3036 3036
        case PIX_FMT_BGR32  :
3037
        case PIX_FMT_BGR32_1: c->hascale_internal = abgrToA; break;
3037
        case PIX_FMT_BGR32_1: c->alpToYV12 = abgrToA; break;
3038 3038
        }
3039 3039
    }
3040 3040

  

Also available in: Unified diff