annotate x86/deinterlace.asm @ 12495:fac8063ed1e7 libavcodec

Allow float values for libmp3lame quality. Patch by James Darnley, james D darnley A gmail
author cehoyos
date Wed, 15 Sep 2010 22:10:13 +0000
parents b01d01738bc4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12316
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
1 ;******************************************************************************
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
2 ;* MMX optimized deinterlacing functions
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
3 ;* Copyright (c) 2010 Vitor Sessak
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
4 ;* Copyright (c) 2002 Michael Niedermayer
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
5 ;*
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
6 ;* This file is part of FFmpeg.
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
7 ;*
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
8 ;* FFmpeg is free software; you can redistribute it and/or
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
9 ;* modify it under the terms of the GNU Lesser General Public
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
10 ;* License as published by the Free Software Foundation; either
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
11 ;* version 2.1 of the License, or (at your option) any later version.
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
12 ;*
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
13 ;* FFmpeg is distributed in the hope that it will be useful,
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
14 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
15 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
16 ;* Lesser General Public License for more details.
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
17 ;*
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
18 ;* You should have received a copy of the GNU Lesser General Public
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
19 ;* License along with FFmpeg; if not, write to the Free Software
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
20 ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
21 ;******************************************************************************
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
22
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
23 %include "x86inc.asm"
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
24 %include "x86util.asm"
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
25
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
26 SECTION_RODATA
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
27
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
28 cextern pw_4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
29
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
30 %macro DEINTERLACE 1
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
31 %ifidn %1, inplace
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
32 ;void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
33 cglobal deinterlace_line_inplace_mmx, 6,6,7, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
34 %else
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
35 ;void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
36 cglobal deinterlace_line_mmx, 7,7,7, dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
37 %endif
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
38 pxor mm7, mm7
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
39 movq mm6, [pw_4]
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
40 .nextrow
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
41 movd mm0, [lum_m4q]
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
42 movd mm1, [lum_m3q]
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
43 movd mm2, [lum_m2q]
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
44 %ifidn %1, inplace
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
45 movd [lum_m4q], mm2
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
46 %endif
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
47 movd mm3, [lum_m1q]
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
48 movd mm4, [lumq]
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
49 punpcklbw mm0, mm7
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
50 punpcklbw mm1, mm7
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
51 punpcklbw mm2, mm7
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
52 punpcklbw mm3, mm7
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
53 punpcklbw mm4, mm7
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
54 paddw mm1, mm3
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
55 psllw mm2, 1
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
56 paddw mm0, mm4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
57 psllw mm1, 2
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
58 paddw mm2, mm6
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
59 paddw mm1, mm2
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
60 psubusw mm1, mm0
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
61 psrlw mm1, 3
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
62 packuswb mm1, mm7
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
63 %ifidn %1, inplace
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
64 movd [lum_m2q], mm1
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
65 %else
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
66 movd [dstq], mm1
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
67 add dstq, 4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
68 %endif
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
69 add lum_m4q, 4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
70 add lum_m3q, 4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
71 add lum_m2q, 4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
72 add lum_m1q, 4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
73 add lumq, 4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
74 sub sized, 4
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
75 jg .nextrow
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
76 REP_RET
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
77 %endmacro
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
78
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
79 DEINTERLACE ""
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
80
b01d01738bc4 Convert deinterlacing MMX code to YASM
vitor
parents:
diff changeset
81 DEINTERLACE inplace