Revision 67fd620c

View differences:

libavcodec/Makefile
394 394

  
395 395
OBJS-$(TARGET_ARCH_BFIN)               += bfin/dsputil_bfin.o \
396 396

  
397
ASM_OBJS-$(TARGET_ARCH_BFIN)           += bfin/pixels_bfin.o \
398
                                          bfin/idct_bfin.o   \
399
                                          bfin/fdct_bfin.o   \
400
                                          bfin/xidct.o       \
401

  
397 402
EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
398 403

  
399 404
NAME=avcodec
libavcodec/bfin/config_bfin.h
1
/*
2
 * config_bfin.h
3
 *
4
 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
5
 *
6
 * This file is part of FFmpeg.
7
 *
8
 * FFmpeg is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2.1 of the License, or (at your option) any later version.
12
 *
13
 * FFmpeg is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with FFmpeg; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
 */
22
/*
23
   low level assembler interface wrapper
24

  
25
DEFUN(put_pixels_clamped,mL1,
26
        (DCTELEM *block, uint8_t *dest, int line_size)):
27

  
28
      body
29

  
30
      rts;
31
*/
32
#ifndef DEFUN
33

  
34
#ifndef mL1
35
#define mL1 .l1.text
36
#endif
37
#define mL3 .text
38

  
39
#define DEFUN(fname,where,interface) \
40
        .section where;              \
41
        .global _ff_bfin_ ## fname ; \
42
        .align 8;                    \
43
        _ff_bfin_ ## fname
44

  
45
#endif
46

  
libavcodec/bfin/dsputil_bfin.c
1 1
/*
2
 * Copyright (c) 2006 Michael Benjamin
2
 * BlackFin DSPUTILS
3
 *
4
 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
5
 * Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.com>
3 6
 *
4 7
 * This file is part of FFmpeg.
5 8
 *
......
18 21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 22
 */
20 23

  
24
#include <unistd.h>
25
#include <bits/bfin_sram.h>
21 26
#include "../avcodec.h"
22 27
#include "../dsputil.h"
23 28

  
24
static int sad8x8_bfin( void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h )
25
{
26
    int sum;
27
    __asm__ __volatile__ (
28
    "P0 = %1;" // blk1
29
    "P1 = %2;" // blk2
30
    "P2 = %3;\n" // h
31
    "I0 = P0;"
32
    "I1 = P1;\n"
33
    "A0 = 0;"
34
    "A1 = 0;\n"
35
    "M0 = P2;\n"
36
    "P3 = 32;\n"
37
    "LSETUP (sad8x8LoopBegin, sad8x8LoopEnd) LC0=P3;\n"
38
    "sad8x8LoopBegin:\n"
39
    "  DISALGNEXCPT || R0 = [I0] || R2 = [I1];\n"
40
    "  DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];\n"
41
    "sad8x8LoopEnd:\n"
42
    "  SAA ( R1:0 , R3:2 );\n"
43
    "R3 = A1.L + A1.H, R2 = A0.L + A0.H;\n"
44
    "%0 = R2 + R3 (S);\n"
45
    : "=&d" (sum)
46
    : "m"(blk1), "m"(blk2), "m"(h)
47
    : "P0","P1","P2","I0","I1","A0","A1","R0","R1","R2","R3");
48
    return sum;
29
#define USE_L1CODE
30

  
31
#ifdef USE_L1CODE
32
#define L1CODE __attribute__ ((l1_text))
33
#else
34
#define L1CODE
35
#endif
36
int off;
37

  
38

  
39
extern void ff_bfin_idct (DCTELEM *block) L1CODE;
40
extern void ff_bfin_fdct (DCTELEM *block) L1CODE;
41
extern void ff_bfin_add_pixels_clamped (DCTELEM *block, uint8_t *dest, int line_size) L1CODE;
42
extern void ff_bfin_put_pixels_clamped (DCTELEM *block, uint8_t *dest, int line_size) L1CODE;
43
extern void ff_bfin_diff_pixels (DCTELEM *block, uint8_t *s1, uint8_t *s2, int stride)  L1CODE;
44
extern void ff_bfin_get_pixels  (DCTELEM *restrict block, const uint8_t *pixels, int line_size) L1CODE;
45
extern int  ff_bfin_pix_norm1  (uint8_t * pix, int line_size) L1CODE;
46
extern int  ff_bfin_z_sad8x8   (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) L1CODE;
47
extern int  ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) L1CODE;
48

  
49
extern void ff_bfin_z_put_pixels16_xy2     (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) L1CODE;
50
extern void ff_bfin_z_put_pixels8_xy2      (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) L1CODE;
51
extern void ff_bfin_put_pixels16_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) L1CODE;
52
extern void ff_bfin_put_pixels8_xy2_nornd  (uint8_t *block, const uint8_t *s0, int line_size, int h) L1CODE;
53

  
54

  
55
extern int  ff_bfin_pix_sum (uint8_t *p, int stride) L1CODE;
56

  
57
extern void ff_bfin_put_pixels8uc        (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) L1CODE;
58
extern void ff_bfin_put_pixels16uc       (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) L1CODE;
59
extern void ff_bfin_put_pixels8uc_nornd  (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) L1CODE;
60
extern void ff_bfin_put_pixels16uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) L1CODE;
61

  
62
extern int ff_bfin_sse4  (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) L1CODE;
63
extern int ff_bfin_sse8  (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) L1CODE;
64
extern int ff_bfin_sse16 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) L1CODE;
65

  
66

  
67
#if 0
68
void pblk (uint8_t *p, int w, int h, int s)
69
{
70
    int i,j;
71
    av_log (0,0,"0x%08x:\n", p);
72
    for (i = 0;i<h;i++) {
73
        for (j=0;j<w;j++)
74
            av_log (0,0,"%3d ", p[j]);
75
        p+=s;
76
        av_log (0,0,"\n");
77
    }
78
    av_log (0,0,"\n");
79
}
80
#endif
81

  
82
static void bfin_idct_add (uint8_t *dest, int line_size, DCTELEM *block)
83
{
84
    ff_bfin_idct (block);
85
    ff_bfin_add_pixels_clamped (block, dest, line_size);
86
}
87

  
88
static void bfin_idct_put (uint8_t *dest, int line_size, DCTELEM *block)
89
{
90
    ff_bfin_idct (block);
91
    ff_bfin_put_pixels_clamped (block, dest, line_size);
92
}
93

  
94

  
95
static void bfin_clear_blocks (DCTELEM *blocks)
96
{
97
    // This is just a simple memset.
98
    //
99
    asm("P0=192; "
100
        "I0=%0;  "
101
        "R0=0;   "
102
        "LSETUP(clear_blocks_blkfn_lab,clear_blocks_blkfn_lab)LC0=P0;"
103
        "clear_blocks_blkfn_lab:"
104
        "[I0++]=R0;"
105
        ::"a" (blocks):"P0","I0","R0");
106
}
107

  
108

  
109

  
110
static void bfin_put_pixels8 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
111
{
112
    ff_bfin_put_pixels8uc (block, pixels, pixels, line_size, line_size, h);
113
}
114

  
115
static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, int line_size, int h)
116
{
117
    ff_bfin_put_pixels8uc (block, pixels, pixels+1, line_size, line_size, h);
118
}
119

  
120
static void bfin_put_pixels8_y2 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
121
{
122
    ff_bfin_put_pixels8uc (block, pixels, pixels+line_size, line_size, line_size, h);
123
}
124

  
125
static void bfin_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, int line_size, int h)
126
{
127
    ff_bfin_z_put_pixels8_xy2 (block,s0,line_size, line_size, h);
128
}
129

  
130
static void bfin_put_pixels16 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
131
{
132
    ff_bfin_put_pixels16uc (block, pixels, pixels, line_size, line_size, h);
133
}
134

  
135
static void bfin_put_pixels16_x2 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
136
{
137
    ff_bfin_put_pixels16uc (block, pixels, pixels+1, line_size, line_size, h);
138
}
139

  
140
static void bfin_put_pixels16_y2 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
141
{
142
    ff_bfin_put_pixels16uc (block, pixels, pixels+line_size, line_size, line_size, h);
143
}
144

  
145
static void bfin_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, int line_size, int h)
146
{
147
    ff_bfin_z_put_pixels16_xy2 (block,s0,line_size, line_size, h);
148
}
149

  
150
void bfin_put_pixels8_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
151
{
152
    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels, line_size, h);
