aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bfin/hpeldsp_bfin.c
blob: 4fc66ed1b86a2d5788e07d59672c4655378ee933 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
 * BlackFin halfpel functions
 *
 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
 * Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.com>
 *
 * This file is part of Libav.
 *
 * Libav is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * Libav is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with Libav; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include <stddef.h>
#include <stdint.h>

#include "libavutil/attributes.h"
#include "libavcodec/hpeldsp.h"
#include "hpeldsp_bfin.h"

static void bfin_put_pixels8 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels8uc (block, pixels, pixels, line_size, line_size, h);
}

static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels8uc (block, pixels, pixels+1, line_size, line_size, h);
}

static void bfin_put_pixels8_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels8uc (block, pixels, pixels+line_size, line_size, line_size, h);
}

static void bfin_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h)
{
    ff_bfin_z_put_pixels8_xy2 (block,s0,line_size, line_size, h);
}

static void bfin_put_pixels16 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels16uc (block, pixels, pixels, line_size, line_size, h);
}

static void bfin_put_pixels16_x2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels16uc (block, pixels, pixels+1, line_size, line_size, h);
}

static void bfin_put_pixels16_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels16uc (block, pixels, pixels+line_size, line_size, line_size, h);
}

static void bfin_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h)
{
    ff_bfin_z_put_pixels16_xy2 (block,s0,line_size, line_size, h);
}

static void bfin_put_pixels8_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels, line_size, h);
}

static void bfin_put_pixels8_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+1, line_size, h);
}

static void bfin_put_pixels8_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+line_size, line_size, h);
}


static void bfin_put_pixels16_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels, line_size, h);
}

static void bfin_put_pixels16_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+1, line_size, h);
}

static void bfin_put_pixels16_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+line_size, line_size, h);
}

av_cold void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags)
{
    c->put_pixels_tab[0][0] = bfin_put_pixels16;
    c->put_pixels_tab[0][1] = bfin_put_pixels16_x2;
    c->put_pixels_tab[0][2] = bfin_put_pixels16_y2;
    c->put_pixels_tab[0][3] = bfin_put_pixels16_xy2;

    c->put_pixels_tab[1][0] = bfin_put_pixels8;
    c->put_pixels_tab[1][1] = bfin_put_pixels8_x2;
    c->put_pixels_tab[1][2] = bfin_put_pixels8_y2;
    c->put_pixels_tab[1][3] = bfin_put_pixels8_xy2;

    c->put_no_rnd_pixels_tab[1][0] = bfin_put_pixels8_nornd;
    c->put_no_rnd_pixels_tab[1][1] = bfin_put_pixels8_x2_nornd;
    c->put_no_rnd_pixels_tab[1][2] = bfin_put_pixels8_y2_nornd;
/*     c->put_no_rnd_pixels_tab[1][3] = ff_bfin_put_pixels8_xy2_nornd; */

    c->put_no_rnd_pixels_tab[0][0] = bfin_put_pixels16_nornd;
    c->put_no_rnd_pixels_tab[0][1] = bfin_put_pixels16_x2_nornd;
    c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_nornd;
/*     c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd; */
}