annotate armv4l/mpegvideo_armv5te.c @ 5010:d5ba514e3f4a libavcodec

Add libavcodec to compiler include flags in order to simplify header include paths in the source files. mostly from a patch by Ronald S. Bultje, rbultje ronald.bitfreak net
author diego
date Wed, 16 May 2007 09:51:45 +0000
parents 04b5141fa890
children daff9ebd2e0b
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
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
22 /*
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
23 * Some useful links for those who may be interested in optimizing code for ARM.
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
24 * ARM Architecture Reference Manual: http://www.arm.com/community/academy/resources.html
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
25 * Instructions timings and optimization guide for ARM9E: http://www.arm.com/pdfs/DDI0222B_9EJS_r1p2.pdf
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
26 */
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
27
5010
d5ba514e3f4a Add libavcodec to compiler include flags in order to simplify header
diego
parents: 4435
diff changeset
28 #include "dsputil.h"
d5ba514e3f4a Add libavcodec to compiler include flags in order to simplify header
diego
parents: 4435
diff changeset
29 #include "mpegvideo.h"
d5ba514e3f4a Add libavcodec to compiler include flags in order to simplify header
diego
parents: 4435
diff changeset
30 #include "avcodec.h"
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
31
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
32
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
33 #ifdef ENABLE_ARM_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 * h263 dequantizer supplementary function, it is performance critical and needs to
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
36 * have optimized implementations for each architecture. Is also used as a reference
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
37 * implementation in regression tests
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
38 */
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
39 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
40 {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
41 int i, level;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
42 for (i = 0; i < count; i++) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
43 level = block[i];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
44 if (level) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
45 if (level < 0) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
46 level = level * qmul - qadd;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
47 } else {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
48 level = level * qmul + qadd;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
49 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
50 block[i] = level;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
51 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
52 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
53 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
54 #endif
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
55
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
56 /* GCC 3.1 or higher is required to support symbolic names in assembly code */
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
57 #if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
58
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
59 /**
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
60 * Special optimized version of dct_unquantize_h263_helper_c, it requires the block
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
61 * to be at least 8 bytes aligned, and may process more elements than requested.
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
62 * But it is guaranteed to never process more than 64 elements provided that
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
63 * xxcount argument is <= 64, so it is safe. This macro is optimized for a common
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
64 * distribution of values for nCoeffs (they are mostly multiple of 8 plus one or
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
65 * two extra elements). So this macro processes data as 8 elements per loop iteration
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
66 * and contains optional 2 elements processing in the end.
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
67 *
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
68 * Inner loop should take 6 cycles per element on arm926ej-s (Nokia 770)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
69 */
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
70 #define dct_unquantize_h263_special_helper_armv5te(xxblock, xxqmul, xxqadd, xxcount) \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
71 ({ DCTELEM *xblock = xxblock; \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
72 int xqmul = xxqmul, xqadd = xxqadd, xcount = xxcount, xtmp; \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
73 int xdata1, xdata2; \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
74 __asm__ __volatile__( \
4435
04b5141fa890 typo fix by Dmitry Antipov dmantipov =a= yandex =d= ru
mru
parents: 4341
diff changeset
75 "subs %[count], %[count], #2 \n\t" \
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
76 "ble 2f \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
77 "ldrd r4, [%[block], #0] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
78 "1: \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
79 "ldrd r6, [%[block], #8] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
80 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
81 "rsbs %[data1], %[zero], r4, asr #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
82 "addgt %[data1], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
83 "rsblt %[data1], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
84 "smlatbne %[data1], r4, %[qmul], %[data1] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
85 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
86 "rsbs %[data2], %[zero], r5, asr #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
87 "addgt %[data2], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
88 "rsblt %[data2], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
89 "smlatbne %[data2], r5, %[qmul], %[data2] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
90 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
91 "rsbs %[tmp], %[zero], r4, asl #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
92 "addgt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
93 "rsblt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
94 "smlabbne r4, r4, %[qmul], %[tmp] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
95 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
96 "rsbs %[tmp], %[zero], r5, asl #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
97 "addgt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
98 "rsblt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
99 "smlabbne r5, r5, %[qmul], %[tmp] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
100 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
101 "strh r4, [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
102 "strh %[data1], [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
103 "strh r5, [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
104 "strh %[data2], [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
105 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
106 "rsbs %[data1], %[zero], r6, asr #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
107 "addgt %[data1], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
108 "rsblt %[data1], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
109 "smlatbne %[data1], r6, %[qmul], %[data1] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
110 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
111 "rsbs %[data2], %[zero], r7, asr #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
112 "addgt %[data2], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
113 "rsblt %[data2], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
114 "smlatbne %[data2], r7, %[qmul], %[data2] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
115 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
116 "rsbs %[tmp], %[zero], r6, asl #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
117 "addgt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
118 "rsblt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
119 "smlabbne r6, r6, %[qmul], %[tmp] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
120 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
121 "rsbs %[tmp], %[zero], r7, asl #16 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
122 "addgt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
123 "rsblt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
124 "smlabbne r7, r7, %[qmul], %[tmp] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
125 \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
126 "strh r6, [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
127 "strh %[data1], [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
128 "strh r7, [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
129 "strh %[data2], [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
130 \
4435
04b5141fa890 typo fix by Dmitry Antipov dmantipov =a= yandex =d= ru
mru
parents: 4341
diff changeset
131 "subs %[count], %[count], #8 \n\t" \
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
132 "ldrgtd r4, [%[block], #0] \n\t" /* load data early to avoid load/use pipeline stall */ \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
133 "bgt 1b \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
134 \
4435
04b5141fa890 typo fix by Dmitry Antipov dmantipov =a= yandex =d= ru
mru
parents: 4341
diff changeset
135 "adds %[count], %[count], #2 \n\t" \
4341
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
136 "ble 3f \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
137 "2: \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
138 "ldrsh %[data1], [%[block], #0] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
139 "ldrsh %[data2], [%[block], #2] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
140 "mov %[tmp], %[qadd] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
141 "cmp %[data1], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
142 "rsblt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
143 "smlabbne %[data1], %[data1], %[qmul], %[tmp] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
144 "mov %[tmp], %[qadd] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
145 "cmp %[data2], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
146 "rsblt %[tmp], %[qadd], #0 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
147 "smlabbne %[data2], %[data2], %[qmul], %[tmp] \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
148 "strh %[data1], [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
149 "strh %[data2], [%[block]], #2 \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
150 "3: \n\t" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
151 : [block] "+&r" (xblock), [count] "+&r" (xcount), [tmp] "=&r" (xtmp), \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
152 [data1] "=&r" (xdata1), [data2] "=&r" (xdata2) \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
153 : [qmul] "r" (xqmul), [qadd] "r" (xqadd), [zero] "r" (0) \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
154 : "r4", "r5", "r6", "r7", "cc", "memory" \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
155 ); \
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
156 })
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
157
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
158 static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
159 DCTELEM *block, int n, int qscale)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
160 {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
161 int i, level, qmul, qadd;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
162 int nCoeffs;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
163
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
164 assert(s->block_last_index[n]>=0);
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
165
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
166 qmul = qscale << 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
167
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
168 if (!s->h263_aic) {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
169 if (n < 4)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
170 level = block[0] * s->y_dc_scale;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
171 else
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
172 level = block[0] * s->c_dc_scale;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
173 qadd = (qscale - 1) | 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
174 }else{
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
175 qadd = 0;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
176 level = block[0];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
177 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
178 if(s->ac_pred)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
179 nCoeffs=63;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
180 else
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
181 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
182
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
183 dct_unquantize_h263_special_helper_armv5te(block, qmul, qadd, nCoeffs + 1);
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
184 block[0] = level;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
185 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
186
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
187 static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
188 DCTELEM *block, int n, int qscale)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
189 {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
190 int i, level, qmul, qadd;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
191 int nCoeffs;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
192
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
193 assert(s->block_last_index[n]>=0);
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
194
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
195 qadd = (qscale - 1) | 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
196 qmul = qscale << 1;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
197
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
198 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
199
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
200 dct_unquantize_h263_special_helper_armv5te(block, qmul, qadd, nCoeffs + 1);
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
201 }
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
202
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
203 #define HAVE_DCT_UNQUANTIZE_H263_ARMV5TE_OPTIMIZED
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
204
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
205 #endif
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
206
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
207 void MPV_common_init_armv5te(MpegEncContext *s)
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
208 {
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
209 #ifdef HAVE_DCT_UNQUANTIZE_H263_ARMV5TE_OPTIMIZED
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
210 s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
211 s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
212 #endif
5053e6b3ea45 add missing bit from commit r7423
gpoirier
parents:
diff changeset
213 }