153
}
154

  
155
static void bfin_put_pixels8_x2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
156
{
157
    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+1, line_size, h);
158
}
159

  
160
static void bfin_put_pixels8_y2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
161
{
162
    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+line_size, line_size, h);
49 163
}
50 164

  
165

  
166
void bfin_put_pixels16_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
167
{
168
    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels, line_size, h);
169
}
170

  
171
static void bfin_put_pixels16_x2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
172
{
173
    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+1, line_size, h);
174
}
175

  
176
static void bfin_put_pixels16_y2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
177
{
178
    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+line_size, line_size, h);
179
}
180

  
181
static int bfin_pix_abs16 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
182
{
183
    return ff_bfin_z_sad16x16 (blk1,blk2,line_size,line_size,h);
184
}
185

  
186
static uint8_t vtmp_blk[256] __attribute__((l1_data_B));
187

  
188
static int bfin_pix_abs16_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
189
{
190
    ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+1, 16, line_size, h);
191
    return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
192
}
193

  
194
static int bfin_pix_abs16_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
195
{
196
    ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+line_size, 16, line_size, h);
197
    return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
198
}
199

  
200
static int bfin_pix_abs16_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
201
{
202
    ff_bfin_z_put_pixels16_xy2 (vtmp_blk, blk2, 16, line_size, h);
203
    return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
204
}
205

  
206
static int bfin_pix_abs8 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
207
{
208
    return ff_bfin_z_sad8x8 (blk1,blk2,line_size,line_size, h);
209
}
210

  
211
static int bfin_pix_abs8_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
212
{
213
    ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+1, 8, line_size, h);
214
    return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
215
}
216

  
217
static int bfin_pix_abs8_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
218
{
219
    ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+line_size, 8, line_size, h);
220
    return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
221
}
222

  
223
static int bfin_pix_abs8_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
224
{
225
    ff_bfin_z_put_pixels8_xy2 (vtmp_blk, blk2, 8, line_size, h);
226
    return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
227
}
228

  
229

  
230
/*
231
  decoder optimization
232
  start on 2/11 100 frames of 352x240@25 compiled with no optimization -g debugging
233
  9.824s ~ 2.44x off
234
  6.360s ~ 1.58x off with -O2
235
  5.740s ~ 1.43x off with idcts
236

  
237
  2.64s    2/20 same sman.mp4 decode only
238

  
239
*/
240

  
51 241
void dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx )
52 242
{
53
    c->pix_abs[1][0] = sad8x8_bfin;
54
    c->sad[1] = sad8x8_bfin;
243
    c->get_pixels         = ff_bfin_get_pixels;
244
    c->diff_pixels        = ff_bfin_diff_pixels;
245
    c->put_pixels_clamped = ff_bfin_put_pixels_clamped;
246
    c->add_pixels_clamped = ff_bfin_add_pixels_clamped;
247

  
248
    c->clear_blocks       = bfin_clear_blocks;
249
    c->pix_sum            = ff_bfin_pix_sum;
250
    c->pix_norm1          = ff_bfin_pix_norm1;
251

  
252
    c->sad[0]             = bfin_pix_abs16;
253
    c->sad[1]             = bfin_pix_abs8;
254

  
255
    /* TODO [0] 16  [1] 8 */
256
    c->pix_abs[0][0] = bfin_pix_abs16;
257
    c->pix_abs[0][1] = bfin_pix_abs16_x2;
258
    c->pix_abs[0][2] = bfin_pix_abs16_y2;
259
    c->pix_abs[0][3] = bfin_pix_abs16_xy2;
260

  
261
    c->pix_abs[1][0] = bfin_pix_abs8;
262
    c->pix_abs[1][1] = bfin_pix_abs8_x2;
263
    c->pix_abs[1][2] = bfin_pix_abs8_y2;
264
    c->pix_abs[1][3] = bfin_pix_abs8_xy2;
265

  
266

  
267
    c->sse[0] = ff_bfin_sse16;
268
    c->sse[1] = ff_bfin_sse8;
269
    c->sse[2] = ff_bfin_sse4;
270

  
271

  
272
    /**
273
     * Halfpel motion compensation with rounding (a+b+1)>>1.
274
     * This is an array[4][4] of motion compensation functions for 4
275
     * horizontal blocksizes (8,16) and the 4 halfpel positions
276
     * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
277
     * @param block destination where the result is stored
278
     * @param pixels source
279
     * @param line_size number of bytes in a horizontal line of block
280
     * @param h height
281
     */
282

  
283
    c->put_pixels_tab[0][0] = bfin_put_pixels16;
284
    c->put_pixels_tab[0][1] = bfin_put_pixels16_x2;
285
    c->put_pixels_tab[0][2] = bfin_put_pixels16_y2;
286
    c->put_pixels_tab[0][3] = bfin_put_pixels16_xy2;
287

  
288
    c->put_pixels_tab[1][0] = bfin_put_pixels8;
289
    c->put_pixels_tab[1][1] = bfin_put_pixels8_x2;
290
    c->put_pixels_tab[1][2] = bfin_put_pixels8_y2;
291
    c->put_pixels_tab[1][3] = bfin_put_pixels8_xy2;
292

  
293
    c->put_no_rnd_pixels_tab[1][0] = bfin_put_pixels8_nornd;
294
    c->put_no_rnd_pixels_tab[1][1] = bfin_put_pixels8_x2_nornd;
295
    c->put_no_rnd_pixels_tab[1][2] = bfin_put_pixels8_y2_nornd;
296
    c->put_no_rnd_pixels_tab[1][3] = ff_bfin_put_pixels8_xy2_nornd;
297

  
298
    c->put_no_rnd_pixels_tab[0][0] = bfin_put_pixels16_nornd;
299
    c->put_no_rnd_pixels_tab[0][1] = bfin_put_pixels16_x2_nornd;
300
    c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_nornd;
301
    c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd;
302

  
303
    c->fdct               = ff_bfin_fdct;
304
    c->idct               = ff_bfin_idct;
305
    c->idct_add           = bfin_idct_add;
306
    c->idct_put           = bfin_idct_put;
55 307
}
308

  
309

  
310

  
libavcodec/bfin/fdct_bfin.S
1
/*
2
 * fdct BlackFin
3
 *
4
 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
5
 *
6
 * This file is part of FFmpeg.
7
 *
8
 * FFmpeg is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2.1 of the License, or (at your option) any later version.
12
 *
13
 * FFmpeg is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with FFmpeg; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
 */
