FS-10050: [core] chromakey optimization

This commit is contained in:
Mike Jerris 2017-03-03 14:58:52 -06:00
parent e79157efbd
commit 7b8465915b
1 changed files with 10 additions and 0 deletions

View File

@ -346,6 +346,16 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
switch_img_patch_rgb_noalpha(IMG, img, x, y);
return;
}
if (IMG->d_w == img->d_w && IMG->d_h == img->d_h) {
ARGBAttenuate(img->planes[SWITCH_PLANE_PACKED], img->stride[SWITCH_PLANE_PACKED],
img->planes[SWITCH_PLANE_PACKED], img->stride[SWITCH_PLANE_PACKED],
img->d_w, img->d_h);
ARGBBlend(img->planes[SWITCH_PLANE_PACKED], img->stride[SWITCH_PLANE_PACKED],
IMG->planes[SWITCH_PLANE_PACKED], IMG->stride[SWITCH_PLANE_PACKED],
IMG->planes[SWITCH_PLANE_PACKED], IMG->stride[SWITCH_PLANE_PACKED],
IMG->d_w, IMG->d_h);
return;
}
if (img->fmt == SWITCH_IMG_FMT_ARGB && IMG->fmt == SWITCH_IMG_FMT_ARGB) {
int max_w = MIN(img->d_w, IMG->d_w - abs(x));