MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / init_block

Function init_block

libavcodec/tests/dct.c:128–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126DECLARE_ALIGNED(8, static int16_t, block1)[64];
127
128static void init_block(int16_t block[64], int test, int is_idct, AVLFG *prng, int vals)
129{
130 int i, j;
131
132 memset(block, 0, 64 * sizeof(*block));
133
134 switch (test) {
135 case 0:
136 for (i = 0; i < 64; i++)
137 block[i] = (av_lfg_get(prng) % (2*vals)) -vals;
138 if (is_idct) {
139 ff_ref_fdct(block);
140 for (i = 0; i < 64; i++)
141 block[i] >>= 3;
142 }
143 break;
144 case 1:
145 j = av_lfg_get(prng) % 10 + 1;
146 for (i = 0; i < j; i++) {
147 int idx = av_lfg_get(prng) % 64;
148 block[idx] = av_lfg_get(prng) % (2*vals) -vals;
149 }
150 break;
151 case 2:
152 block[ 0] = av_lfg_get(prng) % (16*vals) - (8*vals);
153 block[63] = (block[0] & 1) ^ 1;
154 break;
155 }
156}
157
158static void permute(int16_t dst[64], const int16_t src[64],
159 enum idct_permutation_type perm_type)

Callers 1

dct_errorFunction · 0.85

Calls 2

av_lfg_getFunction · 0.85
ff_ref_fdctFunction · 0.85

Tested by

no test coverage detected