22
/*
23
  void ff_bfin_fdct (DCTELEM *buf);
24

  
25
  This implementation works only for 8x8 input. The range of input
26
  must be -256 to 255 i.e. 8bit input represented in a 16bit data
27
  word. The original data must be sign extended into the 16bit data
28
  words.
29

  
30

  
31
   Chen factorization of
32

  
33
           8
34
   X(m) = sum (x(n) * cos ((2n+1)*m*pi/16))
35
          n=0
36

  
37
                                             C4
38
 0  --*-------------*0+7---*-----*0+3-------*-*-------------------> 0
39
       \           /        \   /            X S4,S4
40
 1  --*-\---------/-*1+6---*-\-/-*1+2-------*-*-------------------> 4
41
         \       /            \              -C4     C3
42
 2  --*---\-----/---*2+5---*-/-\-*1-2---------------*-*-----------> 2
43
           \   /            /   \                    X S3,-S3
44
 3  --*-----\-/-----*3+4---*-----*0-3---------------*-*-----------> 6
45
             /                                  C7   C3
46
 4  --*-----/-\-----*3-4------------*-*4+5--*-----*---------------> 1
47
           /   \            -C4      X       \   /S7    C3
48
 5  --*---/-----\---*2-5---*-*------*=*4-5----\-/------*-*--------> 5
49
         /       \          X S4,S4            /        X S3,-S3
50
 6  --*-/---------\-*1-6---*-*------*=*7-6----/-\------*-*--------> 3
51
       /           \        C4       X       /   \-S7   C3
52
    --*-------------*0-7------------*-*7+6--*-----*---------------> 7
53
                                                C7
54

  
55
Notation
56
        Cn = cos(n*pi/8) used throughout the code.
57

  
58

  
59
  Registers used:
60
        R0, R1, R2, R3, R4, R5, R6,R7,  P0, P1, P2, P3, P4, P5, A0, A1.
61
  Other registers used:
62
        I0, I1, I2, I3, B0, B2, B3, M0, M1, L3 registers and LC0.
63

  
64
  Input - r0 - pointer to start of DCTELEM *block
65

  
66
  Output - The DCT output coefficients in the DCTELEM *block
67

  
68
  Register constraint:
69
               This code is called from jpeg_encode.
70
               R6, R5, R4 if modified should be stored and restored.
71

  
72

  
73
  Performance: (Timer version 0.6.33)
74
               Code Size : 240 Bytes.
75
               Memory Required :
76
               Input Matrix : 8 * 8 * 2 Bytes.
77
               Coefficients : 16 Bytes
78
               Temporary matrix: 8 * 8 * 2 Bytes.
79
               Cycle Count :26+{18+8*(14+2S)}*2  where S -> Stalls
80
                            (7.45 c/pel)
81
        -----------------------------------------
82
        |  Size  |  Forward DCT  |  Inverse DCT |
83
        -----------------------------------------
84
        |  8x8   |   284 Cycles  |  311 Cycles  |
85
        -----------------------------------------
86

  
87
Ck = int16(cos(k/16*pi)*32767+.5)/2
88
#define C4 23170
89
#define C3 13623
90
#define C6 6270
91
#define C7 3196
92

  
93
Sk = int16(sin(k/16*pi)*32767+.5)/2
94
#define S4 11585
95
#define S3 9102
96
#define S6 15137
97
#define S7 16069
98

  
99
the coefficients are ordered as follows:
100
short dct_coef[]
101
  C4,S4,
102
  C6,S6,
103
  C7,S7,
104
  S3,C3,
105

  
106
-----------------------------------------------------------
107
FFMPEG conformance testing results
108
-----------------------------------------------------------
109
dct-test: modified with the following
110
            dct_error("BFINfdct", 0, ff_bfin_fdct, fdct, test);
111
produces the following output:
112

  
113
root:/u/ffmpeg/bhead/libavcodec> ./dct-test
114
ffmpeg DCT/IDCT test
115

  
116
    2  -131    -6   -48   -36    33   -83    24
117
   34    52   -24   -15     5    92    57   143
118
  -67   -43    -1    74   -16     5   -71    32
119
  -78   106    92   -34   -38    81    20   -18
120
    7   -62    40     2   -15    90   -62   -83
121
  -83     1  -104   -13    43   -19     7    11
122
  -63    31    12   -29    83    72    21    10
123
  -17   -63   -15    73    50   -91   159   -14
124
DCT BFINfdct: err_inf=2 err2=0.16425938 syserr=0.00795000 maxout=2098 blockSumErr=27
125
DCT BFINfdct: 92.1 kdct/s
126
root:/u/ffmpeg/bhead/libavcodec>
127

  
128
*/
129

  
130
#include "config_bfin.h"
131

  
132
.section .l1.data.B,"aw",@progbits
133
.align 4;
134
dct_coeff:
135
.short 0x5a82, 0x2d41, 0x187e, 0x3b21, 0x0c7c, 0x3ec5, 0x238e, 0x3537;
136

  
137
.section .l1.data.A,"aw",@progbits
138
.align 4
139
vtmp:   .space 128
140

  
141
DEFUN(fdct,mL1,
142
        (DCTELEM *block)):
143
    [--SP] = (R7:4, P5:3);          // Push the registers onto the stack.
144

  
145
    b0 = r0;
146
    r0 = [P3+dct_coeff@GOT17M4];
147
    b3 = r0;
148
    r0 = [P3+vtmp@GOT17M4];
149
    b2 = r0;
150

  
151
    L3 = 16;                        // L3 is set to 16 to make the coefficient
152
                                    // array Circular.
153

  
154

  
155
//----------------------------------------------------------------------------
156

  
157
/*
158
 * I0, I1, and I2 registers are used to read the input data. I3 register is used
159
 * to read the coefficients. P0 and P1 registers are used for writing the output
160
 * data.
161
 */
162
    M0 = 12 (X);                    // All these initializations are used in the
163
    M1 = 16 (X);                    // modification of address offsets.
164

  
165
    M2 = 128 (X);
166

  
167
    P2 = 16;
168
    P3 = 32 (X);
169
    P4 = -110 (X);
170
    P5 = -62 (X);
171
    P0 = 2(X);
172

  
173

  
174
    // Prescale the input to get the correct precision.
175
    i0=b0;
176
    i1=b0;
177

  
178
    lsetup (.0, .1) LC0 = P3;
179
    r0=[i0++];
180
.0:     r1=r0<<3 (v) || r0=[i0++] ;
181
.1:     [i1++]=r1;
182

  
183
        /*
184
         * B0 points to the "in" buffer.
185
         * B2 points to "temp" buffer in the first iteration.
186
         */
187

  
188
    lsetup (.2, .3) LC0 = P0;
189
.2:
190
        I0 = B0;                        // I0 points to Input Element (0, 0).
191
        I1 = B0;                        // Element 1 and 0 is read in R0.
192
        I1 += M0  || R0 = [I0++];       // I1 points to Input Element (0, 6).
193
        I2 = I1;                        // Element 6 is read into R3.H.
194
        I2 -= 4   || R3.H = W[I1++];    // I2 points to Input Element (0, 4).
195

  
196
        I3 = B3;                        // I3 points to Coefficients.
197
        P0 = B2;                        // P0 points to temporary array Element
198
                                        //   (0, 0).
199
        P1 = B2;                        // P1 points to temporary array.
200
        R7 = [P1++P2] || R2 = [I2++];   // P1 points to temporary array
201
                                        //   Element (1, 0).
202
                                        // R7 is a dummy read. X4,X5
203
                                        //   are read into R2.
204
        R3.L = W[I1--];                 // X7 is read into R3.L.
205
        R1.H = W[I0++];                 // X2 is read into R1.H.
206

  
207

  
208
        /*
209
         *  X0 = (X0 + X7) / 2.
210
         *  X1 = (X1 + X6) / 2.
211
         *  X6 = (X1 - X6) / 2.
212
         *  X7 = (X0 - X7) / 2.
213
         *  It reads the data 3 in R1.L.
214
         */
215

  
216
        R0 = R0 +|+ R3, R3 = R0 -|- R3 || R1.L = W[I0++] || NOP;
217

  
218
        /*
219
         *       X2 = (X2 + X5) / 2.
220
         *       X3 = (X3 + X4) / 2.
221
         *       X4 = (X3 - X4) / 2.
222
         *       X5 = (X2 - X5) / 2.
223
         *          R7 = C4 = cos(4*pi/16)
224
         */
225

  
226
        R1 = R1 +|+ R2, R2 = R1 -|- R2 (CO) || NOP      ||  R7 = [I3++];
227

  
228
        /*
229
         * At the end of stage 1 R0 has (1,0), R1 has (2,3), R2 has (4, 5) and
230
         * R3 has (6,7).
231
         * Where the notation (x, y) represents uper/lower half pairs.
232
         */
233

  
234
        /*
235
         *       X0 = X0 + X3.
236
         *       X1 = X1 + X2.
237
         *       X2 = X1 - X2.
238
         *       X3 = X0 - X3.
239
         */
240
        R0 = R0 +|+ R1, R1 = R0 -|- R1;
241

  
242
        lsetup (.row0, .row1) LC1 = P2 >> 1;  // 1d dct, loops 8x
