chroma_neon.h 3.79 KB
Newer Older
1 2 3 4 5
/*****************************************************************************
 * chroma_neon.h
 *****************************************************************************
 * Copyright (C) 2011 Rémi Denis-Courmont
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
6 7 8
 * This program 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
9 10 11 12
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
13 14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
15
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
16 17 18
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 20 21 22 23 24 25 26 27 28
 *****************************************************************************/

/* Planes must start on a 16-bytes boundary. Pitches must be multiples of 16
 * bytes even for subsampled components. */

/* Planar picture buffer.
 * Pitch corresponds to luminance component in bytes. Chrominance pitches are
 * inferred from the color subsampling ratio. */
struct yuv_planes
{
29 30
    void *y, *u, *v;
    size_t pitch;
31 32
};

33 34 35 36 37 38 39 40
/* Planar chroma buffers.
 * Pitch is in bytes. */
struct uv_planes
{
    void *u, *v;
    size_t pitch;
};

41 42 43
/* Packed picture buffer. Pitch is in bytes (_not_ pixels). */
struct yuv_pack
{
44 45
    void *yuv;
    size_t pitch;
46 47 48 49 50
};

/* I420 to YUYV conversion. */
void i420_yuyv_neon (struct yuv_pack *const out,
                     const struct yuv_planes *const in,
51
                     int width, int height) asm("i420_yuyv_neon");
52 53 54 55

/* I420 to UYVY conversion. */
void i420_uyvy_neon (struct yuv_pack *const out,
                     const struct yuv_planes *const in,
56
                     int width, int height) asm("i420_uyvy_neon");
57 58 59 60

/* I422 to YUYV conversion. */
void i422_yuyv_neon (struct yuv_pack *const out,
                     const struct yuv_planes *const in,
61
                     int width, int height) asm("i422_yuyv_neon");
62 63 64 65

/* I422 to UYVY conversion. */
void i422_uyvy_neon (struct yuv_pack *const out,
                     const struct yuv_planes *const in,
66
                     int width, int height) asm("i422_uyvy_neon");
67 68 69

/* YUYV to I422 conversion. */
void yuyv_i422_neon (struct yuv_planes *const out,
70 71
                     const struct yuv_pack *const in,
                     int width, int height) asm("yuyv_i422_neon");
72 73 74

/* UYVY to I422 conversion. */
void uyvy_i422_neon (struct yuv_planes *const out,
75 76
                     const struct yuv_pack *const in,
                     int width, int height) asm("uyvy_i422_neon");
77

78 79 80 81 82
/* Semiplanar to planar conversion. */
void deinterleave_chroma_neon (struct uv_planes *const out,
                               const struct yuv_pack *const in,
                               int width, int height) asm("deinterleave_chroma_neon");

83 84
/* I420 to RGBA conversion. */
void i420_rgb_neon (struct yuv_pack *const out,
85 86
                    const struct yuv_planes *const in,
                    int width, int height) asm("i420_rgb_neon");
87

88 89 90 91 92
/* I420 to RV16 conversion. */
void i420_rv16_neon (struct yuv_pack *const out,
                     const struct yuv_planes *const in,
                     int width, int height) asm("i420_rv16_neon");

93 94
/* NV21 to RGBA conversion. */
void nv21_rgb_neon (struct yuv_pack *const out,
95 96
                    const struct yuv_planes *const in,
                    int width, int height) asm("nv21_rgb_neon");
97 98 99

/* NV12 to RGBA conversion. */
void nv12_rgb_neon (struct yuv_pack *const out,
100 101
                    const struct yuv_planes *const in,
                    int width, int height) asm("nv12_rgb_neon");