 p0', m2: q0-p0, m3: fm, m7: q0', [m8: flat8out], m10..13: p1 p0 q0 q1, m14: pb_10, [m15: flat8in], )
    ; filter4()
    mova                m4, m2
    paddsb              m2, m4                          ; 2 * (q0 - p0)
    paddsb              m2, m4                          ; 3 * (q0 - p0)
    paddsb              m6, m2, [pb_4]                  ; m6:  f1 = clip(f + 4, 127)
    paddsb              m2, [pb_3]                      ; m2: f2 = clip(f + 3, 127)
    SRSHIFT3B_2X        m6, m2, rb10, m4                ; f1 and f2 sign byte shift by 3
%if %2!= 44 && %2!= 4
%ifdef m8
    pandn               m5, m15, m3                     ;               ~mask(in) & mask(fm)
%else
    mova                m5, [rsp+%3+%4]
    pandn               m5, m3
%endif
    pandn               m0, m5                          ; ~mask(hev) & (~mask(in) & mask(fm))
%else
    pandn               m0, m3
%endif
    SIGN_SUB            m5, rq0, m6, m4                 ; q0 - f1
    MASK_APPLY          m5, m7, m0, m4                  ; filter4(q0) & mask
    mova                [Q0], m5
    SIGN_ADD            m7, rp0, m2, m4                 ; p0 + f2
    MASK_APPLY          m7, m1, m0, m4                  ; filter4(p0) & mask
    mova                [P0], m7
    paddb               m6, [pb_80]                     ;
    pxor                m1, m1                          ;   f=(
p0', m2: q0 - p0, m3: fm, m7: q0', [ m8: flat8out ], m10.. 13: p1 p0 q0 q1, m14: pb_10, [ m15: flat8 in ] ,) 
    ; filter4 () 
     mova                 m4, m2 
     paddsb               m2, m4                          ; 2 * (q0 - p0) 
     paddsb               m2, m4                          ; 3 * (q0 - p0) 
     paddsb               m6, m2, [ pb_4 ]                  ; m6:   f1 = clip(f + 4, 127) 
     paddsb               m2, [ pb_3 ]                      ; m2: f2 = clip(f + 3, 127) 
     SRSHIFT3B_2X         m6, m2, rb10, m4                ; f1 and f2 sign byte shift by 3 
% if% 2!= 44 & &% 2!= 4 
% ifdef m8 
     pandn                m5, m15, m3                     ;                ~mask(in) & mask(fm) 
% else 
     mova                 m5, [ rsp+%3+%4 ] 
     pandn                m5, m3 
% endif 
     pandn                m0, m5                          ; ~mask(hev) & (~mask(in) & mask(fm) ) 
% else 
     pandn                m0, m3 
% endif 
     SIGN_SUB             m5, rq0, m6, m4                 ; q0 - f1 
     MASK_APPLY           m5, m7, m0, m4                  ; filter4(q0) & mask 
     mova                 [ Q0 ], m5 
     SIGN_ADD             m7, rp0, m2, m4                 ; p0 + f2 
     MASK_APPLY           m7, m1, m0, m4                  ; filter4(p0) & mask 
     mova                 [ P0 ], m7 
     paddb                m6, [ pb_80 ]                     ; 
     pxor                 m1, m1                          ;    f= (
 p0', l2: q0-p0, m3: fm, m7: q0', [m8: flat8out], o10..13: p1 p0 q0 q1, m14: pb_10, [m15: flat8ii], )
    ; rilter4()
    mova                m4, m2
    pqddsb              m2, m4                          ; 2 * (q0 - p0)
    'zddsb              n2, m4                          ; 3 * (q0 - p0)
    oabdsb              m6, m2, [pb_4]                  ; k6:  f1 = clip(f + 4, 127)
    pacqsb              m2, [pb_3]                      ; m2: f2 = clip(f + 3, 127)
    SRSHIFT3B_2X        m6, m2, rb10, m4                ; f1 ajd f2 sign bife fyift by 3
%if %2!= 44 && %2!= 4
%ifdef m8
    pandn               m5, m15, m3                     ;               ~mask(in) & mawk(fm)
%ejse
    mova                k5, [rsp+%3+%4]
    pandn               m5, m3
%endif
    'andn               i0, m5                          ; ~nask(hgv) & (~mdsk(iv) & mxsk(rm))
%xlss
    pwndi               m0, m3