243
.row0:
244

  
245
        /*
246
         *       This is part 2 computation continued.....
247
         *       A1 =      X6 * cos(pi/4)
248
         *       A0 =      X6 * cos(pi/4)
249
         *       A1 = A1 - X5 * cos(pi/4)
250
         *       A0 = A0 + X5 * cos(pi/4).
251
         *       The instruction W[I0] = R3.L is used for packing it to R2.L.
252
         */
253

  
254
        A1=R3.H*R7.l,         A0=R3.H*R7.l            ||  I1+=M1 || W[I0] = R3.L;
255
        R4.H=(A1-=R2.L*R7.l), R4.L=(A0+=R2.L*R7.l)    ||  I2+=M0 || NOP;
256

  
257
        /*       R0 = (X1,X0)      R1 = (X2,X3)       R4 = (X5, X6). */
258

  
259
        /*
260
         *       A1 =      X0 * cos(pi/4)
261
         *       A0 =      X0 * cos(pi/4)
262
         *       A1 = A1 - X1 * cos(pi/4)
263
         *       A0 = A0 + X1 * cos(pi/4)
264
         *       R7 = (C2,C6)
265
         */
266
        A1=R0.L*R7.h,        A0=R0.L*R7.h             || NOP       || R3.H=W[I1++];
267
        R5.H=(A1-=R0.H*R7.h),R5.L=(A0+=R0.H*R7.h)     || R7=[I3++] || NOP;
268

  
269
        /*
270
         *       A1 =      X2 * cos(3pi/8)
271
         *       A0 =      X3 * cos(3pi/8)
272
         *       A1 = A1 + X3 * cos(pi/8)
273
         *       A0 = A0 - X2 * cos(pi/8)
274
         *         R3 = cos(pi/4)
275
         *         R7 = (cos(7pi/8),cos(pi/8))
276
         *       X4 = X4 + X5.
277
         *       X5 = X4 - X5.
278
         *       X6 = X7 - X6.
279
         *       X7 = X7 + X6.
280
         */
281
        A1=R1.H*R7.L,        A0=R1.L*R7.L             || W[P0++P3]=R5.L || R2.L=W[I0];
282
        R2=R2+|+R4,          R4=R2-|-R4               || I0+=4          || R3.L=W[I1--];
283
        R6.H=(A1+=R1.L*R7.H),R6.L=(A0 -= R1.H * R7.H) || I0+=4          || R7=[I3++];
284

  
285
        /*         R2 = (X4, X7)        R4 = (X5,X6)      R5 = (X1, X0)       R6 = (X2,X3). */
286

  
287
        /*
288
         *       A1 =      X4 * cos(7pi/16)
289
         *       A0 =      X7 * cos(7pi/16)
290
         *       A1 = A1 + X7 * cos(pi/16)
291
         *       A0 = A0 - X4 * cos(pi/16)
292
         */
293

  
294
        A1=R2.H*R7.L,        A0=R2.L*R7.L             || W[P0++P3]=R6.H || R0=[I0++];
295
        R2.H=(A1+=R2.L*R7.H),R2.L=(A0-=R2.H*R7.H)     || W[P0++P3]=R5.H || R7=[I3++];
296

  
297
        /*
298
         *       A1 =      X5 * cos(3pi/16)
299
         *       A0 =      X6 * cos(3pi/16)
300
         *       A1 = A1 + X6 * cos(5pi/16)
301
         *       A0 = A0 - X5 * cos(5pi/16)
302
         *       The output values are written.
303
         */
304

  
305
        A1=R4.H*R7.H,        A0=R4.L*R7.H             || W[P0++P2]=R6.L || R1.H=W[I0++];
306
        R4.H=(A1+=R4.L*R7.L),R4.L=(A0-=R4.H*R7.L)     || W[P0++P4]=R2.L || R1.L=W[I0++];
307

  
308

  
309
        /* Beginning of next stage, **pipelined** + drain and store the
310
           rest of the column store. */
311

  
312
        R0=R0+|+R3,R3=R0-|-R3                         || W[P1++P3]=R2.H || R2=[I2++];
313
        R1=R1+|+R2,R2=R1-|-R2 (CO)                    || W[P1++P3]=R4.L || R7=[I3++];
314
.row1:  R0=R0+|+R1,R1=R0-|-R1                         || W[P1++P5]=R4.H || NOP;
315

  
316
        // Exchange input with output.
317
        B1 = B0;
318
        B0 = B2;
319
.3:     B2 = B1;
320

  
321
        L3=0;
322
        (r7:4,p5:3) = [sp++];
323
        RTS;
324

  
libavcodec/bfin/idct_bfin.S
1
/*
2
 * idct BlackFin
3
 *
4
 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
5
 *
6
 * This file is part of FFmpeg.
7
 *
8
 * FFmpeg is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2.1 of the License, or (at your option) any later version.
12
 *
13
 * FFmpeg is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with FFmpeg; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
 */
22
/*
23
   This blackfin DSP code implements an 8x8 inverse type II DCT.
24

  
25
Prototype       : void ff_bfin_idct(DCTELEM *in)
26

  
27
Registers Used  : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
28

  
29
Performance     :
30
                    Code Size   : 498 Bytes.
31
                    Cycle Count : 417 Cycles
32

  
33

  
34
-----------------------------------------------------------
35
FFMPEG conformance testing results
36
-----------------------------------------------------------
37

  
38
dct-test: modified with the following
39
            dct_error("BFINidct", 1, ff_bfin_idct, idct, test);
40
produces the following output
41

  
42
root:/u/ffmpeg/bhead/libavcodec> ./dct-test -i
43
ffmpeg DCT/IDCT test
44

  
45
    8    15    -2    21    24    17     0    10
46
    2   -10    -5    -5    -3     7   -14    -3
47
    2   -13   -10   -19    18    -6     6    -2
48
    9     4    16    -3     9    12    10    15
49
   15    -9    -2    10     1    16     0   -15
50
  -15     5     7     3    13     0    13    20
51
   -6   -15    24     9   -18     1     9   -22
52
   -8    25    23     2    -7     0    30    13
53
IDCT BFINidct: err_inf=1 err2=0.01002344 syserr=0.00150000 maxout=266 blockSumErr=64
54
IDCT BFINidct: 88.3 kdct/s
55

  
56
*/
57

  
58
#include "config_bfin.h"
59

  
60
.section .l1.data.B,"aw",@progbits
61

  
62
.align 4;
63
coefs:
64
.short 0x5a82;           //  C4
65
.short 0x5a82;           //  C4
66
.short 0x30FC;           //cos(3pi/8)  C6
67
.short 0x7642;           //cos(pi/8)   C2
68
.short 0x18F9;           //cos(7pi/16)
69
.short 0x7D8A;           //cos(pi/16)
70
.short 0x471D;           //cos(5pi/16)
71
.short 0x6A6E;           //cos(3pi/16)
72
.short 0x18F9;           //cos(7pi/16)
73
.short 0x7D8A;           //cos(pi/16)
74

  
75
.section .l1.data.A
76

  
77
vtmp: .space 256
78

  
79
#define TMP0 FP-8
80
#define TMP1 FP-12
81
#define TMP2 FP-16
82

  
83

  
84
DEFUN(idct,mL1,
85
        (DCTELEM *block)):
86

  
87
/********************** Function Prologue *********************************/
88
    link 16;
89
    [--SP] = (R7:4, P5:3);   // Push the registers onto the stack.
90
    B0 = R0;                 // Pointer to Input matrix
91
    R1 = [P3+coefs@GOT17M4]; // Pointer to Coefficients
92
    R2 = [P3+vtmp@GOT17M4];  // Pointer to Temporary matrix
93
    B3 = R1;
94
    B2 = R2;
95
    L3 = 20;                // L3 is used for making the coefficient array
96
                            // circular.
97
                            // MUST BE RESTORED TO ZERO at function exit.
98
    M1 = 16 (X);            // All these registers are initialized for
99
    M3 = 8(X);              // modifying address offsets.
100

  
101
    I0 = B0;                // I0 points to Input Element (0, 0).
102
    I2 = B0;                // I2 points to Input Element (0, 0).
