• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;******************************************************************************
2;* SIMD-optimized halfpel functions for VP3
3;*
4;* This file is part of FFmpeg.
5;*
6;* FFmpeg is free software; you can redistribute it and/or
7;* modify it under the terms of the GNU Lesser General Public
8;* License as published by the Free Software Foundation; either
9;* version 2.1 of the License, or (at your option) any later version.
10;*
11;* FFmpeg is distributed in the hope that it will be useful,
12;* but WITHOUT ANY WARRANTY; without even the implied warranty of
13;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14;* Lesser General Public License for more details.
15;*
16;* You should have received a copy of the GNU Lesser General Public
17;* License along with FFmpeg; if not, write to the Free Software
18;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19;******************************************************************************
20
21%include "libavutil/x86/x86util.asm"
22
23SECTION .text
24
25; void ff_put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
26INIT_MMX mmxext
27cglobal put_no_rnd_pixels8_x2_exact, 4,5
28    lea          r4, [r2*3]
29    pcmpeqb      m6, m6
30.loop:
31    mova         m0, [r1]
32    mova         m2, [r1+r2]
33    mova         m1, [r1+1]
34    mova         m3, [r1+r2+1]
35    pxor         m0, m6
36    pxor         m2, m6
37    pxor         m1, m6
38    pxor         m3, m6
39    PAVGB        m0, m1
40    PAVGB        m2, m3
41    pxor         m0, m6
42    pxor         m2, m6
43    mova       [r0], m0
44    mova    [r0+r2], m2
45    mova         m0, [r1+r2*2]
46    mova         m1, [r1+r2*2+1]
47    mova         m2, [r1+r4]
48    mova         m3, [r1+r4+1]
49    pxor         m0, m6
50    pxor         m1, m6
51    pxor         m2, m6
52    pxor         m3, m6
53    PAVGB        m0, m1
54    PAVGB        m2, m3
55    pxor         m0, m6
56    pxor         m2, m6
57    mova  [r0+r2*2], m0
58    mova    [r0+r4], m2
59    lea          r1, [r1+r2*4]
60    lea          r0, [r0+r2*4]
61    sub         r3d, 4
62    jg .loop
63    REP_RET
64
65
66; void ff_put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
67INIT_MMX mmxext
68cglobal put_no_rnd_pixels8_y2_exact, 4,5
69    lea          r4, [r2*3]
70    mova         m0, [r1]
71    pcmpeqb      m6, m6
72    add          r1, r2
73    pxor         m0, m6
74.loop:
75    mova         m1, [r1]
76    mova         m2, [r1+r2]
77    pxor         m1, m6
78    pxor         m2, m6
79    PAVGB        m0, m1
80    PAVGB        m1, m2
81    pxor         m0, m6
82    pxor         m1, m6
83    mova       [r0], m0
84    mova    [r0+r2], m1
85    mova         m1, [r1+r2*2]
86    mova         m0, [r1+r4]
87    pxor         m1, m6
88    pxor         m0, m6
89    PAVGB        m2, m1
90    PAVGB        m1, m0
91    pxor         m2, m6
92    pxor         m1, m6
93    mova  [r0+r2*2], m2
94    mova    [r0+r4], m1
95    lea          r1, [r1+r2*4]
96    lea          r0, [r0+r2*4]
97    sub         r3d, 4
98    jg .loop
99    REP_RET
100