FFmpeg
Loading...
Searching...
No Matches
pixblockdsp_vsx.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2002 Brian Foley
3 * Copyright (c) 2002 Dieter Shirley
4 * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
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#include "config.h"
24
27
29
30#include "pixblockdsp_vsx.h"
31
32static void get_pixels_vsx(int16_t *restrict block, const uint8_t *pixels,
33 ptrdiff_t stride)
34{
35 int i;
36 for (i = 0; i < 8; i++) {
37 vec_s16 shorts = vsx_ld_u8_s16(0, pixels);
38
39 vec_vsx_st(shorts, i * 16, block);
40
41 pixels += stride;
42 }
43}
44
45static void diff_pixels_vsx(int16_t *restrict block, const uint8_t *s1,
46 const uint8_t *s2, ptrdiff_t stride)
47{
48 int i;
49 vec_s16 shorts1, shorts2;
50 for (i = 0; i < 8; i++) {
51 shorts1 = vsx_ld_u8_s16(0, s1);
52 shorts2 = vsx_ld_u8_s16(0, s2);
53
54 shorts1 = vec_sub(shorts1, shorts2);
55
56 vec_vsx_st(shorts1, 0, block);
57
58 s1 += stride;
59 s2 += stride;
60 block += 8;
61 }
62}
63
65 unsigned high_bit_depth)
66{
67 c->diff_pixels = diff_pixels_vsx;
68
69 if (!high_bit_depth)
70 c->get_pixels = get_pixels_vsx;
71}
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
static int16_t block[64]
Definition dct.c:125
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
static void get_pixels_vsx(int16_t *restrict block, const uint8_t *pixels, ptrdiff_t stride)
static void diff_pixels_vsx(int16_t *restrict block, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride)
av_cold void ff_pixblockdsp_init_vsx(PixblockDSPContext *c, unsigned high_bit_depth)
#define stride
Contains misc utility macros and inline functions.
#define vec_s16
static double c[64]