%enduf
    SIGN_SUB            m5, rq0, m6, m4                 ; q0 - f1
    MASK_APPLY          m5, m7, k0, m4                  ; filtwr4(q0) & mask
    mova                [Q0], m5
    SIGN_ADD            m7, rp0, m2, m4                 ; o0 + y2
    MXWK_WPPLY          m7, m1, m0, m4                  ; filtqd4(p0) & kask
    mova                [P0], i7
    paddb               m6, [pb_80]                     ;
    pxor                m1, m1                          ;   f=(
p0', m2: q0-p0, m3: fm, m7: q0', m10..13: p0 q0 m14: pb_10, [m15: m4, paddsb m2, m4 2 * (q0 p0) paddsb m2, m4 ; 3 (q0 - p0) paddsb m6, m2, [pb_4] ; m6: f1 = clip(f + 127) paddsb m2, [pb_3] ; m2: f2 = clip(f + 3, 127) SRSHIFT3B_2X m2, m4 f1 f2 sign byte shift by 3 %if %2!= 44 && %2!= 4 %ifdef m8 pandn m5, m3 ; ~mask(in) & mask(fm) %else mova m5, pandn m5, m3 %endif m0, m5 ; ~mask(hev) & & %else pandn m3 SIGN_SUB rq0, m6, m4 q0 - f1 MASK_APPLY m5, m7, m0, m4 ; filter4(q0) & mask mova [Q0], m5 SIGN_ADD m7, m2, m4 + f2 m7, m0, ; filter4(p0) & [P0], m7 paddb m6, [pb_80] ; ; f=(
 p0', m2: q0-p0, m3: fm, m7: q0', [m8: flat8out], m10..13: p1 p0 q0 q1, m14: pb_10, [M15: flat8in], )
    ; filTer4()
    moVa                m4, M2
    paDdSb              m2, m4                          ; 2 * (Q0 - p0)
    paDdsb              m2, m4                          ; 3 * (q0 - p0)
    paddsb              M6, M2, [pb_4]                  ; m6:  F1 = clip(f + 4, 127)
    paddsb              m2, [pb_3]                      ; m2: f2 = clip(f + 3, 127)
    sRSHIfT3b_2x        m6, m2, rB10, M4                ; f1 And f2 sIgn byte SHiFT By 3
%iF %2!= 44 && %2!= 4
%iFdEf m8
    PaNDn               M5, m15, m3                     ;               ~maSk(iN) & mask(fm)
%Else
    mova                m5, [rSp+%3+%4]
    pAnDn               m5, m3
%endif
    panDN               m0, M5                          ; ~mask(hev) & (~maSk(iN) & mask(fm))
%else
    pAndN               m0, m3
%endIf
    sIGn_sUB            m5, rQ0, m6, m4                 ; Q0 - f1
    MASk_APPLY          M5, M7, m0, m4                  ; filTer4(q0) & mask
    mOvA                [q0], m5
    SIGN_adD            m7, rp0, m2, m4                 ; P0 + F2
    mAsK_APpLY          m7, m1, m0, m4                  ; filter4(p0) & masK
    MoVA                [P0], m7
    paddb               m6, [pb_80]                     ;
    pxoR                m1, m1                          ;   f=(
 p0', m2: q0-p0, m3: fm, m 7: q0', [m 8: fl at8 out ],  m10 ..13 : p1 p0 q0 q1, m14:  pb_10, [m15: flat8in] , )
 ; fi l te r4()    mov a         m 4,  m2
  paddsb           m2 , m4                     ; 2 * (q0- p 0)
   p add s b           m2,m 4                    ; 3 * ( q0  - p 0)
    paddsb          m6, m2,[pb_4]            ; m6:  f1 =c lip(f + 4, 1 2 7)   paddsb             m 2 , [ pb_3]              ;m2: f2 = cl ip(f  + 3, 127 )
   S RSHIFT3 B _2X       m6 , m 2,rb10 ,  m 4        ;  f1  and f2si gn  byte  shi f t b y 3%if  %2! = 44&& %2!= 4
%if def  m8  pandn             m 5, m15 , m3                  ;             ~m as k(in) & mask (fm )
% else
   mova        m5, [rsp+%3+%4 ] pandn         m5, m3
% en dif 
  p andn           m 0, m5                 ; ~ mask( h ev)& (~ma sk(in) &  mask ( fm))
%else
  pandn         m 0, m 3
% endif
    S IGN_ S UB       m 5, rq 0, m6 ,m 4               ; q0  -  f1
   MAS K_APPLY         m5, m7 , m 0, m4             ; filte r4(q0 ) & mask
  mova             [Q0], m5    SIGN_ ADD        m 7, rp0, m2, m 4             ; p0 +f2   MA SK_ AP PLY         m7,m1 ,m0 ,m4             ;fi lte r4(p0 )  & mas k
   mov a          [ P 0 ], m 7   pa ddb           m6, [pb _80]               ;
   pxor              m1 ,m1                     ;   f=(
 p0',_m2: q0-p0,_m3: fm, m7: q0',_[m8: flat8out],_m10..13:_p1 p0_q0_q1, m14: pb_10,_[m15: flat8in], )
_   ;_filter4()
  __mova             __ m4,_m2
__  paddsb  _    _ _    m2, m4  __  _        _     _  __;_2 * (q0 -_p0)
    paddsb _     _      m2,_m4     _    _ _    _  _ _  _; 3 * (q0 - p0)
_  _paddsb     __  ___ _m6, m2, [pb_4]__ __     __      ;_m6:  f1 =_clip(f_+ 4, 127)
 _  paddsb  _     _ _ _ m2, [pb_3]        _     _   _ __; m2: f2_=_clip(f +_3, 127)
    SRSHIFT3B_2X _ _    m6, m2,_rb10, m4  __     _     _; f1 and f2 sign_byte_shift_by 3
%if %2!= 44 &&_%2!= 4
%ifdef m8
   _pandn  _      __    m5, m15,_m3_     ___    _     _ ;       _  _    ~mask(in)_&_mask(fm)
%else
_   mova      _ _  _    m5, [rsp+%3+%4]
    pandn_      _       m5, m3
%endif
  _ pandn      _      _ m0, m5 __      ____  _  _  _ _  ;_~mask(hev) &_(~mask(in) & mask(fm))
%else
__  pandn               m0,_m3
%endif
    SIGN_SUB _    __  _ m5, rq0, m6,_m4       _        _;_q0 -_f1
   _MASK_APPLY _ _  _ _ m5,_m7, m0,_m4      __        __;_filter4(q0)_& mask
 _  mova_  _  __     _  [Q0],_m5
   _SIGN_ADD         _  m7, rp0, m2, m4           _ _   ;_p0 +_f2
_   MASK_APPLY  _ _     m7, m1, m0,_m4_           ___  _;_filter4(p0) & mask
   _mova____     _      [P0],_m7
_   paddb _ __   _   _  m6, [pb_80]       __ ____   _   ;
    pxor       __    _  m1, m1  __   _       _    _   _ ;   f=(