annotate bfin/dsputil_bfin.c @ 7097:206ad3177459 libavcodec

Cosmetics
author vitor
date Sun, 22 Jun 2008 20:10:16 +0000
parents f7cbb7733146
children eebc7209c47f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
1 /*
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
2 * BlackFin DSPUTILS
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
3 *
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
4 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
5 * Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.com>
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
6 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3728
diff changeset
7 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3728
diff changeset
8 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3728
diff changeset
9 * FFmpeg is free software; you can redistribute it and/or
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
10 * modify it under the terms of the GNU Lesser General Public
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
11 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3728
diff changeset
12 * version 2.1 of the License, or (at your option) any later version.
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
13 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3728
diff changeset
14 * FFmpeg is distributed in the hope that it will be useful,
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
17 * Lesser General Public License for more details.
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
18 *
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
19 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3728
diff changeset
20 * License along with FFmpeg; if not, write to the Free Software
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
22 */
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
23
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
24 #include <unistd.h>
6763
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 6362
diff changeset
25 #include "libavcodec/avcodec.h"
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 6362
diff changeset
26 #include "libavcodec/dsputil.h"
5180
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
27 #include "dsputil_bfin.h"
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
28
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
29 int off;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
30
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
31
5180
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
32 extern void ff_bfin_idct (DCTELEM *block) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
33 extern void ff_bfin_fdct (DCTELEM *block) attribute_l1_text;
5776
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
34 extern void ff_bfin_vp3_idct (DCTELEM *block);
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
35 extern void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block);
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
36 extern void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block);
5180
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
37 extern void ff_bfin_add_pixels_clamped (DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
38 extern void ff_bfin_put_pixels_clamped (DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
39 extern void ff_bfin_diff_pixels (DCTELEM *block, uint8_t *s1, uint8_t *s2, int stride) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
40 extern void ff_bfin_get_pixels (DCTELEM *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
41 extern int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
42 extern int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
43 extern int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
44
5180
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
45 extern void ff_bfin_z_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
46 extern void ff_bfin_z_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
47 extern void ff_bfin_put_pixels16_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
48 extern void ff_bfin_put_pixels8_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
49
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
50
5180
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
51 extern int ff_bfin_pix_sum (uint8_t *p, int stride) attribute_l1_text;
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
52
5180
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
53 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) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
54 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) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
55 extern void ff_bfin_put_pixels8uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
56 extern void ff_bfin_put_pixels16uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
57
5180
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
58 extern int ff_bfin_sse4 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
59 extern int ff_bfin_sse8 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
3d6f2ff62910 renaming L1CODE to attribute_l1_text, which is defined in dsputil_bfin.h
mhoffman
parents: 5130
diff changeset
60 extern int ff_bfin_sse16 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
61
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
62
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
63 static void bfin_idct_add (uint8_t *dest, int line_size, DCTELEM *block)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
64 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
65 ff_bfin_idct (block);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
66 ff_bfin_add_pixels_clamped (block, dest, line_size);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
67 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
68
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
69 static void bfin_idct_put (uint8_t *dest, int line_size, DCTELEM *block)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
70 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
71 ff_bfin_idct (block);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
72 ff_bfin_put_pixels_clamped (block, dest, line_size);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
73 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
74
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
75
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
76 static void bfin_clear_blocks (DCTELEM *blocks)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
77 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
78 // This is just a simple memset.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
79 //
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
80 asm("P0=192; "
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
81 "I0=%0; "
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
82 "R0=0; "
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
83 "LSETUP(clear_blocks_blkfn_lab,clear_blocks_blkfn_lab)LC0=P0;"
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
84 "clear_blocks_blkfn_lab:"
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
85 "[I0++]=R0;"
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
86 ::"a" (blocks):"P0","I0","R0");
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
87 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
88
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
89
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
90
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
91 static void bfin_put_pixels8 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
92 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
93 ff_bfin_put_pixels8uc (block, pixels, pixels, line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
94 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
95
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
96 static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
97 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
98 ff_bfin_put_pixels8uc (block, pixels, pixels+1, line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
99 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
100
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
101 static void bfin_put_pixels8_y2 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
102 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
103 ff_bfin_put_pixels8uc (block, pixels, pixels+line_size, line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
104 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
105
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
106 static void bfin_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
107 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
108 ff_bfin_z_put_pixels8_xy2 (block,s0,line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
109 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
110
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
111 static void bfin_put_pixels16 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
112 {
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
113 ff_bfin_put_pixels16uc (block, pixels, pixels, line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
114 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
115
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
116 static void bfin_put_pixels16_x2 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
117 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
118 ff_bfin_put_pixels16uc (block, pixels, pixels+1, line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
119 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
120
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
121 static void bfin_put_pixels16_y2 (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
122 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
123 ff_bfin_put_pixels16uc (block, pixels, pixels+line_size, line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
124 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
125
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
126 static void bfin_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
127 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
128 ff_bfin_z_put_pixels16_xy2 (block,s0,line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
129 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
130
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
131 void bfin_put_pixels8_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
132 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
133 ff_bfin_put_pixels8uc_nornd (block, pixels, pixels, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
134 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
135
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
136 static void bfin_put_pixels8_x2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
137 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
138 ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+1, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
139 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
140
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
141 static void bfin_put_pixels8_y2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
142 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
143 ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
144 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
145
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
146
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
147 void bfin_put_pixels16_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
148 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
149 ff_bfin_put_pixels16uc_nornd (block, pixels, pixels, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
150 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
151
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
152 static void bfin_put_pixels16_x2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
153 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
154 ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+1, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
155 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
156
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
157 static void bfin_put_pixels16_y2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
158 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
159 ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+line_size, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
160 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
161
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
162 static int bfin_pix_abs16 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
163 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
164 return ff_bfin_z_sad16x16 (blk1,blk2,line_size,line_size,h);
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
165 }
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
166
5690
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
167 static int bfin_vsad_intra16 (void *c, uint8_t *blk1, uint8_t *dummy, int stride, int h) {
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
168 return ff_bfin_z_sad16x16 (blk1,blk1+stride,stride<<1,stride<<1,h);
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
169 }
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
170
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
171 static int bfin_vsad (void *c, uint8_t *blk1, uint8_t *blk2, int stride, int h) {
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
172 return ff_bfin_z_sad16x16 (blk1,blk1+stride,stride<<1,stride<<1,h)
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
173 + ff_bfin_z_sad16x16 (blk2,blk2+stride,stride<<1,stride<<1,h);
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
174 }
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
175
6362
78aa57eba353 FLAT objects cannot have multiple sections, so using the L1 attributes breaks
diego
parents: 5776
diff changeset
176 static uint8_t vtmp_blk[256] attribute_l1_data_b;
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
177
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
178 static int bfin_pix_abs16_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
179 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
180 ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+1, 16, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
181 return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
182 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
183
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
184 static int bfin_pix_abs16_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
185 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
186 ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+line_size, 16, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
187 return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
188 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
189
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
190 static int bfin_pix_abs16_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
191 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
192 ff_bfin_z_put_pixels16_xy2 (vtmp_blk, blk2, 16, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
193 return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
194 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
195
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
196 static int bfin_pix_abs8 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
197 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
198 return ff_bfin_z_sad8x8 (blk1,blk2,line_size,line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
199 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
200
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
201 static int bfin_pix_abs8_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
202 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
203 ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+1, 8, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
204 return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
205 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
206
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
207 static int bfin_pix_abs8_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
208 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
209 ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+line_size, 8, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
210 return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
211 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
212
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
213 static int bfin_pix_abs8_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
214 {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
215 ff_bfin_z_put_pixels8_xy2 (vtmp_blk, blk2, 8, line_size, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
216 return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
217 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
218
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
219
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
220 /*
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
221 decoder optimization
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
222 start on 2/11 100 frames of 352x240@25 compiled with no optimization -g debugging
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
223 9.824s ~ 2.44x off
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
224 6.360s ~ 1.58x off with -O2
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
225 5.740s ~ 1.43x off with idcts
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
226
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
227 2.64s 2/20 same sman.mp4 decode only
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
228
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
229 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
230
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
231 void dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx )
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
232 {
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
233 c->get_pixels = ff_bfin_get_pixels;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
234 c->diff_pixels = ff_bfin_diff_pixels;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
235 c->put_pixels_clamped = ff_bfin_put_pixels_clamped;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
236 c->add_pixels_clamped = ff_bfin_add_pixels_clamped;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
237
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
238 c->clear_blocks = bfin_clear_blocks;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
239 c->pix_sum = ff_bfin_pix_sum;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
240 c->pix_norm1 = ff_bfin_pix_norm1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
241
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
242 c->sad[0] = bfin_pix_abs16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
243 c->sad[1] = bfin_pix_abs8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
244
5690
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
245 c->vsad[0] = bfin_vsad;
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
246 c->vsad[4] = bfin_vsad_intra16;
930587f0259d blackfin vsad primitives
mhoffman
parents: 5541
diff changeset
247
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
248 /* TODO [0] 16 [1] 8 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
249 c->pix_abs[0][0] = bfin_pix_abs16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
250 c->pix_abs[0][1] = bfin_pix_abs16_x2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
251 c->pix_abs[0][2] = bfin_pix_abs16_y2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
252 c->pix_abs[0][3] = bfin_pix_abs16_xy2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
253
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
254 c->pix_abs[1][0] = bfin_pix_abs8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
255 c->pix_abs[1][1] = bfin_pix_abs8_x2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
256 c->pix_abs[1][2] = bfin_pix_abs8_y2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
257 c->pix_abs[1][3] = bfin_pix_abs8_xy2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
258
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
259
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
260 c->sse[0] = ff_bfin_sse16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
261 c->sse[1] = ff_bfin_sse8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
262 c->sse[2] = ff_bfin_sse4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
263
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
264
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
265 /**
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
266 * Halfpel motion compensation with rounding (a+b+1)>>1.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
267 * This is an array[4][4] of motion compensation functions for 4
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
268 * horizontal blocksizes (8,16) and the 4 halfpel positions
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
269 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
270 * @param block destination where the result is stored
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
271 * @param pixels source
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
272 * @param line_size number of bytes in a horizontal line of block
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
273 * @param h height
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
274 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
275
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
276 c->put_pixels_tab[0][0] = bfin_put_pixels16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
277 c->put_pixels_tab[0][1] = bfin_put_pixels16_x2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
278 c->put_pixels_tab[0][2] = bfin_put_pixels16_y2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
279 c->put_pixels_tab[0][3] = bfin_put_pixels16_xy2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
280
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
281 c->put_pixels_tab[1][0] = bfin_put_pixels8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
282 c->put_pixels_tab[1][1] = bfin_put_pixels8_x2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
283 c->put_pixels_tab[1][2] = bfin_put_pixels8_y2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
284 c->put_pixels_tab[1][3] = bfin_put_pixels8_xy2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
285
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
286 c->put_no_rnd_pixels_tab[1][0] = bfin_put_pixels8_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
287 c->put_no_rnd_pixels_tab[1][1] = bfin_put_pixels8_x2_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
288 c->put_no_rnd_pixels_tab[1][2] = bfin_put_pixels8_y2_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
289 c->put_no_rnd_pixels_tab[1][3] = ff_bfin_put_pixels8_xy2_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
290
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
291 c->put_no_rnd_pixels_tab[0][0] = bfin_put_pixels16_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
292 c->put_no_rnd_pixels_tab[0][1] = bfin_put_pixels16_x2_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
293 c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
294 c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
295
5130
bd2133a6973c Blackfin IDCT has no special permutation it uses normal order
mhoffman
parents: 5010
diff changeset
296 c->idct_permutation_type = FF_NO_IDCT_PERM;
5541
6c385356e61f special handling for vp3 idct, use the c reference
mhoffman
parents: 5181
diff changeset
297 c->fdct = ff_bfin_fdct;
5776
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
298 if (avctx->idct_algo==FF_IDCT_VP3) {
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
299 c->idct = ff_bfin_vp3_idct;
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
300 c->idct_add = ff_bfin_vp3_idct_add;
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
301 c->idct_put = ff_bfin_vp3_idct_put;
73ec16dbcbc1 blackfin optimized vp3 transform and infastructure for idct
mhoffman
parents: 5690
diff changeset
302 } else {
5541
6c385356e61f special handling for vp3 idct, use the c reference
mhoffman
parents: 5181
diff changeset
303 c->idct = ff_bfin_idct;
6c385356e61f special handling for vp3 idct, use the c reference
mhoffman
parents: 5181
diff changeset
304 c->idct_add = bfin_idct_add;
6c385356e61f special handling for vp3 idct, use the c reference
mhoffman
parents: 5181
diff changeset
305 c->idct_put = bfin_idct_put;
6c385356e61f special handling for vp3 idct, use the c reference
mhoffman
parents: 5181
diff changeset
306 }
3728
4d346abd723c ADI Blackfin optimizations
diego
parents:
diff changeset
307 }
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
308
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
309
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents: 3947
diff changeset
310