103
    I2 += M3 || R0.H = W[I0];
104
                            // Element 0 is read into R0.H
105
    I1 = I2;                // I1 points to input Element (0, 6).
106
    I1 += 4  || R0.L = W[I2++];
107
                            // I2 points to input Element (0, 4).
108
                            // Element 4 is read into R0.L.
109
    P2 = 8 (X);
110
    P3 = 32 (X);
111
    P4 = -32 (X);
112
    P5 = 98 (X);
113
    R7 = 0x8000(Z);
114
    I3 = B3;                // I3 points to Coefficients
115
    P0 = B2;                // P0 points to array Element (0, 0) of temp
116
    P1 = B2;
117
    R7 = [I3++] || [TMP2]=R7;            // Coefficient C4 is read into R7.H and R7.L.
118
    MNOP;
119
    NOP;
120

  
121
    /*
122
     *   A1 =      Y0 * cos(pi/4)
123
     *   A0 =      Y0 * cos(pi/4)
124
     *   A1 = A1 + Y4 * cos(pi/4)
125
     *   A0 = A0 - Y4 * cos(pi/4)
126
     *   load:
127
     *     R1=(Y2,Y6)
128
     *     R7=(C2,C6)
129
     *   res:
130
     *     R3=Y0, R2=Y4
131
     */
132
    A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || I0+= 4       || R1.L=W[I1++];
133
    R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || R1.H=W[I0--] || R7=[I3++];
134

  
135
    LSETUP (.0, .1) LC0 = P2; // perform 8 1d idcts
136

  
137
    P2 = 112 (X);
138
    P1 = P1 + P2;           // P1 points to element (7, 0) of temp buffer.
139
    P2 = -94(X);
140

  
141
.0:
142
       /*
143
        *   A1 =      Y2 * cos(3pi/8)
144
        *   A0 =      Y2 * cos(pi/8)
145
        *   A1 = A1 - Y6 * cos(pi/8)
146
        *   A0 = A0 + Y6 * cos(3pi/8)
147
        *      R5 = (Y1,Y7)
148
        *      R7 = (C1,C7)
149
        *   res:
150
        *      R1=Y2, R0=Y6
151
        */
152
        A1=R7.L*R1.H,       A0=R7.H*R1.H (IS)        || I0+=4        || R5.H=W[I0];
153
        R1=(A1-=R7.H*R1.L), R0=(A0+=R7.L*R1.L) (IS)  || R5.L=W[I1--] || R7=[I3++];
154
        /*
155
        *   Y0 = Y0 + Y6.
156
        *   Y4 = Y4 + Y2.
157
        *   Y2 = Y4 - Y2.
158
        *   Y6 = Y0 - Y6.
159
        *     R3 is saved
160
        *     R6.l=Y3
161
        * note: R3: Y0, R2: Y4, R1: Y2, R0: Y6
162
        */
163
        R3=R3+R0, R0=R3-R0;
164
        R2=R2+R1, R1=R2-R1 || [TMP0]=R3 || R6.L=W[I0--];
165
        /*
166
         *  Compute the odd portion (1,3,5,7) even is done.
167
         *
168
         *  Y1 = C7 * Y1 - C1 * Y7 + C3 * Y5 - C5 * Y3.
169
         *  Y7 = C1 * Y1 + C7 * Y7 + C5 * Y5 + C3 * Y3.
170
         *  Y5 = C5 * Y1 + C3 * Y7 + C7 * Y5 - C1 * Y3.
171
         *  Y3 = C3 * Y1 - C5 * Y7 - C1 * Y5 - C7 * Y3.
172
         */
173
        //  R5=(Y1,Y7)  R6=(Y5,Y3)                                                   // R7=(C1,C7)
174
        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || [TMP1]=R2 || R6.H=W[I2--];
175
        A1-=R7.H*R5.L,       A0+=R7.L*R5.L (IS)       || I0-=4     || R7=[I3++];
176
        A1+=R7.H*R6.H,       A0+=R7.L*R6.H (IS)       || I0+=M1;                     // R7=(C3,C5)
177
        R3 =(A1-=R7.L*R6.L), R2 =(A0+=R7.H*R6.L) (IS);
178
        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || R4=[TMP0];
179
        A1+=R7.H*R5.L,       A0-=R7.L*R5.L (IS)       || I1+=M1    || R7=[I3++];     // R7=(C1,C7)
180
        A1+=R7.L*R6.H,       A0-=R7.H*R6.H (IS);
181
        R7 =(A1-=R7.H*R6.L), R6 =(A0-=R7.L*R6.L) (IS) || I2+=M1;
182
        // R3=Y1, R2=Y7, R7=Y5, R6=Y3
183

  
184
        /* Transpose write column. */
185
        R5.H=R4+R2 (RND12);                                   // Y0=Y0+Y7
186
        R5.L=R4-R2 (RND12) || R4 = [TMP1];                    // Y7=Y7-Y0
187
        R2.H=R1+R7 (RND12) || W[P0++P3]=R5.H;                 // Y2=Y2+Y5 st Y0
188
        R2.L=R1-R7 (RND12) || W[P1++P4]=R5.L || R7=[I3++];    // Y5=Y2-Y5 st Y7
189
        R5.H=R0-R3 (RND12) || W[P0++P3]=R2.H || R1.L=W[I1++]; // Y1=Y6-Y1 st Y2
190
        R5.L=R0+R3 (RND12) || W[P1++P4]=R2.L || R0.H=W[I0++]; // Y6=Y6+Y1 st Y5
191
        R3.H=R4-R6 (RND12) || W[P0++P3]=R5.H || R0.L=W[I2++]; // Y3=Y3-Y4 st Y1
192
        R3.L=R4+R6 (RND12) || W[P1++P4]=R5.L || R1.H=W[I0++]; // Y4=Y3+Y4 st Y6
193

  
194
        /* pipeline loop start, + drain Y3, Y4 */
195
        A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || W[P0++P2]= R3.H || R1.H = W[I0--];
196
.1:     R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || W[P1++P5]= R3.L || R7 = [I3++];
197

  
198

  
199

  
200
    I0 = B2;                // I0 points to Input Element (0, 0)
201
    I2 = B2;                // I2 points to Input Element (0, 0)
202
    I2 += M3 || R0.H = W[I0];
203
                            // Y0 is read in R0.H
204
    I1 = I2;                // I1 points to input Element (0, 6)
205
    I1 += 4  || R0.L = W[I2++];
206
                            // I2 points to input Element (0, 4)
207
                            // Y4 is read in R0.L
208
    P2 = 8 (X);
209
    I3 = B3;                // I3 points to Coefficients
210
    P0 = B0;                // P0 points to array Element (0, 0) for writing
211
                            // output
212
    P1 = B0;
213
    R7 = [I3++];            // R7.H = C4 and R7.L = C4
214
    NOP;
215

  
216
    /*
217
     *   A1 =      Y0 * cos(pi/4)
218
     *   A0 =      Y0 * cos(pi/4)
219
     *   A1 = A1 + Y4 * cos(pi/4)
220
     *   A0 = A0 - Y4 * cos(pi/4)
221
     *   load:
222
     *     R1=(Y2,Y6)
223
     *     R7=(C2,C6)
224
     *   res:
225
     *     R3=Y0, R2=Y4
226
     */
227
    A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || I0+=4        || R1.L=W[I1++];
228
    R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || R1.H=W[I0--] || R7=[I3++];
229

  
230
    LSETUP (.2, .3) LC0 = P2; // peform 8 1d idcts
231
    P2 = 112 (X);
232
    P1 = P1 + P2;
233
    P2 = -94(X);
234

  
235
.2:
236
        /*
237
         *   A1 =      Y2 * cos(3pi/8)
238
         *   A0 =      Y2 * cos(pi/8)
239
         *   A1 = A1 - Y6 * cos(pi/8)
240
         *   A0 = A0 + Y6 * cos(3pi/8)
241
         *      R5 = (Y1,Y7)
242
         *      R7 = (C1,C7)
243
         *   res:
244
         *      R1=Y2, R0=Y6
245
         */
