annotate arm/mpegvideo_armv5te.c @ 12204:563339ea87aa libavcodec

Chroma (width=8) inner loopfilter MMX/MMX2/SSE2 for VP8 decoder.
author rbultje
date Tue, 20 Jul 2010 22:04:18 +0000
parents 58c4d851d1c7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
1 /*
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
2 * Optimization of some functions from mpegvideo.c for armv5te
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
3 * Copyright (c) 2007 Siarhei Siamashka <ssvb@users.sourceforge.net>
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
4 *
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
5 * This file is part of FFmpeg.
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
6 *
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
11 *
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
15 * Lesser General Public License for more details.
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
16 *
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
20 */
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
21
6763
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 6761
diff changeset
22 #include "libavcodec/avcodec.h"
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 6761
diff changeset
23 #include "libavcodec/dsputil.h"
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 6761
diff changeset
24 #include "libavcodec/mpegvideo.h"
11397
58c4d851d1c7 ARM: move mpegvideo prototypes to a header file
mru
parents: 8359
diff changeset
25 #include "mpegvideo_arm.h"
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
26
8250
cf4d575b1982 Delete unnecessary 'extern' keywords.
diego
parents: 8197
diff changeset
27 void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int count);
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
28
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
29 #ifdef ENABLE_ARM_TESTS
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
30 /**
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
31 * h263 dequantizer supplementary function, it is performance critical and needs to
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
32 * have optimized implementations for each architecture. Is also used as a reference
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
33 * implementation in regression tests
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
34 */
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
35 static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
36 {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
37 int i, level;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
38 for (i = 0; i < count; i++) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
39 level = block[i];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
40 if (level) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
41 if (level < 0) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
42 level = level * qmul - qadd;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
43 } else {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
44 level = level * qmul + qadd;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
45 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
46 block[i] = level;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
47 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
48 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
49 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
50 #endif
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
51
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
52 static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
53 DCTELEM *block, int n, int qscale)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
54 {
5100
daff9ebd2e0b Remove unused variables.
diego
parents: 5010
diff changeset
55 int level, qmul, qadd;
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
56 int nCoeffs;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
57
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
58 assert(s->block_last_index[n]>=0);
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
59
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
60 qmul = qscale << 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
61
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
62 if (!s->h263_aic) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
63 if (n < 4)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
64 level = block[0] * s->y_dc_scale;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
65 else
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
66 level = block[0] * s->c_dc_scale;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
67 qadd = (qscale - 1) | 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
68 }else{
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
69 qadd = 0;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
70 level = block[0];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
71 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
72 if(s->ac_pred)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
73 nCoeffs=63;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
74 else
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
75 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
76
8197
06acc3ab4bdc ARM: move dct_unquantize_h263_*_armv5te asm to separate file
mru
parents: 8031
diff changeset
77 ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
78 block[0] = level;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
79 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
80
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
81 static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
82 DCTELEM *block, int n, int qscale)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
83 {
5100
daff9ebd2e0b Remove unused variables.
diego
parents: 5010
diff changeset
84 int qmul, qadd;
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
85 int nCoeffs;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
86
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
87 assert(s->block_last_index[n]>=0);
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
88
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
89 qadd = (qscale - 1) | 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
90 qmul = qscale << 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
91
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
92 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
93
8197
06acc3ab4bdc ARM: move dct_unquantize_h263_*_armv5te asm to separate file
mru
parents: 8031
diff changeset
94 ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
95 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
96
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
97 void MPV_common_init_armv5te(MpegEncContext *s)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
98 {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
99 s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
100 s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
101 }