FFmpeg  4.0
blockdsp_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 
22 #include "blockdsp_mips.h"
23 
25  int32_t src_stride, int32_t height)
26 {
27  int32_t cnt;
28  uint64_t dst0;
29  v16u8 val0;
30 
31  val0 = (v16u8) __msa_fill_b(val);
32  dst0 = __msa_copy_u_d((v2i64) val0, 0);
33 
34  for (cnt = (height >> 2); cnt--;) {
35  SD4(dst0, dst0, dst0, dst0, src, src_stride);
36  src += (4 * src_stride);
37  }
38 }
39 
41  int32_t src_stride, int32_t height)
42 {
43  int32_t cnt;
44  v16u8 val0;
45 
46  val0 = (v16u8) __msa_fill_b(val);
47 
48  for (cnt = (height >> 3); cnt--;) {
49  ST_UB8(val0, val0, val0, val0, val0, val0, val0, val0, src, src_stride);
50  src += (8 * src_stride);
51  }
52 }
53 
56 {
57  int8_t cnt;
58  v16u8 zero = { 0 };
59 
60  for (cnt = (height / 2); cnt--;) {
61  ST_UB(zero, src);
62  src += stride;
63  ST_UB(zero, src);
64  src += stride;
65  }
66 }
67 
69 {
70  copy_8bit_value_width16_msa(src, val, stride, height);
71 }
72 
74 {
75  copy_8bit_value_width8_msa(src, val, stride, height);
76 }
77 
78 void ff_clear_block_msa(int16_t *block)
79 {
80  memset_zero_16width_msa((uint8_t *) block, 16, 8);
81 }
82 
83 void ff_clear_blocks_msa(int16_t *block)
84 {
85  memset_zero_16width_msa((uint8_t *) block, 16, 8 * 6);
86 }
const char const char void * val
Definition: avisynth_c.h:771
#define src
Definition: vp8dsp.c:254
int stride
Definition: mace.c:144
static int16_t block[64]
Definition: dct.c:115
static void copy_8bit_value_width8_msa(uint8_t *src, uint8_t val, int32_t src_stride, int32_t height)
Definition: blockdsp_msa.c:24
uint8_t
#define height
#define zero
Definition: regdef.h:64
static void memset_zero_16width_msa(uint8_t *src, int32_t stride, int32_t height)
Definition: blockdsp_msa.c:54
void ff_fill_block16_msa(uint8_t *src, uint8_t val, ptrdiff_t stride, int height)
Definition: blockdsp_msa.c:68
int32_t
#define ST_UB(...)
#define ST_UB8(...)
void ff_clear_block_msa(int16_t *block)
Definition: blockdsp_msa.c:78
#define SD4(in0, in1, in2, in3, pdst, stride)
void ff_fill_block8_msa(uint8_t *src, uint8_t val, ptrdiff_t stride, int height)
Definition: blockdsp_msa.c:73
void ff_clear_blocks_msa(int16_t *block)
Definition: blockdsp_msa.c:83
static void copy_8bit_value_width16_msa(uint8_t *src, uint8_t val, int32_t src_stride, int32_t height)
Definition: blockdsp_msa.c:40