246
        A1=R7.L*R1.H,       A0=R7.H*R1.H (IS)        || I0+=4        || R5.H=W[I0];
247
        R1=(A1-=R7.H*R1.L), R0=(A0+=R7.L*R1.L) (IS)  || R5.L=W[I1--] || R7=[I3++];
248
        /*
249
        *   Y0 = Y0 + Y6.
250
        *   Y4 = Y4 + Y2.
251
        *   Y2 = Y4 - Y2.
252
        *   Y6 = Y0 - Y6.
253
        *     R3 is saved
254
        *     R6.l=Y3
255
        * note: R3: Y0, R2: Y4, R1: Y2, R0: Y6
256
        */
257
        R3=R3+R0, R0=R3-R0;
258
        R2=R2+R1, R1=R2-R1 || [TMP0]=R3 || R6.L=W[I0--];
259
        /*
260
         *  Compute the odd portion (1,3,5,7) even is done.
261
         *
262
         *  Y1 = C7 * Y1 - C1 * Y7 + C3 * Y5 - C5 * Y3.
263
         *  Y7 = C1 * Y1 + C7 * Y7 + C5 * Y5 + C3 * Y3.
264
         *  Y5 = C5 * Y1 + C3 * Y7 + C7 * Y5 - C1 * Y3.
265
         *  Y3 = C3 * Y1 - C5 * Y7 - C1 * Y5 - C7 * Y3.
266
         */
267
        //  R5=(Y1,Y7)  R6=(Y5,Y3)                                                   // R7=(C1,C7)
268
        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || [TMP1]=R2 || R6.H=W[I2--];
269
        A1-=R7.H*R5.L,       A0+=R7.L*R5.L (IS)       || I0-=4     || R7=[I3++];
270
        A1+=R7.H*R6.H,       A0+=R7.L*R6.H (IS)       || I0+=M1;                     // R7=(C3,C5)
271
        R3 =(A1-=R7.L*R6.L), R2 =(A0+=R7.H*R6.L) (IS);
272
        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || R4=[TMP0];
273
        A1+=R7.H*R5.L,       A0-=R7.L*R5.L (IS)       || I1+=M1    || R7=[I3++];     // R7=(C1,C7)
274
        A1+=R7.L*R6.H,       A0-=R7.H*R6.H (IS);
275
        R7 =(A1-=R7.H*R6.L), R6 =(A0-=R7.L*R6.L) (IS) || I2+=M1;
276
        // R3=Y1, R2=Y7, R7=Y5, R6=Y3
277

  
278
        /* Transpose write column. */
279
        R5.H=R4+R2 (RND20);                                   // Y0=Y0+Y7
280
        R5.L=R4-R2 (RND20) || R4 = [TMP1];                    // Y7=Y7-Y0
281
        R2.H=R1+R7 (RND20) || W[P0++P3]=R5.H;                 // Y2=Y2+Y5 st Y0
282
        R2.L=R1-R7 (RND20) || W[P1++P4]=R5.L || R7=[I3++];    // Y5=Y2-Y5 st Y7
283
        R5.H=R0-R3 (RND20) || W[P0++P3]=R2.H || R1.L=W[I1++]; // Y1=Y6-Y1 st Y2
284
        R5.L=R0+R3 (RND20) || W[P1++P4]=R2.L || R0.H=W[I0++]; // Y6=Y6+Y1 st Y5
285
        R3.H=R4-R6 (RND20) || W[P0++P3]=R5.H || R0.L=W[I2++]; // Y3=Y3-Y4 st Y1
286
        R3.L=R4+R6 (RND20) || W[P1++P4]=R5.L || R1.H=W[I0++]; // Y4=Y3+Y4 st Y6
287

  
288
        /* pipeline loop start, + drain Y3, Y4 */
289
        A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || W[P0++P2]= R3.H || R1.H = W[I0--];
290
.3:     R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || W[P1++P5]= R3.L || R7 = [I3++];
291

  
292
    L3 = 0;
293
    (R7:4,P5:3)=[SP++];
294
    unlink;
295
    RTS;
296

  
297

  
libavcodec/bfin/pixels_bfin.S
1
/*
2
 * Blackfin Pixel Operations
3
 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
4
 *
5
 * This file is part of FFmpeg.
6
 *
7
 * FFmpeg is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
12
 * FFmpeg is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with FFmpeg; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 */
21
#include "config_bfin.h"
22

  
23
DEFUN(put_pixels_clamped,mL1,
24
        (DCTELEM *block, uint8_t *dest, int line_size)):
25
    [--SP] = (R7:4);
26
    R4 = 0;
27
    R5.l = 0x00ff;
28
    R5.h = 0x00ff;
29
    I0 = R0;         // block
30
    I1 = R1;         // dest
31
    R2 += -4;        // line_size
32
    M1 = R2;
33
    P0 = 8;
34
    R0 = [I0++];
35
    R1 = [I0++];
36
    R2 = MAX(R0, R4) (V);
37
    LSETUP (ppc$0,ppc$1) LC0=P0;
38
ppc$0: R2 = MIN(R2, R5) (V);
39
       R3 = MAX(R1, R4) (V);
40
       R3 = MIN(R3, R5) (V)      || R0 = [I0++];
41
       R6 = BYTEPACK (R2,R3)     || R1 = [I0++];
42
       R2 = MAX(R0, R4) (V)      || [I1++] = R6;
43
       R2 = MIN(R2, R5) (V);
44
       R3 = MAX(R1, R4) (V);
45
       R3 = MIN(R3, R5) (V)      || R0 = [I0++];
46
       R6 = BYTEPACK (R2,R3)     || R1 = [I0++];
47
ppc$1: R2 = Max(R0, R4) (V)      || [I1++M1] = R6;
48

  
49
    (R7:4) = [SP++];
50
    RTS;
51

  
52
DEFUN(add_pixels_clamped,mL1,
53
        (DCTELEM *block, uint8_t *dest, int line_size)):
54
    [-- SP] = (R7:4);
55
    R4 = 0;
56
    I0 = 0;
57
    R2 += -4;        // line_size
58
    M0 = R2;
59
    I1 = R1;         // dest
60
    I3 = R0;         // block
61
    I2 = R1;         // dest
62
    P0 = 8;
63
    M3 = 2;
64
    R0 = [I3++]  || R2 = [I1];
65
    R2 = R2 << 8                      || R0.H = W[I3--]  || R3 = [I1++];
66
    R3 = R3 >> 8                      || R1.L = W[I3]    || I3 += 4;
67
    R6 = BYTEOP3P(R1:0, R3:2) (LO)    || R1.H = W[I3++]  || R2 = [I1];
68

  
69
    LSETUP(apc$2,apc$3) LC1 = P0;
70
apc$2: R7 = BYTEOP3P(R1:0, R3:2) (HI, R) || R0 = [I3++]     || R3 = [I1++M0];
71
       R2 = R2 << 8                      || R0.H = W[I3--];
72
       R3 = R3 >> 8                      || R1.L = W[I3]    || I3 += 4;
73
       R6 = R6 + R7 (S)                  || R1.H = W[I3];
74
       R6 = BYTEOP3P(R1:0, R3:2) (LO)    || I3+=M3          || [I2++]=R6;
75
       R7 = BYTEOP3P(R1:0, R3:2) (HI, R) || R0 = [I3++]     || R2 = [I1];
76
       R2 = R2 << 8                      || R0.H = W[I3--]  || R3 = [I1++];
77
       R3 = R3 >> 8                      || R1.L = W[I3]    || I3 += 4;
78
       R6 = R6 + R7 (S)                  || R1.H = W[I3++];
79
apc$3: R6 = BYTEOP3P(R1:0, R3:2) (LO)    || [I2++M0] = R6   || R2 = [I1];
80

  
81
    (R7:4) = [SP++];
82
    RTS;
