473 |
interlacing?abgri_to_yv12_c:abgr_to_yv12_c, 4); |
interlacing?abgri_to_yv12_c:abgr_to_yv12_c, 4); |
474 |
break; |
break; |
475 |
|
|
476 |
|
case XVID_CSP_RGB: |
477 |
|
safe_packed_conv( |
478 |
|
src[0], src_stride[0], image->y, image->u, image->v, |
479 |
|
edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP), |
480 |
|
interlacing?rgbi_to_yv12 :rgb_to_yv12, |
481 |
|
interlacing?rgbi_to_yv12_c:rgb_to_yv12_c, 4); |
482 |
|
break; |
483 |
|
|
484 |
case XVID_CSP_RGBA : |
case XVID_CSP_RGBA : |
485 |
safe_packed_conv( |
safe_packed_conv( |
486 |
src[0], src_stride[0], image->y, image->u, image->v, |
src[0], src_stride[0], image->y, image->u, image->v, |
657 |
interlacing?yv12_to_abgri_c:yv12_to_abgr_c, 4); |
interlacing?yv12_to_abgri_c:yv12_to_abgr_c, 4); |
658 |
return 0; |
return 0; |
659 |
|
|
660 |
|
case XVID_CSP_RGB: |
661 |
|
safe_packed_conv( |
662 |
|
dst[0], dst_stride[0], image->y, image->u, image->v, |
663 |
|
edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP), |
664 |
|
interlacing?yv12_to_rgbi :yv12_to_rgb, |
665 |
|
interlacing?yv12_to_rgbi_c:yv12_to_rgb_c, 4); |
666 |
|
return 0; |
667 |
|
|
668 |
case XVID_CSP_RGBA: |
case XVID_CSP_RGBA: |
669 |
safe_packed_conv( |
safe_packed_conv( |
670 |
dst[0], dst_stride[0], image->y, image->u, image->v, |
dst[0], dst_stride[0], image->y, image->u, image->v, |
1034 |
|
|
1035 |
/****************************************************************************/ |
/****************************************************************************/ |
1036 |
|
|
1037 |
static void (*deintl_core)(unsigned char *, int width, int height, const int stride) = 0; |
static void (*deintl_core)(uint8_t *, int width, int height, const int stride) = 0; |
1038 |
extern void xvid_deinterlace_sse(unsigned char *, int width, int height, const int stride); |
extern void xvid_deinterlace_sse(uint8_t *, int width, int height, const int stride); |
1039 |
|
|
1040 |
#define CLIP_255(x) ( ((x)&~255) ? ((-(x)) >> (8*sizeof((x))-1))&0xff : (x) ) |
#define CLIP_255(x) ( ((x)&~255) ? ((-(x)) >> (8*sizeof((x))-1))&0xff : (x) ) |
1041 |
|
|
1042 |
static void deinterlace_c(unsigned char *pix, int width, int height, const int bps) |
static void deinterlace_c(uint8_t *pix, int width, int height, const int bps) |
1043 |
{ |
{ |
1044 |
pix += bps; |
pix += bps; |
1045 |
while(width-->0) |
while(width-->0) |
1074 |
if (img->csp!=XVID_CSP_PLANAR && img->csp!=XVID_CSP_I420 && img->csp!=XVID_CSP_YV12) |
if (img->csp!=XVID_CSP_PLANAR && img->csp!=XVID_CSP_I420 && img->csp!=XVID_CSP_YV12) |
1075 |
return 0; /* not yet supported */ |
return 0; /* not yet supported */ |
1076 |
if (deintl_core==0) { |
if (deintl_core==0) { |
|
const int cpu_flags = check_cpu_features(); |
|
1077 |
deintl_core = deinterlace_c; |
deintl_core = deinterlace_c; |
1078 |
#ifdef ARCH_IS_IA32 |
#ifdef ARCH_IS_IA32 |
1079 |
|
{ |
1080 |
|
int cpu_flags = check_cpu_features(); |
1081 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
1082 |
deintl_core = xvid_deinterlace_sse; |
deintl_core = xvid_deinterlace_sse; |
1083 |
|
} |
1084 |
#endif |
#endif |
1085 |
} |
} |
1086 |
if (!bottom_first) { |
if (!bottom_first) { |
1089 |
deintl_core(img->plane[2], width>>1, height>>1, img->stride[2]); |
deintl_core(img->plane[2], width>>1, height>>1, img->stride[2]); |
1090 |
} |
} |
1091 |
else { |
else { |
1092 |
deintl_core(img->plane[0] + ( height -1)*img->stride[0], width, height, -img->stride[0]); |
deintl_core((uint8_t *)img->plane[0] + ( height -1)*img->stride[0], width, height, -img->stride[0]); |
1093 |
deintl_core(img->plane[1] + ((height>>1)-1)*img->stride[1], width>>1, height>>1, -img->stride[1]); |
deintl_core((uint8_t *)img->plane[1] + ((height>>1)-1)*img->stride[1], width>>1, height>>1, -img->stride[1]); |
1094 |
deintl_core(img->plane[2] + ((height>>1)-1)*img->stride[2], width>>1, height>>1, -img->stride[2]); |
deintl_core((uint8_t *)img->plane[2] + ((height>>1)-1)*img->stride[2], width>>1, height>>1, -img->stride[2]); |
1095 |
} |
} |
1096 |
emms(); |
emms(); |
1097 |
|
|