67 { 71, 296, 295, 237, 71, 40, 38, 19,
68 245, 193, 185, 121, 102, 73, 53, 27,
69 158, 129, 141, 107, 97, 73, 50, 26,
70 102, 116, 109, 98, 82, 66, 45, 23,
71 71, 94, 95, 81, 70, 56, 38, 20,
72 56, 77, 74, 66, 56, 44, 30, 15,
73 38, 53, 50, 45, 38, 30, 21, 11,
74 20, 27, 26, 23, 20, 15, 11, 5
78 { 0, 48, 12, 60, 3, 51, 15, 63, },
79 { 32, 16, 44, 28, 35, 19, 47, 31, },
80 { 8, 56, 4, 52, 11, 59, 7, 55, },
81 { 40, 24, 36, 20, 43, 27, 39, 23, },
82 { 2, 50, 14, 62, 1, 49, 13, 61, },
83 { 34, 18, 46, 30, 33, 17, 45, 29, },
84 { 10, 58, 6, 54, 9, 57, 5, 53, },
85 { 42, 26, 38, 22, 41, 25, 37, 21, },
110 temp= (src[x + pos] + (d[pos]>>log2_scale))>>(6-log2_scale); \
111 src[x + pos]=src[x + pos - 8*src_stride]=0; \
112 if(temp & 0x100) temp= ~(temp>>31); \
117 for(x=0; x<
width; x+=8){
134 static void store_slice2_c(
uint8_t *
dst, int16_t *src,
int dst_stride,
int src_stride,
int width,
int height,
int log2_scale)
136 #define STORE2(pos) \
137 temp= (src[x + pos] + src[x + pos + 16*src_stride] + (d[pos]>>log2_scale))>>(6-log2_scale); \
138 src[x + pos + 16*src_stride]=0; \
139 if(temp & 0x100) temp= ~(temp>>31); \
144 for(x=0; x<
width; x+=8){
160 static void mul_thrmat_c(
struct vf_priv_s *p,
int q)
167 static void column_fidct_c(int16_t* thr_adr,
DCTELEM *
data,
DCTELEM *output,
int cnt);
168 static void row_idct_c(
DCTELEM* workspace,
169 int16_t* output_adr,
int output_stride,
int cnt);
173 #define store_slice_s store_slice_c
174 #define store_slice2_s store_slice2_c
175 #define mul_thrmat_s mul_thrmat_c
176 #define column_fidct_s column_fidct_c
177 #define row_idct_s row_idct_c
178 #define row_fdct_s row_fdct_c
183 static void store_slice_mmx(
uint8_t *dst, int16_t *src,
long dst_stride,
long src_stride,
long width,
long height,
long log2_scale)
187 width = (width+7)&~7;
191 "mov %5, %%"REG_d
" \n\t"
192 "mov %6, %%"REG_S
" \n\t"
193 "mov %7, %%"REG_D
" \n\t"
194 "mov %1, %%"REG_a
" \n\t"
195 "movd %%"REG_d
", %%mm5 \n\t"
196 "xor $-1, %%"REG_d
" \n\t"
197 "mov %%"REG_a
", %%"REG_c
" \n\t"
198 "add $7, %%"REG_d
" \n\t"
200 "sub %0, %%"REG_c
" \n\t"
201 "add %%"REG_c
", %%"REG_c
" \n\t"
202 "movd %%"REG_d
", %%mm2 \n\t"
203 "mov %%"REG_c
", %1 \n\t"
204 "mov %2, %%"REG_d
" \n\t"
205 "shl $4, %%"REG_a
" \n\t"
208 "movq (%%"REG_d
"), %%mm3 \n\t"
209 "movq %%mm3, %%mm4 \n\t"
210 "pxor %%mm7, %%mm7 \n\t"
211 "punpcklbw %%mm7, %%mm3 \n\t"
212 "punpckhbw %%mm7, %%mm4 \n\t"
213 "mov %0, %%"REG_c
" \n\t"
214 "psraw %%mm5, %%mm3 \n\t"
215 "psraw %%mm5, %%mm4 \n\t"
217 "movq %%mm7, (%%"REG_S
",%%"REG_a
",) \n\t"
218 "movq (%%"REG_S
"), %%mm0 \n\t"
219 "movq 8(%%"REG_S
"), %%mm1 \n\t"
221 "movq %%mm7, 8(%%"REG_S
",%%"REG_a
",) \n\t"
222 "paddw %%mm3, %%mm0 \n\t"
223 "paddw %%mm4, %%mm1 \n\t"
225 "movq %%mm7, (%%"REG_S
") \n\t"
226 "psraw %%mm2, %%mm0 \n\t"
227 "psraw %%mm2, %%mm1 \n\t"
229 "movq %%mm7, 8(%%"REG_S
") \n\t"
230 "packuswb %%mm1, %%mm0 \n\t"
231 "add $16, %%"REG_S
" \n\t"
233 "movq %%mm0, (%%"REG_D
") \n\t"
234 "add $8, %%"REG_D
" \n\t"
235 "sub $8, %%"REG_c
" \n\t"
237 "add %1, %%"REG_S
" \n\t"
238 "add $8, %%"REG_d
" \n\t"
239 "add %3, %%"REG_D
" \n\t"
240 "cmp %4, %%"REG_d
" \n\t"
244 :
"m" (
width),
"m" (src_stride),
"erm" (od),
"m" (dst_stride),
"erm" (
end),
245 "m" (log2_scale),
"m" (src),
"m" (dst)
246 :
"%"REG_a,
"%"REG_c,
"%"REG_d,
"%"REG_S,
"%"REG_D
251 static void store_slice2_mmx(
uint8_t *dst, int16_t *src,
long dst_stride,
long src_stride,
long width,
long height,
long log2_scale)
255 width = (width+7)&~7;
259 "mov %5, %%"REG_d
" \n\t"
260 "mov %6, %%"REG_S
" \n\t"
261 "mov %7, %%"REG_D
" \n\t"
262 "mov %1, %%"REG_a
" \n\t"
263 "movd %%"REG_d
", %%mm5 \n\t"
264 "xor $-1, %%"REG_d
" \n\t"
265 "mov %%"REG_a
", %%"REG_c
" \n\t"
266 "add $7, %%"REG_d
" \n\t"
267 "sub %0, %%"REG_c
" \n\t"
268 "add %%"REG_c
", %%"REG_c
" \n\t"
269 "movd %%"REG_d
", %%mm2 \n\t"
270 "mov %%"REG_c
", %1 \n\t"
271 "mov %2, %%"REG_d
" \n\t"
272 "shl $5, %%"REG_a
" \n\t"
275 "movq (%%"REG_d
"), %%mm3 \n\t"
276 "movq %%mm3, %%mm4 \n\t"
277 "pxor %%mm7, %%mm7 \n\t"
278 "punpcklbw %%mm7, %%mm3 \n\t"
279 "punpckhbw %%mm7, %%mm4 \n\t"
280 "mov %0, %%"REG_c
" \n\t"
281 "psraw %%mm5, %%mm3 \n\t"
282 "psraw %%mm5, %%mm4 \n\t"
284 "movq (%%"REG_S
"), %%mm0 \n\t"
285 "movq 8(%%"REG_S
"), %%mm1 \n\t"
286 "paddw %%mm3, %%mm0 \n\t"
288 "paddw (%%"REG_S
",%%"REG_a
",), %%mm0 \n\t"
289 "paddw %%mm4, %%mm1 \n\t"
290 "movq 8(%%"REG_S
",%%"REG_a
",), %%mm6 \n\t"
292 "movq %%mm7, (%%"REG_S
",%%"REG_a
",) \n\t"
293 "psraw %%mm2, %%mm0 \n\t"
294 "paddw %%mm6, %%mm1 \n\t"
296 "movq %%mm7, 8(%%"REG_S
",%%"REG_a
",) \n\t"
297 "psraw %%mm2, %%mm1 \n\t"
298 "packuswb %%mm1, %%mm0 \n\t"
300 "movq %%mm0, (%%"REG_D
") \n\t"
301 "add $16, %%"REG_S
" \n\t"
302 "add $8, %%"REG_D
" \n\t"
303 "sub $8, %%"REG_c
" \n\t"
305 "add %1, %%"REG_S
" \n\t"
306 "add $8, %%"REG_d
" \n\t"
307 "add %3, %%"REG_D
" \n\t"
308 "cmp %4, %%"REG_d
" \n\t"
312 :
"m" (
width),
"m" (src_stride),
"erm" (od),
"m" (dst_stride),
"erm" (
end),
313 "m" (log2_scale),
"m" (src),
"m" (dst)
314 :
"%"REG_a,
"%"REG_c,
"%"REG_d,
"%"REG_D,
"%"REG_S
322 "movd %0, %%mm7 \n\t"
323 "add $8*8*2, %%"REG_D
" \n\t"
324 "movq 0*8(%%"REG_S
"), %%mm0 \n\t"
325 "punpcklwd %%mm7, %%mm7 \n\t"
326 "movq 1*8(%%"REG_S
"), %%mm1 \n\t"
327 "punpckldq %%mm7, %%mm7 \n\t"
328 "pmullw %%mm7, %%mm0 \n\t"
330 "movq 2*8(%%"REG_S
"), %%mm2 \n\t"
331 "pmullw %%mm7, %%mm1 \n\t"
333 "movq 3*8(%%"REG_S
"), %%mm3 \n\t"
334 "pmullw %%mm7, %%mm2 \n\t"
336 "movq %%mm0, 0*8(%%"REG_D
") \n\t"
337 "movq 4*8(%%"REG_S
"), %%mm4 \n\t"
338 "pmullw %%mm7, %%mm3 \n\t"
340 "movq %%mm1, 1*8(%%"REG_D
") \n\t"
341 "movq 5*8(%%"REG_S
"), %%mm5 \n\t"
342 "pmullw %%mm7, %%mm4 \n\t"
344 "movq %%mm2, 2*8(%%"REG_D
") \n\t"
345 "movq 6*8(%%"REG_S
"), %%mm6 \n\t"
346 "pmullw %%mm7, %%mm5 \n\t"
348 "movq %%mm3, 3*8(%%"REG_D
") \n\t"
349 "movq 7*8+0*8(%%"REG_S
"), %%mm0 \n\t"
350 "pmullw %%mm7, %%mm6 \n\t"
352 "movq %%mm4, 4*8(%%"REG_D
") \n\t"
353 "movq 7*8+1*8(%%"REG_S
"), %%mm1 \n\t"
354 "pmullw %%mm7, %%mm0 \n\t"
356 "movq %%mm5, 5*8(%%"REG_D
") \n\t"
357 "movq 7*8+2*8(%%"REG_S
"), %%mm2 \n\t"
358 "pmullw %%mm7, %%mm1 \n\t"
360 "movq %%mm6, 6*8(%%"REG_D
") \n\t"
361 "movq 7*8+3*8(%%"REG_S
"), %%mm3 \n\t"
362 "pmullw %%mm7, %%mm2 \n\t"
364 "movq %%mm0, 7*8+0*8(%%"REG_D
") \n\t"
365 "movq 7*8+4*8(%%"REG_S
"), %%mm4 \n\t"
366 "pmullw %%mm7, %%mm3 \n\t"
368 "movq %%mm1, 7*8+1*8(%%"REG_D
") \n\t"
369 "movq 7*8+5*8(%%"REG_S
"), %%mm5 \n\t"
370 "pmullw %%mm7, %%mm4 \n\t"
372 "movq %%mm2, 7*8+2*8(%%"REG_D
") \n\t"
373 "movq 7*8+6*8(%%"REG_S
"), %%mm6 \n\t"
374 "pmullw %%mm7, %%mm5 \n\t"
376 "movq %%mm3, 7*8+3*8(%%"REG_D
") \n\t"
377 "movq 14*8+0*8(%%"REG_S
"), %%mm0 \n\t"
378 "pmullw %%mm7, %%mm6 \n\t"
380 "movq %%mm4, 7*8+4*8(%%"REG_D
") \n\t"
381 "movq 14*8+1*8(%%"REG_S
"), %%mm1 \n\t"
382 "pmullw %%mm7, %%mm0 \n\t"
384 "movq %%mm5, 7*8+5*8(%%"REG_D
") \n\t"
385 "pmullw %%mm7, %%mm1 \n\t"
387 "movq %%mm6, 7*8+6*8(%%"REG_D
") \n\t"
388 "movq %%mm0, 14*8+0*8(%%"REG_D
") \n\t"
389 "movq %%mm1, 14*8+1*8(%%"REG_D
") \n\t"
391 :
"+g" (q),
"+S" (adr),
"+D" (adr)
398 int16_t* output_adr,
int output_stride,
int cnt);
401 #define store_slice_s store_slice_mmx
402 #define store_slice2_s store_slice2_mmx
403 #define mul_thrmat_s mul_thrmat_mmx
404 #define column_fidct_s column_fidct_mmx
405 #define row_idct_s row_idct_mmx
406 #define row_fdct_s row_fdct_mmx
410 int dst_stride,
int src_stride,
411 int width,
int height,
412 uint8_t *qp_store,
int qp_stride,
int is_luma)
414 int x, x0, y, es, qy,
t;
417 const int qps= 3 + is_luma;
422 memset(block3, 0, 4*8*
BLOCKSZ);
425 if (!src || !dst)
return;
430 p->
src[index - x - 1]= p->
src[index + x ];
431 p->
src[index + width + x ]= p->
src[index + width - x - 1];
441 memset(p->
temp+ 8 +y*stride, 0,width*
sizeof(int16_t));
443 for(y=step; y<height+8; y+=step){
445 if (qy>height-1) qy=height-1;
447 qy=(qy>>qps)*qp_stride;
454 for (x=0; x<8*(
BLOCKSZ-1); x+=8) {
457 t=qp_store[qy+(t>>qps)];
469 row_fdct_s(block+8*8, p->
src + y*stride+8+x0 +2-(y&1), stride, (es-4)>>2);
471 row_idct_s(block3+0*8, p->
temp + (y&15)*stride+x0+2-(y&1), stride, es>>2);
472 {
const int y1=y-8+step;
475 dst_stride, stride, width, 8, 5-p->
log2_count);
477 dst_stride, stride, width, 8, 5-p->
log2_count);
483 dst_stride, stride, width, y&7, 5-p->
log2_count);
485 dst_stride, stride, width, y&7, 5-p->
log2_count);
489 static int config(
struct vf_instance *vf,
490 int width,
int height,
int d_width,
int d_height,
491 unsigned int flags,
unsigned int outfmt)
493 int h= (height+16+15)&(~15);
495 vf->priv->temp_stride= (width+16+15)&(~15);
496 vf->priv->temp= (int16_t*)
av_mallocz(vf->priv->temp_stride*3*8*
sizeof(int16_t));
509 mpi->
planes[0]=vf->dmpi->planes[0];
510 mpi->
stride[0]=vf->dmpi->stride[0];
511 mpi->
width=vf->dmpi->width;
513 mpi->
planes[1]=vf->dmpi->planes[1];
514 mpi->
planes[2]=vf->dmpi->planes[2];
515 mpi->
stride[1]=vf->dmpi->stride[1];
516 mpi->
stride[2]=vf->dmpi->stride[2];
538 int h = (mpi->
h + 15) >> 4;
540 w = (mpi->
w + 15) >> 4;
543 if(!vf->priv->non_b_qp)
544 vf->priv->non_b_qp= malloc(w*h);
548 char *qp_tab= vf->priv->non_b_qp;
549 if(vf->priv->bframes || !qp_tab)
552 if(qp_tab || vf->priv->qp){
554 mpi->
w, mpi->
h, qp_tab, mpi->
qstride, 1);
575 static void uninit(
struct vf_instance *vf)
577 if(!vf->priv)
return;
580 vf->priv->temp=
NULL;
585 free(vf->priv->non_b_qp);
586 vf->priv->non_b_qp=
NULL;
613 static int control(
struct vf_instance *vf,
int request,
void*
data)
619 vf->priv->log2_count= *((
unsigned int*)data);
620 if (vf->priv->log2_count < 4) vf->priv->log2_count=4;
629 int custom_threshold_m[64];
648 if (args) sscanf(args,
"%d:%d:%d:%d", &log2c, &vf->
priv->
qp, &i, &vf->
priv->
bframes);
650 if( log2c >=4 && log2c <=5 )
652 else if( log2c >= 6 )
658 if (i < -15) i = -15;
668 |(((uint64_t)custom_threshold_m[i*8+6])<<16)
669 |(((uint64_t)custom_threshold_m[i*8+0])<<32)
670 |(((uint64_t)custom_threshold_m[i*8+4])<<48);
672 |(((uint64_t)custom_threshold_m[i*8+3])<<16)
673 |(((uint64_t)custom_threshold_m[i*8+1])<<32)
674 |(((uint64_t)custom_threshold_m[i*8+7])<<48);
683 "fast simple postprocess",
685 "Michael Niedermayer, Nikolaj Poroshin",
700 #define DCTSIZE_S "8"
702 #define FIX(x,s) ((int) ((x) * (1<<s) + 0.5)&0xffff)
703 #define C64(x) ((uint64_t)((x)|(x)<<16))<<32 | (uint64_t)(x) | (uint64_t)(x)<<16
704 #define FIX64(x,s) C64(FIX(x,s))
706 #define MULTIPLY16H(x,k) (((x)*(k))>>16)
707 #define THRESHOLD(r,x,t) if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
708 #define DESCALE(x,n) (((x) + (1 << ((n)-1))) >> n)
738 static const int16_t FIX_1_414213562_A=
FIX(1.414213562, 14);
750 int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
751 int_simd16_t tmp10, tmp11, tmp12, tmp13;
752 int_simd16_t z1,z2,z3,z4,z5, z10, z11, z12, z13;
753 int_simd16_t d0, d1, d2, d3, d4, d5, d6, d7;
763 for (; cnt > 0; cnt-=2) {
764 threshold=(int16_t*)thr_adr;
765 for (ctr =
DCTSIZE; ctr > 0; ctr--) {
789 z1 =
MULTIPLY16H((tmp12 + tmp13) <<2, FIX_0_707106781);
800 tmp10 = (tmp0 + tmp2)>>2;
801 tmp11 = (tmp0 - tmp2)>>2;
803 tmp13 = (tmp1 + tmp3)>>2;
804 tmp12 =
MULTIPLY16H((tmp1 - tmp3), FIX_1_414213562_A) - tmp13;
806 tmp0 = tmp10 + tmp13;
807 tmp3 = tmp10 - tmp13;
808 tmp1 = tmp11 + tmp12;
809 tmp2 = tmp11 - tmp12;
817 z5 =
MULTIPLY16H((tmp10 - tmp12)<<2, FIX_0_382683433);
839 z10 = (tmp6 - tmp5)<<1;
841 z12 = (tmp4 - tmp7)<<1;
843 tmp7 = (z11 + z13)>>2;
844 tmp11 =
MULTIPLY16H((z11 - z13)<<1, FIX_1_414213562);
853 wsptr[
DCTSIZE*0]+= (tmp0 + tmp7);
854 wsptr[
DCTSIZE*1]+= (tmp1 + tmp6);
855 wsptr[
DCTSIZE*2]+= (tmp2 + tmp5);
856 wsptr[
DCTSIZE*3]+= (tmp3 - tmp4);
857 wsptr[
DCTSIZE*4]+= (tmp3 + tmp4);
858 wsptr[
DCTSIZE*5]+= (tmp2 - tmp5);
859 wsptr[
DCTSIZE*6]= (tmp1 - tmp6);
860 wsptr[
DCTSIZE*7]= (tmp0 - tmp7);
875 uint64_t __attribute__((aligned(8))) temps[4];
879 "movq "DCTSIZE_S"*0*2(%%"REG_S
"), %%mm1 \n\t"
881 "movq "DCTSIZE_S"*3*2(%%"REG_S
"), %%mm7 \n\t"
882 "movq %%mm1, %%mm0 \n\t"
884 "paddw "DCTSIZE_S"*7*2(%%"REG_S
"), %%mm1 \n\t"
885 "movq %%mm7, %%mm3 \n\t"
887 "paddw "DCTSIZE_S"*4*2(%%"REG_S
"), %%mm7 \n\t"
888 "movq %%mm1, %%mm5 \n\t"
890 "movq "DCTSIZE_S"*1*2(%%"REG_S
"), %%mm6 \n\t"
891 "psubw %%mm7, %%mm1 \n\t"
893 "movq "DCTSIZE_S"*2*2(%%"REG_S
"), %%mm2 \n\t"
894 "movq %%mm6, %%mm4 \n\t"
896 "paddw "DCTSIZE_S"*6*2(%%"REG_S
"), %%mm6 \n\t"
897 "paddw %%mm7, %%mm5 \n\t"
899 "paddw "DCTSIZE_S"*5*2(%%"REG_S
"), %%mm2 \n\t"
900 "movq %%mm6, %%mm7 \n\t"
902 "paddw %%mm2, %%mm6 \n\t"
903 "psubw %%mm2, %%mm7 \n\t"
905 "movq %%mm5, %%mm2 \n\t"
906 "paddw %%mm6, %%mm5 \n\t"
908 "psubw %%mm6, %%mm2 \n\t"
909 "paddw %%mm1, %%mm7 \n\t"
911 "movq 4*16(%%"REG_d
"), %%mm6 \n\t"
912 "psllw $2, %%mm7 \n\t"
914 "psubw 0*16(%%"REG_d
"), %%mm5 \n\t"
915 "psubw %%mm6, %%mm2 \n\t"
917 "paddusw 0*16(%%"REG_d
"), %%mm5 \n\t"
918 "paddusw %%mm6, %%mm2 \n\t"
922 "paddw 0*16(%%"REG_d
"), %%mm5 \n\t"
923 "paddw %%mm6, %%mm2 \n\t"
925 "psubusw 0*16(%%"REG_d
"), %%mm5 \n\t"
926 "psubusw %%mm6, %%mm2 \n\t"
931 "paddw "MANGLE(MM_2)
", %%mm5 \n\t"
932 "movq %%mm2, %%mm6 \n\t"
934 "paddw %%mm5, %%mm2 \n\t"
935 "psubw %%mm6, %%mm5 \n\t"
937 "movq %%mm1, %%mm6 \n\t"
938 "paddw %%mm7, %%mm1 \n\t"
940 "psubw 2*16(%%"REG_d
"), %%mm1 \n\t"
941 "psubw %%mm7, %%mm6 \n\t"
943 "movq 6*16(%%"REG_d
"), %%mm7 \n\t"
944 "psraw $2, %%mm5 \n\t"
946 "paddusw 2*16(%%"REG_d
"), %%mm1 \n\t"
947 "psubw %%mm7, %%mm6 \n\t"
950 "paddw 2*16(%%"REG_d
"), %%mm1 \n\t"
951 "paddusw %%mm7, %%mm6 \n\t"
953 "psubusw 2*16(%%"REG_d
"), %%mm1 \n\t"
954 "paddw %%mm7, %%mm6 \n\t"
956 "psubw "DCTSIZE_S"*4*2(%%"REG_S
"), %%mm3 \n\t"
957 "psubusw %%mm7, %%mm6 \n\t"
961 "movq %%mm1, %%mm7 \n\t"
962 "psraw $2, %%mm2 \n\t"
964 "psubw "DCTSIZE_S"*6*2(%%"REG_S
"), %%mm4 \n\t"
965 "psubw %%mm6, %%mm1 \n\t"
967 "psubw "DCTSIZE_S"*7*2(%%"REG_S
"), %%mm0 \n\t"
968 "paddw %%mm7, %%mm6 \n\t"
970 "psraw $2, %%mm6 \n\t"
971 "movq %%mm2, %%mm7 \n\t"
973 "pmulhw "MANGLE(MM_FIX_1_414213562_A)
", %%mm1 \n\t"
974 "paddw %%mm6, %%mm2 \n\t"
976 "movq %%mm2, 0*8+%3 \n\t"
977 "psubw %%mm6, %%mm7 \n\t"
979 "movq "DCTSIZE_S"*2*2(%%"REG_S
"), %%mm2 \n\t"
980 "psubw %%mm6, %%mm1 \n\t"
982 "psubw "DCTSIZE_S"*5*2(%%"REG_S
"), %%mm2 \n\t"
983 "movq %%mm5, %%mm6 \n\t"
985 "movq %%mm7, 3*8+%3 \n\t"
986 "paddw %%mm2, %%mm3 \n\t"
988 "paddw %%mm4, %%mm2 \n\t"
989 "paddw %%mm0, %%mm4 \n\t"
991 "movq %%mm3, %%mm7 \n\t"
992 "psubw %%mm4, %%mm3 \n\t"
994 "psllw $2, %%mm3 \n\t"
995 "psllw $2, %%mm7 \n\t"
997 "pmulhw "MANGLE(MM_FIX_0_382683433)
", %%mm3 \n\t"
998 "psllw $2, %%mm4 \n\t"
1001 "psllw $2, %%mm2 \n\t"
1003 "pmulhw "MANGLE(MM_FIX_1_306562965)
", %%mm4 \n\t"
1004 "paddw %%mm1, %%mm5 \n\t"
1007 "psubw %%mm1, %%mm6 \n\t"
1010 "paddw %%mm3, %%mm7 \n\t"
1012 "movq %%mm5, 1*8+%3 \n\t"
1013 "paddw %%mm3, %%mm4 \n\t"
1015 "movq 3*16(%%"REG_d
"), %%mm3 \n\t"
1016 "movq %%mm0, %%mm1 \n\t"
1018 "movq %%mm6, 2*8+%3 \n\t"
1019 "psubw %%mm2, %%mm1 \n\t"
1022 "paddw %%mm2, %%mm0 \n\t"
1023 "movq %%mm1, %%mm5 \n\t"
1025 "movq 5*16(%%"REG_d
"), %%mm2 \n\t"
1026 "psubw %%mm7, %%mm1 \n\t"
1028 "paddw %%mm7, %%mm5 \n\t"
1029 "psubw %%mm3, %%mm1 \n\t"
1031 "movq 1*16(%%"REG_d
"), %%mm7 \n\t"
1032 "psubw %%mm2, %%mm5 \n\t"
1034 "movq %%mm0, %%mm6 \n\t"
1035 "paddw %%mm4, %%mm0 \n\t"
1037 "paddusw %%mm3, %%mm1 \n\t"
1038 "psubw %%mm4, %%mm6 \n\t"
1041 "movq 7*16(%%"REG_d
"), %%mm4 \n\t"
1042 "psubw %%mm7, %%mm0 \n\t"
1044 "psubw %%mm4, %%mm6 \n\t"
1045 "paddusw %%mm2, %%mm5 \n\t"
1047 "paddusw %%mm4, %%mm6 \n\t"
1048 "paddw %%mm3, %%mm1 \n\t"
1050 "paddw %%mm2, %%mm5 \n\t"
1051 "paddw %%mm4, %%mm6 \n\t"
1053 "psubusw %%mm3, %%mm1 \n\t"
1054 "psubusw %%mm2, %%mm5 \n\t"
1056 "psubusw %%mm4, %%mm6 \n\t"
1057 "movq %%mm1, %%mm4 \n\t"
1059 "por %%mm5, %%mm4 \n\t"
1060 "paddusw %%mm7, %%mm0 \n\t"
1062 "por %%mm6, %%mm4 \n\t"
1063 "paddw %%mm7, %%mm0 \n\t"
1065 "packssdw %%mm4, %%mm4 \n\t"
1066 "psubusw %%mm7, %%mm0 \n\t"
1068 "movd %%mm4, %%"REG_a
" \n\t"
1069 "or %%"REG_a
", %%"REG_a
" \n\t"
1078 "movq 0*8+%3, %%mm4 \n\t"
1079 "movq %%mm0, %%mm1 \n\t"
1081 "pmulhw "MANGLE(MM_FIX_0_847759065)
", %%mm0 \n\t"
1082 "movq %%mm1, %%mm2 \n\t"
1084 "movq "DCTSIZE_S"*0*2(%%"REG_D
"), %%mm5 \n\t"
1085 "movq %%mm2, %%mm3 \n\t"
1087 "pmulhw "MANGLE(MM_FIX_0_566454497)
", %%mm1 \n\t"
1088 "paddw %%mm4, %%mm5 \n\t"
1090 "movq 1*8+%3, %%mm6 \n\t"
1092 "psraw $2, %%mm3 \n\t"
1094 "pmulhw "MANGLE(MM_FIX_0_198912367)
", %%mm2 \n\t"
1095 "psubw %%mm3, %%mm4 \n\t"
1097 "movq "DCTSIZE_S"*1*2(%%"REG_D
"), %%mm7 \n\t"
1098 "paddw %%mm3, %%mm5 \n\t"
1100 "movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D
") \n\t"
1101 "paddw %%mm6, %%mm7 \n\t"
1103 "movq 2*8+%3, %%mm3 \n\t"
1104 "psubw %%mm0, %%mm6 \n\t"
1106 "movq "DCTSIZE_S"*2*2(%%"REG_D
"), %%mm4 \n\t"
1107 "paddw %%mm0, %%mm7 \n\t"
1109 "movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D
") \n\t"
1110 "paddw %%mm3, %%mm4 \n\t"
1112 "movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D
") \n\t"
1113 "psubw %%mm1, %%mm3 \n\t"
1115 "movq "DCTSIZE_S"*5*2(%%"REG_D
"), %%mm5 \n\t"
1116 "paddw %%mm1, %%mm4 \n\t"
1118 "movq "DCTSIZE_S"*3*2(%%"REG_D
"), %%mm6 \n\t"
1119 "paddw %%mm3, %%mm5 \n\t"
1121 "movq 3*8+%3, %%mm0 \n\t"
1122 "add $8, %%"REG_S
" \n\t"
1124 "movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D
") \n\t"
1125 "paddw %%mm0, %%mm6 \n\t"
1127 "movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D
") \n\t"
1128 "psubw %%mm2, %%mm0 \n\t"
1130 "movq "DCTSIZE_S"*4*2(%%"REG_D
"), %%mm7 \n\t"
1131 "paddw %%mm2, %%mm6 \n\t"
1133 "movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D
") \n\t"
1134 "paddw %%mm0, %%mm7 \n\t"
1136 "movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D
") \n\t"
1138 "movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D
") \n\t"
1139 "add $8, %%"REG_D
" \n\t"
1148 "movq %%mm5, %%mm3 \n\t"
1149 "psubw %%mm1, %%mm5 \n\t"
1151 "psllw $1, %%mm5 \n\t"
1152 "paddw %%mm1, %%mm3 \n\t"
1154 "movq %%mm0, %%mm2 \n\t"
1155 "psubw %%mm6, %%mm0 \n\t"
1157 "movq %%mm5, %%mm1 \n\t"
1158 "psllw $1, %%mm0 \n\t"
1160 "pmulhw "MANGLE(MM_FIX_2_613125930)
", %%mm1 \n\t"
1161 "paddw %%mm0, %%mm5 \n\t"
1163 "pmulhw "MANGLE(MM_FIX_1_847759065)
", %%mm5 \n\t"
1164 "paddw %%mm6, %%mm2 \n\t"
1166 "pmulhw "MANGLE(MM_FIX_1_082392200)
", %%mm0 \n\t"
1167 "movq %%mm2, %%mm7 \n\t"
1170 "movq 0*8+%3, %%mm4 \n\t"
1171 "psubw %%mm3, %%mm2 \n\t"
1173 "psllw $1, %%mm2 \n\t"
1174 "paddw %%mm3, %%mm7 \n\t"
1176 "pmulhw "MANGLE(MM_FIX_1_414213562)
", %%mm2 \n\t"
1177 "movq %%mm4, %%mm6 \n\t"
1179 "psraw $2, %%mm7 \n\t"
1181 "paddw "DCTSIZE_S"*0*2(%%"REG_D
"), %%mm4 \n\t"
1182 "psubw %%mm7, %%mm6 \n\t"
1184 "movq 1*8+%3, %%mm3 \n\t"
1185 "paddw %%mm7, %%mm4 \n\t"
1187 "movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D
") \n\t"
1188 "paddw %%mm5, %%mm1 \n\t"
1190 "movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D
") \n\t"
1191 "psubw %%mm7, %%mm1 \n\t"
1193 "movq 2*8+%3, %%mm7 \n\t"
1194 "psubw %%mm5, %%mm0 \n\t"
1196 "movq 3*8+%3, %%mm6 \n\t"
1197 "movq %%mm3, %%mm5 \n\t"
1199 "paddw "DCTSIZE_S"*1*2(%%"REG_D
"), %%mm3 \n\t"
1200 "psubw %%mm1, %%mm5 \n\t"
1202 "psubw %%mm1, %%mm2 \n\t"
1203 "paddw %%mm1, %%mm3 \n\t"
1205 "movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D
") \n\t"
1206 "movq %%mm7, %%mm4 \n\t"
1208 "paddw "DCTSIZE_S"*2*2(%%"REG_D
"), %%mm7 \n\t"
1209 "psubw %%mm2, %%mm4 \n\t"
1211 "paddw "DCTSIZE_S"*5*2(%%"REG_D
"), %%mm4 \n\t"
1212 "paddw %%mm2, %%mm7 \n\t"
1214 "movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D
") \n\t"
1215 "paddw %%mm2, %%mm0 \n\t"
1218 "movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D
") \n\t"
1219 "movq %%mm6, %%mm1 \n\t"
1221 "paddw "DCTSIZE_S"*4*2(%%"REG_D
"), %%mm6 \n\t"
1222 "psubw %%mm0, %%mm1 \n\t"
1224 "paddw "DCTSIZE_S"*3*2(%%"REG_D
"), %%mm1 \n\t"
1225 "paddw %%mm0, %%mm6 \n\t"
1227 "movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D
") \n\t"
1228 "add $8, %%"REG_S
" \n\t"
1230 "movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D
") \n\t"
1232 "movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D
") \n\t"
1233 "add $8, %%"REG_D
" \n\t"
1237 "movq "DCTSIZE_S"*0*2(%%"REG_S
"), %%mm1 \n\t"
1239 "movq "DCTSIZE_S"*3*2(%%"REG_S
"), %%mm7 \n\t"
1240 "movq %%mm1, %%mm0 \n\t"
1242 "paddw "DCTSIZE_S"*7*2(%%"REG_S
"), %%mm1 \n\t"
1243 "movq %%mm7, %%mm3 \n\t"
1245 "paddw "DCTSIZE_S"*4*2(%%"REG_S
"), %%mm7 \n\t"
1246 "movq %%mm1, %%mm5 \n\t"
1248 "movq "DCTSIZE_S"*1*2(%%"REG_S
"), %%mm6 \n\t"
1249 "psubw %%mm7, %%mm1 \n\t"
1251 "movq "DCTSIZE_S"*2*2(%%"REG_S
"), %%mm2 \n\t"
1252 "movq %%mm6, %%mm4 \n\t"
1254 "paddw "DCTSIZE_S"*6*2(%%"REG_S
"), %%mm6 \n\t"
1255 "paddw %%mm7, %%mm5 \n\t"
1257 "paddw "DCTSIZE_S"*5*2(%%"REG_S
"), %%mm2 \n\t"
1258 "movq %%mm6, %%mm7 \n\t"
1260 "paddw %%mm2, %%mm6 \n\t"
1261 "psubw %%mm2, %%mm7 \n\t"
1263 "movq %%mm5, %%mm2 \n\t"
1264 "paddw %%mm6, %%mm5 \n\t"
1266 "psubw %%mm6, %%mm2 \n\t"
1267 "paddw %%mm1, %%mm7 \n\t"
1269 "movq 1*8+4*16(%%"REG_d
"), %%mm6 \n\t"
1270 "psllw $2, %%mm7 \n\t"
1272 "psubw 1*8+0*16(%%"REG_d
"), %%mm5 \n\t"
1273 "psubw %%mm6, %%mm2 \n\t"
1275 "paddusw 1*8+0*16(%%"REG_d
"), %%mm5 \n\t"
1276 "paddusw %%mm6, %%mm2 \n\t"
1280 "paddw 1*8+0*16(%%"REG_d
"), %%mm5 \n\t"
1281 "paddw %%mm6, %%mm2 \n\t"
1283 "psubusw 1*8+0*16(%%"REG_d
"), %%mm5 \n\t"
1284 "psubusw %%mm6, %%mm2 \n\t"
1289 "paddw "MANGLE(MM_2)
", %%mm5 \n\t"
1290 "movq %%mm2, %%mm6 \n\t"
1292 "paddw %%mm5, %%mm2 \n\t"
1293 "psubw %%mm6, %%mm5 \n\t"
1295 "movq %%mm1, %%mm6 \n\t"
1296 "paddw %%mm7, %%mm1 \n\t"
1298 "psubw 1*8+2*16(%%"REG_d
"), %%mm1 \n\t"
1299 "psubw %%mm7, %%mm6 \n\t"
1301 "movq 1*8+6*16(%%"REG_d
"), %%mm7 \n\t"
1302 "psraw $2, %%mm5 \n\t"
1304 "paddusw 1*8+2*16(%%"REG_d
"), %%mm1 \n\t"
1305 "psubw %%mm7, %%mm6 \n\t"
1308 "paddw 1*8+2*16(%%"REG_d
"), %%mm1 \n\t"
1309 "paddusw %%mm7, %%mm6 \n\t"
1311 "psubusw 1*8+2*16(%%"REG_d
"), %%mm1 \n\t"
1312 "paddw %%mm7, %%mm6 \n\t"
1314 "psubw "DCTSIZE_S"*4*2(%%"REG_S
"), %%mm3 \n\t"
1315 "psubusw %%mm7, %%mm6 \n\t"
1319 "movq %%mm1, %%mm7 \n\t"
1320 "psraw $2, %%mm2 \n\t"
1322 "psubw "DCTSIZE_S"*6*2(%%"REG_S
"), %%mm4 \n\t"
1323 "psubw %%mm6, %%mm1 \n\t"
1325 "psubw "DCTSIZE_S"*7*2(%%"REG_S
"), %%mm0 \n\t"
1326 "paddw %%mm7, %%mm6 \n\t"
1328 "psraw $2, %%mm6 \n\t"
1329 "movq %%mm2, %%mm7 \n\t"
1331 "pmulhw "MANGLE(MM_FIX_1_414213562_A)
", %%mm1 \n\t"
1332 "paddw %%mm6, %%mm2 \n\t"
1334 "movq %%mm2, 0*8+%3 \n\t"
1335 "psubw %%mm6, %%mm7 \n\t"
1337 "movq "DCTSIZE_S"*2*2(%%"REG_S
"), %%mm2 \n\t"
1338 "psubw %%mm6, %%mm1 \n\t"
1340 "psubw "DCTSIZE_S"*5*2(%%"REG_S
"), %%mm2 \n\t"
1341 "movq %%mm5, %%mm6 \n\t"
1343 "movq %%mm7, 3*8+%3 \n\t"
1344 "paddw %%mm2, %%mm3 \n\t"
1346 "paddw %%mm4, %%mm2 \n\t"
1347 "paddw %%mm0, %%mm4 \n\t"
1349 "movq %%mm3, %%mm7 \n\t"
1350 "psubw %%mm4, %%mm3 \n\t"
1352 "psllw $2, %%mm3 \n\t"
1353 "psllw $2, %%mm7 \n\t"
1355 "pmulhw "MANGLE(MM_FIX_0_382683433)
", %%mm3 \n\t"
1356 "psllw $2, %%mm4 \n\t"
1359 "psllw $2, %%mm2 \n\t"
1361 "pmulhw "MANGLE(MM_FIX_1_306562965)
", %%mm4 \n\t"
1362 "paddw %%mm1, %%mm5 \n\t"
1365 "psubw %%mm1, %%mm6 \n\t"
1368 "paddw %%mm3, %%mm7 \n\t"
1370 "movq %%mm5, 1*8+%3 \n\t"
1371 "paddw %%mm3, %%mm4 \n\t"
1373 "movq 1*8+3*16(%%"REG_d
"), %%mm3 \n\t"
1374 "movq %%mm0, %%mm1 \n\t"
1376 "movq %%mm6, 2*8+%3 \n\t"
1377 "psubw %%mm2, %%mm1 \n\t"
1380 "paddw %%mm2, %%mm0 \n\t"
1381 "movq %%mm1, %%mm5 \n\t"
1383 "movq 1*8+5*16(%%"REG_d
"), %%mm2 \n\t"
1384 "psubw %%mm7, %%mm1 \n\t"
1386 "paddw %%mm7, %%mm5 \n\t"
1387 "psubw %%mm3, %%mm1 \n\t"
1389 "movq 1*8+1*16(%%"REG_d
"), %%mm7 \n\t"
1390 "psubw %%mm2, %%mm5 \n\t"
1392 "movq %%mm0, %%mm6 \n\t"
1393 "paddw %%mm4, %%mm0 \n\t"
1395 "paddusw %%mm3, %%mm1 \n\t"
1396 "psubw %%mm4, %%mm6 \n\t"
1399 "movq 1*8+7*16(%%"REG_d
"), %%mm4 \n\t"
1400 "psubw %%mm7, %%mm0 \n\t"
1402 "psubw %%mm4, %%mm6 \n\t"
1403 "paddusw %%mm2, %%mm5 \n\t"
1405 "paddusw %%mm4, %%mm6 \n\t"
1406 "paddw %%mm3, %%mm1 \n\t"
1408 "paddw %%mm2, %%mm5 \n\t"
1409 "paddw %%mm4, %%mm6 \n\t"
1411 "psubusw %%mm3, %%mm1 \n\t"
1412 "psubusw %%mm2, %%mm5 \n\t"
1414 "psubusw %%mm4, %%mm6 \n\t"
1415 "movq %%mm1, %%mm4 \n\t"
1417 "por %%mm5, %%mm4 \n\t"
1418 "paddusw %%mm7, %%mm0 \n\t"
1420 "por %%mm6, %%mm4 \n\t"
1421 "paddw %%mm7, %%mm0 \n\t"
1423 "packssdw %%mm4, %%mm4 \n\t"
1424 "psubusw %%mm7, %%mm0 \n\t"
1426 "movd %%mm4, %%"REG_a
" \n\t"
1427 "or %%"REG_a
", %%"REG_a
" \n\t"
1436 "movq 0*8+%3, %%mm4 \n\t"
1437 "movq %%mm0, %%mm1 \n\t"
1439 "pmulhw "MANGLE(MM_FIX_0_847759065)
", %%mm0 \n\t"
1440 "movq %%mm1, %%mm2 \n\t"
1442 "movq "DCTSIZE_S"*0*2(%%"REG_D
"), %%mm5 \n\t"
1443 "movq %%mm2, %%mm3 \n\t"
1445 "pmulhw "MANGLE(MM_FIX_0_566454497)
", %%mm1 \n\t"
1446 "paddw %%mm4, %%mm5 \n\t"
1448 "movq 1*8+%3, %%mm6 \n\t"
1450 "psraw $2, %%mm3 \n\t"
1452 "pmulhw "MANGLE(MM_FIX_0_198912367)
", %%mm2 \n\t"
1453 "psubw %%mm3, %%mm4 \n\t"
1455 "movq "DCTSIZE_S"*1*2(%%"REG_D
"), %%mm7 \n\t"
1456 "paddw %%mm3, %%mm5 \n\t"
1458 "movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D
") \n\t"
1459 "paddw %%mm6, %%mm7 \n\t"
1461 "movq 2*8+%3, %%mm3 \n\t"
1462 "psubw %%mm0, %%mm6 \n\t"
1464 "movq "DCTSIZE_S"*2*2(%%"REG_D
"), %%mm4 \n\t"
1465 "paddw %%mm0, %%mm7 \n\t"
1467 "movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D
") \n\t"
1468 "paddw %%mm3, %%mm4 \n\t"
1470 "movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D
") \n\t"
1471 "psubw %%mm1, %%mm3 \n\t"
1473 "movq "DCTSIZE_S"*5*2(%%"REG_D
"), %%mm5 \n\t"
1474 "paddw %%mm1, %%mm4 \n\t"
1476 "movq "DCTSIZE_S"*3*2(%%"REG_D
"), %%mm6 \n\t"
1477 "paddw %%mm3, %%mm5 \n\t"
1479 "movq 3*8+%3, %%mm0 \n\t"
1480 "add $24, %%"REG_S
" \n\t"
1482 "movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D
") \n\t"
1483 "paddw %%mm0, %%mm6 \n\t"
1485 "movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D
") \n\t"
1486 "psubw %%mm2, %%mm0 \n\t"
1488 "movq "DCTSIZE_S"*4*2(%%"REG_D
"), %%mm7 \n\t"
1489 "paddw %%mm2, %%mm6 \n\t"
1491 "movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D
") \n\t"
1492 "paddw %%mm0, %%mm7 \n\t"
1494 "movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D
") \n\t"
1496 "movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D
") \n\t"
1497 "add $24, %%"REG_D
" \n\t"
1498 "sub $2, %%"REG_c
" \n\t"
1508 "movq %%mm5, %%mm3 \n\t"
1509 "psubw %%mm1, %%mm5 \n\t"
1511 "psllw $1, %%mm5 \n\t"
1512 "paddw %%mm1, %%mm3 \n\t"
1514 "movq %%mm0, %%mm2 \n\t"
1515 "psubw %%mm6, %%mm0 \n\t"
1517 "movq %%mm5, %%mm1 \n\t"
1518 "psllw $1, %%mm0 \n\t"
1520 "pmulhw "MANGLE(MM_FIX_2_613125930)
", %%mm1 \n\t"
1521 "paddw %%mm0, %%mm5 \n\t"
1523 "pmulhw "MANGLE(MM_FIX_1_847759065)
", %%mm5 \n\t"
1524 "paddw %%mm6, %%mm2 \n\t"
1526 "pmulhw "MANGLE(MM_FIX_1_082392200)
", %%mm0 \n\t"
1527 "movq %%mm2, %%mm7 \n\t"
1530 "movq 0*8+%3, %%mm4 \n\t"
1531 "psubw %%mm3, %%mm2 \n\t"
1533 "psllw $1, %%mm2 \n\t"
1534 "paddw %%mm3, %%mm7 \n\t"
1536 "pmulhw "MANGLE(MM_FIX_1_414213562)
", %%mm2 \n\t"
1537 "movq %%mm4, %%mm6 \n\t"
1539 "psraw $2, %%mm7 \n\t"
1541 "paddw "DCTSIZE_S"*0*2(%%"REG_D
"), %%mm4 \n\t"
1542 "psubw %%mm7, %%mm6 \n\t"
1544 "movq 1*8+%3, %%mm3 \n\t"
1545 "paddw %%mm7, %%mm4 \n\t"
1547 "movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D
") \n\t"
1548 "paddw %%mm5, %%mm1 \n\t"
1550 "movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D
") \n\t"
1551 "psubw %%mm7, %%mm1 \n\t"
1553 "movq 2*8+%3, %%mm7 \n\t"
1554 "psubw %%mm5, %%mm0 \n\t"
1556 "movq 3*8+%3, %%mm6 \n\t"
1557 "movq %%mm3, %%mm5 \n\t"
1559 "paddw "DCTSIZE_S"*1*2(%%"REG_D
"), %%mm3 \n\t"
1560 "psubw %%mm1, %%mm5 \n\t"
1562 "psubw %%mm1, %%mm2 \n\t"
1563 "paddw %%mm1, %%mm3 \n\t"
1565 "movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D
") \n\t"
1566 "movq %%mm7, %%mm4 \n\t"
1568 "paddw "DCTSIZE_S"*2*2(%%"REG_D
"), %%mm7 \n\t"
1569 "psubw %%mm2, %%mm4 \n\t"
1571 "paddw "DCTSIZE_S"*5*2(%%"REG_D
"), %%mm4 \n\t"
1572 "paddw %%mm2, %%mm7 \n\t"
1574 "movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D
") \n\t"
1575 "paddw %%mm2, %%mm0 \n\t"
1578 "movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D
") \n\t"
1579 "movq %%mm6, %%mm1 \n\t"
1581 "paddw "DCTSIZE_S"*4*2(%%"REG_D
"), %%mm6 \n\t"
1582 "psubw %%mm0, %%mm1 \n\t"
1584 "paddw "DCTSIZE_S"*3*2(%%"REG_D
"), %%mm1 \n\t"
1585 "paddw %%mm0, %%mm6 \n\t"
1587 "movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D
") \n\t"
1588 "add $24, %%"REG_S
" \n\t"
1590 "movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D
") \n\t"
1592 "movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D
") \n\t"
1593 "add $24, %%"REG_D
" \n\t"
1594 "sub $2, %%"REG_c
" \n\t"
1598 :
"+S"(
data),
"+D"(output),
"+c"(cnt),
"=o"(temps)
1608 static void row_idct_c(
DCTELEM* workspace,
1609 int16_t* output_adr,
int output_stride,
int cnt)
1611 int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
1612 int_simd16_t tmp10, tmp11, tmp12, tmp13;
1613 int_simd16_t z5, z10, z11, z12, z13;
1619 outptr = output_adr;
1620 for (; cnt > 0; cnt--) {
1623 tmp10 = ( wsptr[2] + wsptr[3]);
1624 tmp11 = ( wsptr[2] - wsptr[3]);
1626 tmp13 = ( wsptr[0] + wsptr[1]);
1627 tmp12 = (
MULTIPLY16H( wsptr[0] - wsptr[1], FIX_1_414213562_A)<<2) - tmp13;
1629 tmp0 = tmp10 + tmp13;
1630 tmp3 = tmp10 - tmp13;
1631 tmp1 = tmp11 + tmp12;
1632 tmp2 = tmp11 - tmp12;
1640 z13 = wsptr[4] + wsptr[5];
1641 z10 = wsptr[4] - wsptr[5];
1642 z11 = wsptr[6] + wsptr[7];
1643 z12 = wsptr[6] - wsptr[7];
1652 tmp6 = (tmp12<<3) - tmp7;
1653 tmp5 = (tmp11<<3) - tmp6;
1654 tmp4 = (tmp10<<3) + tmp5;
1657 outptr[0*output_stride]+=
DESCALE(tmp0 + tmp7, 3);
1658 outptr[1*output_stride]+=
DESCALE(tmp1 + tmp6, 3);
1659 outptr[2*output_stride]+=
DESCALE(tmp2 + tmp5, 3);
1660 outptr[3*output_stride]+=
DESCALE(tmp3 - tmp4, 3);
1661 outptr[4*output_stride]+=
DESCALE(tmp3 + tmp4, 3);
1662 outptr[5*output_stride]+=
DESCALE(tmp2 - tmp5, 3);
1663 outptr[6*output_stride]+=
DESCALE(tmp1 - tmp6, 3);
1664 outptr[7*output_stride]+=
DESCALE(tmp0 - tmp7, 3);
1674 int16_t* output_adr,
int output_stride,
int cnt)
1676 uint64_t __attribute__((aligned(8))) temps[4];
1678 "lea (%%"REG_a
",%%"REG_a
",2), %%"REG_d
" \n\t"
1680 "movq "DCTSIZE_S"*0*2(%%"REG_S
"), %%mm0 \n\t"
1683 "movq "DCTSIZE_S"*1*2(%%"REG_S
"), %%mm1 \n\t"
1684 "movq %%mm0, %%mm4 \n\t"
1686 "movq "DCTSIZE_S"*2*2(%%"REG_S
"), %%mm2 \n\t"
1687 "punpcklwd %%mm1, %%mm0 \n\t"
1689 "movq "DCTSIZE_S"*3*2(%%"REG_S
"), %%mm3 \n\t"
1690 "punpckhwd %%mm1, %%mm4 \n\t"
1693 "movq %%mm2, %%mm7 \n\t"
1694 "punpcklwd %%mm3, %%mm2 \n\t"
1696 "movq %%mm0, %%mm6 \n\t"
1697 "punpckldq %%mm2, %%mm0 \n\t"
1699 "punpckhdq %%mm2, %%mm6 \n\t"
1700 "movq %%mm0, %%mm5 \n\t"
1702 "punpckhwd %%mm3, %%mm7 \n\t"
1703 "psubw %%mm6, %%mm0 \n\t"
1705 "pmulhw "MANGLE(MM_FIX_1_414213562_A)
", %%mm0 \n\t"
1706 "movq %%mm4, %%mm2 \n\t"
1708 "punpckldq %%mm7, %%mm4 \n\t"
1709 "paddw %%mm6, %%mm5 \n\t"
1711 "punpckhdq %%mm7, %%mm2 \n\t"
1712 "movq %%mm4, %%mm1 \n\t"
1714 "psllw $2, %%mm0 \n\t"
1715 "paddw %%mm2, %%mm4 \n\t"
1718 "psubw %%mm2, %%mm1 \n\t"
1721 "psubw %%mm5, %%mm0 \n\t"
1723 "movq %%mm4, %%mm6 \n\t"
1724 "paddw %%mm5, %%mm4 \n\t"
1726 "psubw %%mm5, %%mm6 \n\t"
1727 "movq %%mm1, %%mm7 \n\t"
1730 "paddw %%mm0, %%mm1 \n\t"
1732 "movq %%mm4, 0*8+%3 \n\t"
1733 "movq %%mm3, %%mm4 \n\t"
1735 "movq %%mm6, 1*8+%3 \n\t"
1736 "punpcklwd %%mm2, %%mm3 \n\t"
1740 "punpckhwd %%mm2, %%mm4 \n\t"
1742 "movq %%mm5, %%mm2 \n\t"
1743 "punpcklwd %%mm6, %%mm5 \n\t"
1745 "psubw %%mm0, %%mm7 \n\t"
1746 "punpckhwd %%mm6, %%mm2 \n\t"
1748 "movq %%mm3, %%mm0 \n\t"
1749 "punpckldq %%mm5, %%mm3 \n\t"
1751 "punpckhdq %%mm5, %%mm0 \n\t"
1752 "movq %%mm4, %%mm5 \n\t"
1755 "movq %%mm3, %%mm6 \n\t"
1756 "punpckldq %%mm2, %%mm4 \n\t"
1758 "psubw %%mm0, %%mm3 \n\t"
1759 "punpckhdq %%mm2, %%mm5 \n\t"
1761 "paddw %%mm0, %%mm6 \n\t"
1762 "movq %%mm4, %%mm2 \n\t"
1764 "movq %%mm3, %%mm0 \n\t"
1765 "psubw %%mm5, %%mm4 \n\t"
1767 "pmulhw "MANGLE(MM_FIX_2_613125930)
", %%mm0 \n\t"
1768 "paddw %%mm4, %%mm3 \n\t"
1770 "pmulhw "MANGLE(MM_FIX_1_847759065)
", %%mm3 \n\t"
1771 "paddw %%mm5, %%mm2 \n\t"
1773 "pmulhw "MANGLE(MM_FIX_1_082392200)
", %%mm4 \n\t"
1774 "movq %%mm2, %%mm5 \n\t"
1776 "psubw %%mm6, %%mm2 \n\t"
1777 "paddw %%mm6, %%mm5 \n\t"
1779 "pmulhw "MANGLE(MM_FIX_1_414213562)
", %%mm2 \n\t"
1780 "paddw %%mm3, %%mm0 \n\t"
1782 "psllw $3, %%mm0 \n\t"
1783 "psubw %%mm3, %%mm4 \n\t"
1785 "movq 0*8+%3, %%mm6 \n\t"
1786 "movq %%mm1, %%mm3 \n\t"
1788 "psllw $3, %%mm4 \n\t"
1789 "psubw %%mm5, %%mm0 \n\t"
1791 "psllw $3, %%mm2 \n\t"
1792 "paddw %%mm0, %%mm1 \n\t"
1794 "psubw %%mm0, %%mm2 \n\t"
1795 "psubw %%mm0, %%mm3 \n\t"
1797 "paddw %%mm2, %%mm4 \n\t"
1798 "movq %%mm7, %%mm0 \n\t"
1800 "paddw %%mm2, %%mm7 \n\t"
1801 "psubw %%mm2, %%mm0 \n\t"
1803 "movq "MANGLE(MM_DESCALE_RND)
", %%mm2 \n\t"
1804 "psubw %%mm5, %%mm6 \n\t"
1806 "paddw 0*8+%3, %%mm5 \n\t"
1807 "paddw %%mm2, %%mm1 \n\t"
1809 "paddw %%mm2, %%mm5 \n\t"
1810 "psraw $3, %%mm1 \n\t"
1812 "paddw %%mm2, %%mm7 \n\t"
1813 "psraw $3, %%mm5 \n\t"
1815 "paddw (%%"REG_D
"), %%mm5 \n\t"
1816 "psraw $3, %%mm7 \n\t"
1818 "paddw (%%"REG_D
",%%"REG_a
",), %%mm1 \n\t"
1819 "paddw %%mm2, %%mm0 \n\t"
1821 "paddw (%%"REG_D
",%%"REG_a
",2), %%mm7 \n\t"
1822 "paddw %%mm2, %%mm3 \n\t"
1824 "movq %%mm5, (%%"REG_D
") \n\t"
1825 "paddw %%mm2, %%mm6 \n\t"
1827 "movq %%mm1, (%%"REG_D
",%%"REG_a
",) \n\t"
1828 "psraw $3, %%mm0 \n\t"
1830 "movq %%mm7, (%%"REG_D
",%%"REG_a
",2) \n\t"
1831 "add %%"REG_d
", %%"REG_D
" \n\t"
1833 "movq 1*8+%3, %%mm5 \n\t"
1834 "psraw $3, %%mm3 \n\t"
1836 "paddw (%%"REG_D
",%%"REG_a
",2), %%mm0 \n\t"
1837 "psubw %%mm4, %%mm5 \n\t"
1839 "paddw (%%"REG_D
",%%"REG_d
",), %%mm3 \n\t"
1840 "psraw $3, %%mm6 \n\t"
1842 "paddw 1*8+%3, %%mm4 \n\t"
1843 "paddw %%mm2, %%mm5 \n\t"
1845 "paddw (%%"REG_D
",%%"REG_a
",4), %%mm6 \n\t"
1846 "paddw %%mm2, %%mm4 \n\t"
1848 "movq %%mm0, (%%"REG_D
",%%"REG_a
",2) \n\t"
1849 "psraw $3, %%mm5 \n\t"
1851 "paddw (%%"REG_D
"), %%mm5 \n\t"
1852 "psraw $3, %%mm4 \n\t"
1854 "paddw (%%"REG_D
",%%"REG_a
",), %%mm4 \n\t"
1857 "movq %%mm3, (%%"REG_D
",%%"REG_d
",) \n\t"
1858 "movq %%mm6, (%%"REG_D
",%%"REG_a
",4) \n\t"
1859 "movq %%mm5, (%%"REG_D
") \n\t"
1860 "movq %%mm4, (%%"REG_D
",%%"REG_a
",) \n\t"
1862 "sub %%"REG_d
", %%"REG_D
" \n\t"
1863 "add $8, %%"REG_D
" \n\t"
1864 "dec %%"REG_c
" \n\t"
1867 :
"+S"(workspace),
"+D"(output_adr),
"+c"(cnt),
"=o"(temps)
1868 :
"a"(output_stride*
sizeof(short))
1877 static void row_fdct_c(
DCTELEM *data,
const uint8_t *pixels,
int line_size,
int cnt)
1879 int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
1880 int_simd16_t tmp10, tmp11, tmp12, tmp13;
1881 int_simd16_t z1, z2, z3, z4, z5, z11, z13;
1888 for (; cnt > 0; cnt--) {
1889 tmp0 = pixels[line_size*0] + pixels[line_size*7];
1890 tmp7 = pixels[line_size*0] - pixels[line_size*7];
1891 tmp1 = pixels[line_size*1] + pixels[line_size*6];
1892 tmp6 = pixels[line_size*1] - pixels[line_size*6];
1893 tmp2 = pixels[line_size*2] + pixels[line_size*5];
1894 tmp5 = pixels[line_size*2] - pixels[line_size*5];
1895 tmp3 = pixels[line_size*3] + pixels[line_size*4];
1896 tmp4 = pixels[line_size*3] - pixels[line_size*4];
1900 tmp10 = tmp0 + tmp3;
1901 tmp13 = tmp0 - tmp3;
1902 tmp11 = tmp1 + tmp2;
1903 tmp12 = tmp1 - tmp2;
1907 dataptr[2] = tmp10 + tmp11;
1908 dataptr[3] = tmp10 - tmp11;
1910 z1 =
MULTIPLY16H((tmp12 + tmp13)<<2, FIX_0_707106781);
1911 dataptr[0] = tmp13 + z1;
1912 dataptr[1] = tmp13 - z1;
1916 tmp10 = (tmp4 + tmp5) <<2;
1917 tmp11 = (tmp5 + tmp6) <<2;
1918 tmp12 = (tmp6 + tmp7) <<2;
1928 dataptr[4] = z13 + z2;
1929 dataptr[5] = z13 - z2;
1930 dataptr[6] = z11 + z4;
1931 dataptr[7] = z11 - z4;
1942 uint64_t __attribute__((aligned(8))) temps[4];
1944 "lea (%%"REG_a
",%%"REG_a
",2), %%"REG_d
" \n\t"
1946 "movd (%%"REG_S
"), %%mm0 \n\t"
1947 "pxor %%mm7, %%mm7 \n\t"
1949 "movd (%%"REG_S
",%%"REG_a
",), %%mm1 \n\t"
1950 "punpcklbw %%mm7, %%mm0 \n\t"
1952 "movd (%%"REG_S
",%%"REG_a
",2), %%mm2 \n\t"
1953 "punpcklbw %%mm7, %%mm1 \n\t"
1955 "punpcklbw %%mm7, %%mm2 \n\t"
1956 "add %%"REG_d
", %%"REG_S
" \n\t"
1958 "movq %%mm0, %%mm5 \n\t"
1961 "movd (%%"REG_S
",%%"REG_a
",4), %%mm3 \n\t"
1962 "movq %%mm1, %%mm6 \n\t"
1964 "movd (%%"REG_S
",%%"REG_d
",), %%mm4 \n\t"
1965 "punpcklbw %%mm7, %%mm3 \n\t"
1967 "psubw %%mm3, %%mm5 \n\t"
1968 "punpcklbw %%mm7, %%mm4 \n\t"
1970 "paddw %%mm3, %%mm0 \n\t"
1971 "psubw %%mm4, %%mm6 \n\t"
1973 "movd (%%"REG_S
",%%"REG_a
",2), %%mm3 \n\t"
1974 "paddw %%mm4, %%mm1 \n\t"
1976 "movq %%mm5, 0*8+%3 \n\t"
1977 "punpcklbw %%mm7, %%mm3 \n\t"
1979 "movq %%mm6, 1*8+%3 \n\t"
1980 "movq %%mm2, %%mm4 \n\t"
1982 "movd (%%"REG_S
"), %%mm5 \n\t"
1983 "paddw %%mm3, %%mm2 \n\t"
1985 "movd (%%"REG_S
",%%"REG_a
",), %%mm6 \n\t"
1986 "punpcklbw %%mm7, %%mm5 \n\t"
1988 "psubw %%mm3, %%mm4 \n\t"
1989 "punpcklbw %%mm7, %%mm6 \n\t"
1991 "movq %%mm5, %%mm3 \n\t"
1992 "paddw %%mm6, %%mm5 \n\t"
1994 "psubw %%mm6, %%mm3 \n\t"
1995 "movq %%mm0, %%mm6 \n\t"
1997 "movq %%mm1, %%mm7 \n\t"
1998 "psubw %%mm5, %%mm0 \n\t"
2000 "psubw %%mm2, %%mm1 \n\t"
2001 "paddw %%mm2, %%mm7 \n\t"
2003 "paddw %%mm0, %%mm1 \n\t"
2004 "movq %%mm7, %%mm2 \n\t"
2006 "psllw $2, %%mm1 \n\t"
2007 "paddw %%mm5, %%mm6 \n\t"
2010 "paddw %%mm6, %%mm7 \n\t"
2012 "psubw %%mm2, %%mm6 \n\t"
2013 "movq %%mm0, %%mm5 \n\t"
2016 "movq %%mm7, %%mm2 \n\t"
2017 "punpcklwd %%mm6, %%mm7 \n\t"
2019 "paddw %%mm1, %%mm0 \n\t"
2020 "punpckhwd %%mm6, %%mm2 \n\t"
2022 "psubw %%mm1, %%mm5 \n\t"
2023 "movq %%mm0, %%mm6 \n\t"
2025 "movq 1*8+%3, %%mm1 \n\t"
2026 "punpcklwd %%mm5, %%mm0 \n\t"
2028 "punpckhwd %%mm5, %%mm6 \n\t"
2029 "movq %%mm0, %%mm5 \n\t"
2031 "punpckldq %%mm7, %%mm0 \n\t"
2032 "paddw %%mm4, %%mm3 \n\t"
2034 "punpckhdq %%mm7, %%mm5 \n\t"
2035 "movq %%mm6, %%mm7 \n\t"
2037 "movq %%mm0, "DCTSIZE_S"*0*2(%%"REG_D
") \n\t"
2038 "punpckldq %%mm2, %%mm6 \n\t"
2040 "movq %%mm5, "DCTSIZE_S"*1*2(%%"REG_D
") \n\t"
2041 "punpckhdq %%mm2, %%mm7 \n\t"
2043 "movq %%mm6, "DCTSIZE_S"*2*2(%%"REG_D
") \n\t"
2044 "paddw %%mm1, %%mm4 \n\t"
2046 "movq %%mm7, "DCTSIZE_S"*3*2(%%"REG_D
") \n\t"
2047 "psllw $2, %%mm3 \n\t"
2049 "movq 0*8+%3, %%mm2 \n\t"
2050 "psllw $2, %%mm4 \n\t"
2053 "paddw %%mm2, %%mm1 \n\t"
2055 "psllw $2, %%mm1 \n\t"
2056 "movq %%mm3, %%mm0 \n\t"
2059 "psubw %%mm1, %%mm3 \n\t"
2061 "pmulhw "MANGLE(MM_FIX_0_382683433)
", %%mm3 \n\t"
2062 "movq %%mm2, %%mm5 \n\t"
2064 "pmulhw "MANGLE(MM_FIX_1_306562965)
", %%mm1 \n\t"
2065 "psubw %%mm4, %%mm2 \n\t"
2067 "paddw %%mm4, %%mm5 \n\t"
2068 "movq %%mm2, %%mm6 \n\t"
2070 "paddw %%mm3, %%mm0 \n\t"
2071 "movq %%mm5, %%mm7 \n\t"
2073 "paddw %%mm0, %%mm2 \n\t"
2074 "psubw %%mm0, %%mm6 \n\t"
2076 "movq %%mm2, %%mm4 \n\t"
2077 "paddw %%mm3, %%mm1 \n\t"
2080 "punpcklwd %%mm6, %%mm2 \n\t"
2081 "paddw %%mm1, %%mm5 \n\t"
2083 "punpckhwd %%mm6, %%mm4 \n\t"
2084 "psubw %%mm1, %%mm7 \n\t"
2086 "movq %%mm5, %%mm6 \n\t"
2087 "punpcklwd %%mm7, %%mm5 \n\t"
2089 "punpckhwd %%mm7, %%mm6 \n\t"
2090 "movq %%mm2, %%mm7 \n\t"
2092 "punpckldq %%mm5, %%mm2 \n\t"
2093 "sub %%"REG_d
", %%"REG_S
" \n\t"
2095 "punpckhdq %%mm5, %%mm7 \n\t"
2096 "movq %%mm4, %%mm5 \n\t"
2099 "punpckldq %%mm6, %%mm4 \n\t"
2102 "punpckhdq %%mm6, %%mm5 \n\t"
2105 "add $4, %%"REG_S
" \n\t"
2109 "dec %%"REG_c
" \n\t"
2112 :
"+S"(pixels),
"+D"(data),
"+c"(cnt),
"=o"(temps)