    movq mm4, mm3
    movq mm5, mm3
    movq mm6, mm3
    psrlw mm3, 5
    pand mm4, mask_g
    pand mm5, mask_b
    movq mm1, mm0
    movq mm2, mm0
    psrlw mm0, 5
    pand mm1, mask_g
    pand mm2, mask_b
    psubw mm0, mm3
    psubw mm1, mm4
    pmullw mm0, mm7
    psubw mm2, mm5
    pmullw mm1, mm7
    paddw mm0, mm6
    pmullw mm2, mm7
    psrlw mm1, 5
    psrlw mm2, 5
    paddw mm1, mm4
    paddw mm2, mm5
    pand mm0, mask_r
    pand mm1, mask_g
    pand mm2, mask_b
    por mm0, mm1
    por mm0, mm2