1 ;******************************************************************************
3 ;* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
4 ;* Copyright (c) 2008 Loren Merritt
5 ;* Copyright (c) 2013 Daniel Kang
7 ;* This file is part of FFmpeg.
9 ;* FFmpeg is free software; you can redistribute it and/or
10 ;* modify it under the terms of the GNU Lesser General Public
11 ;* License as published by the Free Software Foundation; either
12 ;* version 2.1 of the License, or (at your option) any later version.
14 ;* FFmpeg is distributed in the hope that it will be useful,
15 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;* Lesser General Public License for more details.
19 ;* You should have received a copy of the GNU Lesser General Public
20 ;* License along with FFmpeg; if not, write to the Free Software
21 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 ;******************************************************************************
24 %include "libavutil/x86/x86util.asm"
36 ; void ff_put_no_rnd_pixels8_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
37 %macro PUT_NO_RND_PIXELS8_L2 0
38 cglobal put_no_rnd_pixels8_l2, 6,6
102 ; void ff_put_no_rnd_pixels16_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
103 %macro PUT_NO_RND_PIXELS16_l2 0
104 cglobal put_no_rnd_pixels16_l2, 6,6
168 PUT_NO_RND_PIXELS16_l2
170 PUT_NO_RND_PIXELS16_l2
172 %macro MPEG4_QPEL16_H_LOWPASS 1
173 cglobal %1_mpeg4_qpel16_h_lowpass, 5, 5, 0, 16
274 OP_MOV [r0+8], m0, m4
293 %define PW_ROUND pw_16
294 %define OP_MOV PUT_OP
295 MPEG4_QPEL16_H_LOWPASS put
296 %define PW_ROUND pw_16
297 %define OP_MOV AVG_OP
298 MPEG4_QPEL16_H_LOWPASS avg
299 %define PW_ROUND pw_15
300 %define OP_MOV PUT_OP
301 MPEG4_QPEL16_H_LOWPASS put_no_rnd
305 %macro MPEG4_QPEL8_H_LOWPASS 1
306 cglobal %1_mpeg4_qpel8_h_lowpass, 5, 5, 0, 8
366 %define PW_ROUND pw_16
367 %define OP_MOV PUT_OP
368 MPEG4_QPEL8_H_LOWPASS put
369 %define PW_ROUND pw_16
370 %define OP_MOV AVG_OP
371 MPEG4_QPEL8_H_LOWPASS avg
372 %define PW_ROUND pw_15
373 %define OP_MOV PUT_OP
374 MPEG4_QPEL8_H_LOWPASS put_no_rnd
401 %macro MPEG4_QPEL16_V_LOWPASS 1
402 cglobal %1_mpeg4_qpel16_v_lowpass, 4, 6, 0, 544
428 ; NOTE: r1 CHANGES VALUES: r1 -> 4 - 14*dstStride
443 QPEL_V_LOW [r5+0x10], [r5+ 0x8], [r5+ 0x0], [r5+0x20], [r0]
444 QPEL_V_LOW [r5+ 0x8], [r5+ 0x0], [r5+ 0x0], [r5+0x28], [r0+r2]
446 QPEL_V_LOW [r5+ 0x0], [r5+ 0x0], [r5+ 0x8], [r5+0x30], [r0]
447 QPEL_V_LOW [r5+ 0x0], [r5+ 0x8], [r5+0x10], [r5+0x38], [r0+r2]
449 QPEL_V_LOW [r5+ 0x8], [r5+0x10], [r5+0x18], [r5+0x40], [r0]
450 QPEL_V_LOW [r5+0x10], [r5+0x18], [r5+0x20], [r5+0x48], [r0+r2]
452 QPEL_V_LOW [r5+0x18], [r5+0x20], [r5+0x28], [r5+0x50], [r0]
453 QPEL_V_LOW [r5+0x20], [r5+0x28], [r5+0x30], [r5+0x58], [r0+r2]
455 QPEL_V_LOW [r5+0x28], [r5+0x30], [r5+0x38], [r5+0x60], [r0]
456 QPEL_V_LOW [r5+0x30], [r5+0x38], [r5+0x40], [r5+0x68], [r0+r2]
458 QPEL_V_LOW [r5+0x38], [r5+0x40], [r5+0x48], [r5+0x70], [r0]
459 QPEL_V_LOW [r5+0x40], [r5+0x48], [r5+0x50], [r5+0x78], [r0+r2]
461 QPEL_V_LOW [r5+0x48], [r5+0x50], [r5+0x58], [r5+0x80], [r0]
462 QPEL_V_LOW [r5+0x50], [r5+0x58], [r5+0x60], [r5+0x80], [r0+r2]
464 QPEL_V_LOW [r5+0x58], [r5+0x60], [r5+0x68], [r5+0x78], [r0]
465 QPEL_V_LOW [r5+0x60], [r5+0x68], [r5+0x70], [r5+0x70], [r0+r2]
485 %define PW_ROUND pw_16
486 %define OP_MOV PUT_OPH
487 MPEG4_QPEL16_V_LOWPASS put
488 %define PW_ROUND pw_16
489 %define OP_MOV AVG_OPH
490 MPEG4_QPEL16_V_LOWPASS avg
491 %define PW_ROUND pw_15
492 %define OP_MOV PUT_OPH
493 MPEG4_QPEL16_V_LOWPASS put_no_rnd
497 %macro MPEG4_QPEL8_V_LOWPASS 1
498 cglobal %1_mpeg4_qpel8_v_lowpass, 4, 6, 0, 288
518 ; NOTE: r1 CHANGES VALUES: r1 -> 4 - 6*dstStride
532 QPEL_V_LOW [r5+0x10], [r5+ 0x8], [r5+ 0x0], [r5+0x20], [r0]
533 QPEL_V_LOW [r5+ 0x8], [r5+ 0x0], [r5+ 0x0], [r5+0x28], [r0+r2]
535 QPEL_V_LOW [r5+ 0x0], [r5+ 0x0], [r5+ 0x8], [r5+0x30], [r0]
536 QPEL_V_LOW [r5+ 0x0], [r5+ 0x8], [r5+0x10], [r5+0x38], [r0+r2]
538 QPEL_V_LOW [r5+ 0x8], [r5+0x10], [r5+0x18], [r5+0x40], [r0]
539 QPEL_V_LOW [r5+0x10], [r5+0x18], [r5+0x20], [r5+0x40], [r0+r2]
541 QPEL_V_LOW [r5+0x18], [r5+0x20], [r5+0x28], [r5+0x38], [r0]
542 QPEL_V_LOW [r5+0x20], [r5+0x28], [r5+0x30], [r5+0x30], [r0+r2]
552 %define PW_ROUND pw_16
553 %define OP_MOV PUT_OPH
554 MPEG4_QPEL8_V_LOWPASS put
555 %define PW_ROUND pw_16
556 %define OP_MOV AVG_OPH
557 MPEG4_QPEL8_V_LOWPASS avg
558 %define PW_ROUND pw_15
559 %define OP_MOV PUT_OPH
560 MPEG4_QPEL8_V_LOWPASS put_no_rnd