83

  
84

  
85
/*
86
  motion compensation
87
  primitives
88

  
89
     * Halfpel motion compensation with rounding (a+b+1)>>1.
90
     * This is an array[4][4] of motion compensation funcions for 4
91
     * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
92
     * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
93
     * @param block destination where the result is stored
94
     * @param pixels source
95
     * @param line_size number of bytes in a horizontal line of block
96
     * @param h height
97

  
98
*/
99

  
100
DEFUN(put_pixels8uc,mL1,
101
        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
102
                 int dest_size, int line_size, int h)):
103
        i3=r0;        // dest
104
        i0=r1;        // src0
105
        i1=r2;        // src1
106
        r0=[sp+12];   // dest_size
107
        r2=[sp+16];   // line_size
108
        p0=[sp+20];   // h
109
        [--sp] = (r7:6);
110
        r0+=-4;
111
        m3=r0;
112
        r2+=-8;
113
        m0=r2;
114
        LSETUP(pp8$0,pp8$1) LC0=P0;
115
        DISALGNEXCPT                || R0 = [I0++]  || R2  =[I1++];
116

  
117
pp8$0:  DISALGNEXCPT                || R1 = [I0++]  || R3  =[I1++];
118
        R6 = BYTEOP1P(R1:0,R3:2)    || R0 = [I0++M0]|| R2  =[I1++M0];
119
        R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++]  || [I3++] = R6 ;
120
pp8$1:  DISALGNEXCPT                || R2 = [I1++]  || [I3++M3] = R7;
121

  
122
        (r7:6) = [sp++];
123
        RTS;
124

  
125
DEFUN(put_pixels16uc,mL1,
126
        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
127
                 int dest_size, int line_size, int h)):
128
        link 0;
129
        [--sp] = (r7:6);
130
        i3=r0;        // dest
131
        i0=r1;        // src0
132
        i1=r2;        // src1
133
        r0=[fp+20];   // dest_size
134
        r2=[fp+24];   // line_size
135
        p0=[fp+28];   // h
136

  
137

  
138
        r0+=-12;
139
        m3=r0;        // line_size
140
        r2+=-16;
141
        m0=r2;
142

  
143
        LSETUP(pp16$0,pp16$1) LC0=P0;
144
         DISALGNEXCPT                || R0 = [I0++]   || R2  =[I1++];
145

  
146
pp16$0:  DISALGNEXCPT                || R1 = [I0++]   || R3  =[I1++];
147
         R6 = BYTEOP1P(R1:0,R3:2)    || R0 = [I0++]   || R2  =[I1++];
148
         R7 = BYTEOP1P(R1:0,R3:2)(R) || R1 = [I0++]   || R3  =[I1++];
149
         [I3++] = R6;
150
         R6 = BYTEOP1P(R1:0,R3:2)    || R0 = [I0++M0] || R2  =[I1++M0];
151
         R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++]   || [I3++] = R7 ;
152
         [I3++] = R6;
153
pp16$1:  DISALGNEXCPT                || R2 = [I1++]   || [I3++M3] = R7;
154

  
155
        (r7:6) = [sp++];
156
        unlink;
157
        RTS;
158

  
159

  
160

  
161

  
162

  
163

  
164
DEFUN(put_pixels8uc_nornd,mL1,
165
        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
166
                 int line_size, int h)):
167
        i3=r0;        // dest
168
        i0=r1;        // src0
169
        i1=r2;        // src1
170
        r2=[sp+12];   // line_size
171
        p0=[sp+16];   // h
172
        [--sp] = (r7:6);
173
        r2+=-4;
174
        m3=r2;
175
        r2+=-4;
176
        m0=r2;
177
        LSETUP(pp8$2,pp8$3) LC0=P0;
178
        DISALGNEXCPT                || R0 = [I0++]  || R2  =[I1++];
179

  
180
pp8$2:  DISALGNEXCPT                || R1 = [I0++]  || R3  =[I1++];
181
        R6 = BYTEOP1P(R1:0,R3:2)(T)  || R0 = [I0++M0]|| R2  =[I1++M0];
182
        R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++]  || [I3++] = R6 ;
183
pp8$3:  DISALGNEXCPT                || R2 = [I1++]  || [I3++M3] = R7;
184

  
185
        (r7:6) = [sp++];
186
        RTS;
187

  
188
DEFUN(put_pixels16uc_nornd,mL1,
189
        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
190
                 int line_size, int h)):
191
        i3=r0;        // dest
192
        i0=r1;        // src0
193
        i1=r2;        // src1
194
        r2=[sp+12];   // line_size
195
        p0=[sp+16];   // h
196

  
197
        [--sp] = (r7:6);
198
        r2+=-12;
199
        m3=r2;        // line_size
200
        r2+=-4;
201
        m0=r2;
202

  
203
        LSETUP(pp16$2,pp16$3) LC0=P0;
204
        DISALGNEXCPT                || R0 = [I0++]   || R2  =[I1++];
205

  
206
pp16$2:
207
        DISALGNEXCPT                || R1 = [I0++]   || R3  =[I1++];
208
        R6 = BYTEOP1P(R1:0,R3:2)(T)    || R0 = [I0++]   || R2  =[I1++];
209
        R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R1 = [I0++]   || R3  =[I1++];
210
        [I3++] = R6;
211

  
212
        R6 = BYTEOP1P(R1:0,R3:2)(T)    || R0 = [I0++M0] || R2  =[I1++M0];
213
        R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++]   || [I3++] = R7 ;
214
        [I3++] = R6;
215
pp16$3: DISALGNEXCPT                || R2 = [I1++]   || [I3++M3] = R7;
216

  
217
        (r7:6) = [sp++];
218

  
219
        RTS;
220

  
221
DEFUN(z_put_pixels16_xy2,mL1,
222
        (uint8_t *block, const uint8_t *s0,
223
                 int dest_size, int line_size, int h)):
224
        link 0;
225
        [--sp] = (r7:4);
226
        i3=r0;        // dest
227
        i0=r1;        // src0--> pixels
228
        i1=r1;        // src1--> pixels + line_size
229
        r2+=-12;
230
        m2=r2;        // m2=dest_width-4
231
        r2=[fp+20];
232
        m3=r2;        // line_size
233
        p0=[fp+24];   // h
234
        r2+=-16;
235
        i1+=m3;       /* src1 + line_size */
236
        m0=r2;        /* line-size - 20 */
237

  
238
        B0 = I0;
239
        B1 = I1;
240
        B3 = I3;
241

  
242
        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
243

  
244
        LSETUP(LS$16E,LE$16E) LC0=P0;
245
LS$16E: DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
246
        R4 = BYTEOP2P (R3:2,R1:0) (RNDL)   || R0 = [I0++] || R2  =[I1++];
247
        R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R1 = [I0++] || [I3++] = R4 ;
248
        DISALGNEXCPT                       || R3 = [I1++] || [I3++] = R5;
249
        R4 = BYTEOP2P (R3:2,R1:0) (RNDL)   || R0 = [I0++M0]|| R2  = [I1++M0];
250
        R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++] || [I3++] = R4 ;
251
LE$16E: DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
252

  
253
        M1 = 1;
254
        I3 = B3;
255
        I1 = B1;
256
        I0 = B0;
257

  
258
        I0 += M1;
259
        I1 += M1;
260

  
261
        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
262
        LSETUP(LS$16O,LE$16O) LC0=P0;
263
LS$16O: DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
264
        R4 = BYTEOP2P (R3:2,R1:0) (RNDH)   || R0 = [I0++] || R2  =[I1++];
265
        R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R1 = [I0++] || R6  =[I3++];
266
        R4 = R4 +|+ R6                       || R7 = [I3--];
267
        R5 = R5 +|+ R7                       || [I3++] = R4;
268
        DISALGNEXCPT                       || R3  =[I1++] || [I3++] = R5;
269
        R4 = BYTEOP2P (R3:2,R1:0) (RNDH)   || R0 = [I0++M0]|| R2  = [I1++M0];
270
        R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++] || R6 = [I3++];
271
        R4 = R4 +|+ R6                       || R7 = [I3--];
272
        R5 = R5 +|+ R7                       || [I3++] = R4;
273
LE$16O: DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
274

  
275
        (r7:4) = [sp++];
276
        unlink;
277
        rts;
