FFmpeg
Loading...
Searching...
No Matches
pixelutils_msa.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <stddef.h>
22#include <stdint.h>
23
24#include "generic_macros_msa.h"
25#include "pixelutils.h"
26
27int ff_pixelutils_sad16_msa(const uint8_t *src, ptrdiff_t src_stride,
28 const uint8_t *ref, ptrdiff_t ref_stride)
29{
30 int32_t ht_cnt = 16/4;
31 v16u8 src0, src1, ref0, ref1;
32 v8u16 sad = { 0 };
33
34 for (; ht_cnt--; ) {
35 LD_UB2(src, src_stride, src0, src1);
36 src += (2 * src_stride);
37 LD_UB2(ref, ref_stride, ref0, ref1);
38 ref += (2 * ref_stride);
39 sad += SAD_UB2_UH(src0, src1, ref0, ref1);
40
41 LD_UB2(src, src_stride, src0, src1);
42 src += (2 * src_stride);
43 LD_UB2(ref, ref_stride, ref0, ref1);
44 ref += (2 * ref_stride);
45 sad += SAD_UB2_UH(src0, src1, ref0, ref1);
46 }
47 return (HADD_UH_U32(sad));
48}
int32_t
#define LD_UB2(...)
#define HADD_UH_U32(in)
#define SAD_UB2_UH(in0, in1, ref0, ref1)
int ff_pixelutils_sad16_msa(const uint8_t *src, ptrdiff_t src_stride, const uint8_t *ref, ptrdiff_t ref_stride)
#define src1
Definition h264pred.c:141
#define src0
Definition h264pred.c:140
#define src
Definition vp8dsp.c:248
static int ref[MAX_W *MAX_W]