20% faster than SSSE3.
/* space for p_fenc and p_fdec */
#define FENC_STRIDE 16
#define FDEC_STRIDE 32
- ALIGNED_16( pixel fenc_buf[48*FENC_STRIDE] );
+ ALIGNED_N( pixel fenc_buf[48*FENC_STRIDE] );
ALIGNED_N( pixel fdec_buf[52*FDEC_STRIDE] );
/* i4x4 and i8x8 backup data, for skipping the encode stage when possible */
RET
%endmacro ; LOAD_DEINTERLEAVE_CHROMA
+%macro LOAD_DEINTERLEAVE_CHROMA_FENC_AVX2 0
+cglobal load_deinterleave_chroma_fenc, 4,5
+ vbroadcasti128 m0, [deinterleave_shuf]
+ lea r4, [r2*3]
+.loop:
+ mova xm1, [r1]
+ vinserti128 m1, m1, [r1+r2], 1
+ mova xm2, [r1+r2*2]
+ vinserti128 m2, m2, [r1+r4], 1
+ pshufb m1, m0
+ pshufb m2, m0
+ mova [r0+0*FENC_STRIDE], m1
+ mova [r0+2*FENC_STRIDE], m2
+ lea r1, [r1+r2*4]
+ add r0, 4*FENC_STRIDE
+ sub r3d, 4
+ jg .loop
+ RET
+%endmacro ; LOAD_DEINTERLEAVE_CHROMA_FENC_AVX2
+
%macro PLANE_DEINTERLEAVE_RGB_CORE 9 ; pw, i_dsta, i_dstb, i_dstc, i_src, w, h, tmp1, tmp2
%if mmsize == 32
vbroadcasti128 m3, [deinterleave_rgb_shuf+(%1-3)*16]
LOAD_DEINTERLEAVE_CHROMA
PLANE_DEINTERLEAVE_RGB
INIT_YMM avx2
+LOAD_DEINTERLEAVE_CHROMA_FENC_AVX2
PLANE_DEINTERLEAVE_RGB
%endif
void x264_load_deinterleave_chroma_fenc_sse2( pixel *dst, pixel *src, intptr_t i_src, int height );
void x264_load_deinterleave_chroma_fenc_ssse3( uint8_t *dst, uint8_t *src, intptr_t i_src, int height );
void x264_load_deinterleave_chroma_fenc_avx( uint16_t *dst, uint16_t *src, intptr_t i_src, int height );
+void x264_load_deinterleave_chroma_fenc_avx2( uint8_t *dst, uint8_t *src, intptr_t i_src, int height );
void x264_load_deinterleave_chroma_fdec_sse2( pixel *dst, pixel *src, intptr_t i_src, int height );
void x264_load_deinterleave_chroma_fdec_ssse3( uint8_t *dst, uint8_t *src, intptr_t i_src, int height );
void x264_load_deinterleave_chroma_fdec_avx( uint16_t *dst, uint16_t *src, intptr_t i_src, int height );
pf->integral_init8h = x264_integral_init8h_avx2;
pf->integral_init4h = x264_integral_init4h_avx2;
pf->frame_init_lowres_core = x264_frame_init_lowres_core_avx2;
+ pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_avx2;
pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_avx2;
}
#endif // HIGH_BIT_DEPTH
}
else
{
- ALIGNED_ARRAY_16( pixel, pixuv, [2],[16*FENC_STRIDE] );
+ ALIGNED_ARRAY_N( pixel, pixuv, [2],[16*FENC_STRIDE] );
int chromapix = h->luma2chroma_pixel[PIXEL_16x16];
int v_shift = CHROMA_V_SHIFT;
stride <<= b_field;
if( b_chroma )
{
- ALIGNED_ARRAY_16( pixel, pix,[FENC_STRIDE*16] );
+ ALIGNED_ARRAY_N( pixel, pix,[FENC_STRIDE*16] );
int chromapix = h->luma2chroma_pixel[PIXEL_16x16];
int shift = 7 - CHROMA_V_SHIFT;