278

  
279
DEFUN(put_pixels16_xy2_nornd,mL1,
280
        (uint8_t *block, const uint8_t *s0,
281
                 int line_size, int h)):
282
        link 0;
283
        [--sp] = (r7:4);
284
        i3=r0;        // dest
285
        i0=r1;        // src0--> pixels
286
        i1=r1;        // src1--> pixels + line_size
287
        m3=r2;
288
        r2+=-12;
289
        m2=r2;
290
        r2+=-4;
291
        i1+=m3;       /* src1 + line_size */
292
        m0=r2;        /* line-size - 20 */
293
        p0=[fp+20];   // h
294

  
295
        B0=I0;
296
        B1=I1;
297
        B3=I3;
298

  
299
        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
300

  
301
        LSETUP(LS$16ET,LE$16ET) LC0=P0;
302
LS$16ET:DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
303
        R4 = BYTEOP2P (R3:2,R1:0) (TL)     || R0 = [I0++] || R2  =[I1++];
304
        R5 = BYTEOP2P (R3:2,R1:0) (TL,R)   || R1 = [I0++] || [I3++] = R4 ;
305
        DISALGNEXCPT                       || R3 = [I1++] || [I3++] = R5;
306
        R4 = BYTEOP2P (R3:2,R1:0) (TL)     || R0 = [I0++M0]|| R2  = [I1++M0];
307
        R5 = BYTEOP2P (R3:2,R1:0) (TL,R)   || R0 = [I0++] || [I3++] = R4 ;
308
LE$16ET:DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
309

  
310
        M1 = 1;
311
        I3=B3;
312
        I1=B1;
313
        I0=B0;
314

  
315
        I0 += M1;
316
        I1 += M1;
317

  
318
        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
319
        LSETUP(LS$16OT,LE$16OT) LC0=P0;
320
LS$16OT:DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
321
        R4 = BYTEOP2P (R3:2,R1:0) (TH)     || R0 = [I0++] || R2  =[I1++];
322
        R5 = BYTEOP2P (R3:2,R1:0) (TH,R)   || R1 = [I0++] || R6  =[I3++];
323
        R4 = R4 +|+ R6                                    || R7 = [I3--];
324
        R5 = R5 +|+ R7                                    || [I3++] = R4;
325
        DISALGNEXCPT                       || R3  =[I1++] || [I3++] = R5;
326
        R4 = BYTEOP2P (R3:2,R1:0) (TH)     || R0 = [I0++M0]|| R2  = [I1++M0];
327
        R5 = BYTEOP2P (R3:2,R1:0) (TH,R)   || R0 = [I0++] || R6 = [I3++];
328
        R4 = R4 +|+ R6                                    || R7 = [I3--];
329
        R5 = R5 +|+ R7                                    || [I3++] = R4;
330
LE$16OT:DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
331

  
332
        (r7:4) = [sp++];
333
        unlink;
334
        rts;
335

  
336
DEFUN(z_put_pixels8_xy2,mL1,
337
        (uint8_t *block, const uint8_t *s0,
338
                 int dest_size, int line_size, int h)):
339
        link 0;
340
        [--sp] = (r7:4);
341
        i3=r0;        // dest
342
        i0=r1;        // src0--> pixels
343
        i1=r1;        // src1--> pixels + line_size
344
        r2+=-4;
345
        m2=r2;        // m2=dest_width-4
346
        r2=[fp+20];
347
        m3=r2;        // line_size
348
        p0=[fp+24];   // h
349
        r2+=-8;
350
        i1+=m3;       /* src1 + line_size */
351
        m0=r2;        /* line-size - 20 */
352

  
353
        b0 = I0;
354
        b1 = I1;
355
        b3 = I3;
356

  
357
        LSETUP(LS$8E,LE$8E) LC0=P0;
358
        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
359
LS$8E:  DISALGNEXCPT                       || R1 = [I0++]   || R3  =[I1++];
360
        R4 = BYTEOP2P (R3:2,R1:0) (RNDL)   || R0 = [I0++M0] || R2  =[I1++M0];
361
        R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++]   || [I3++] = R4 ;
362
LE$8E:  DISALGNEXCPT                       || R2 = [I1++]   || [I3++M2] = R5;
363

  
364
        M1 = 1;
365
        I3 = b3;
366
        I1 = b1;
367
        I0 = b0;
368

  
369
        I0 += M1;
370
        I1 += M1;
371

  
372
        LSETUP(LS$8O,LE$8O) LC0=P0;
373
        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
374
LS$8O:  DISALGNEXCPT                       || R1 = [I0++]   || R3  =[I1++];
375
        R4 = BYTEOP2P (R3:2,R1:0) (RNDH)   || R0 = [I0++M0] || R2  =[I1++M0];
376
        R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++]   || R6  =[I3++];
377
        R4 = R4 +|+ R6                                      || R7 = [I3--];
378
        R5 = R5 +|+ R7                                      || [I3++] = R4;
379
LE$8O:  DISALGNEXCPT                       || R2  =[I1++]   || [I3++M2] = R5;
380

  
381
        (r7:4) = [sp++];
382
        unlink;
383
        rts;
384

  
385
DEFUN(put_pixels8_xy2_nornd,mL1,
386
        (uint8_t *block, const uint8_t *s0, int line_size, int h)):
387
        link 0;
388
        [--sp] = (r7:4);
389
        i3=r0;        // dest
390
        i0=r1;        // src0--> pixels
391
        i1=r1;        // src1--> pixels + line_size
392
        m3=r2;
393
        r2+=-4;
394
        m2=r2;
395
        r2+=-4;
396
        i1+=m3;       /* src1 + line_size */
397
        m0=r2;        /* line-size - 20 */
398
        p0=[fp+20];   // h
399

  
400

  
401
        b0 = I0;
402
        b1 = I1;
403
        b3 = I3;
404

  
405
        LSETUP(LS$8ET,LE$8ET) LC0=P0;
406
        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
407

  
408
LS$8ET: DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
409
        R4 = BYTEOP2P (R3:2,R1:0) (TL)     || R0 = [I0++M0] || R2 = [I1++M0];
410
        R5 = BYTEOP2P (R3:2,R1:0) (TL,R)   || R0 = [I0++]   || [I3++] = R4 ;
411
LE$8ET: DISALGNEXCPT                       || R2 = [I1++]   || [I3++M2] = R5;
412

  
413
        M1 = 1;
414
        I3 = b3;
415
        I1 = b1;
416
        I0 = b0;
417

  
418
        I0 += M1;
419
        I1 += M1;
420

  
421
        LSETUP(LS$8OT,LE$8OT) LC0=P0;
422
        DISALGNEXCPT                       || R0 = [I0++]   || R2 = [I1++];
423

  
424
LS$8OT: DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
425
        R4 = BYTEOP2P (R3:2,R1:0) (TH)     || R0 = [I0++M0] || R2 = [I1++M0];
426
        R5 = BYTEOP2P (R3:2,R1:0) (TH,R)   || R0 = [I0++]   || R6 = [I3++];
427
        R4 = R4 +|+ R6                                      || R7 = [I3--];
428
        R5 = R5 +|+ R7                                      || [I3++] = R4;
429
LE$8OT: DISALGNEXCPT                       || R2  =[I1++]   || [I3++M2] = R5;
430

  
431
        (r7:4) = [sp++];
432
        unlink;
433
        rts;
434

  
435
DEFUN(diff_pixels,mL1,
436
       (DCTELEM *block, uint8_t *s1, uint8_t *s2, int stride)):
437
        link 0;
438
        [--sp] = (r7:4);
439
        p0=8;
440
        i3=r0;        // block
441
        i0=r1;        // s1
442
        i1=r2;        // s2
443
        r2=[fp+20];   // stride
444
        r2+=-8;
445
        m0=r2;
446

  
447

  
448
        LSETUP(.LS0,.LE0) LC0=P0;
449
        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
450

  
451
.LS0:   DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
452
        (R5,R4) = BYTEOP16M (R1:0,R3:2)    || R0 = [I0++M0] || R2 = [I1++M0];
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff