Lines Matching refs:DST
27 dst[x + y * BPS] = clip_8b(dst[x + y * BPS] + ((v) >> 3))
41 static void TransformOne(const int16_t* in, uint8_t* dst) {
60 // an input in [-2048, 2047] interval. We then need to add a dst value
76 dst += BPS;
81 static void TransformAC3(const int16_t* in, uint8_t* dst) {
95 static void TransformTwo(const int16_t* in, uint8_t* dst, int do_two) {
96 TransformOne(in, dst);
98 TransformOne(in + 16, dst + 4);
102 static void TransformUV(const int16_t* in, uint8_t* dst) {
103 VP8Transform(in + 0 * 16, dst, 1);
104 VP8Transform(in + 2 * 16, dst + 4 * BPS, 1);
107 static void TransformDC(const int16_t *in, uint8_t* dst) {
117 static void TransformDCUV(const int16_t* in, uint8_t* dst) {
118 if (in[0 * 16]) VP8TransformDC(in + 0 * 16, dst);
119 if (in[1 * 16]) VP8TransformDC(in + 1 * 16, dst + 4);
120 if (in[2 * 16]) VP8TransformDC(in + 2 * 16, dst + 4 * BPS);
121 if (in[3 * 16]) VP8TransformDC(in + 3 * 16, dst + 4 * BPS + 4);
161 #define DST(x, y) dst[(x) + (y) * BPS]
163 static WEBP_INLINE void TrueMotion(uint8_t *dst, int size) {
164 const uint8_t* top = dst - BPS;
168 const uint8_t* const clip = clip0 + dst[-1];
171 dst[x] = clip[top[x]];
173 dst += BPS;
176 static void TM4(uint8_t *dst) { TrueMotion(dst, 4); }
177 static void TM8uv(uint8_t *dst) { TrueMotion(dst, 8); }
178 static void TM16(uint8_t *dst) { TrueMotion(dst, 16); }
183 static void VE16(uint8_t *dst) { // vertical
186 memcpy(dst + j * BPS, dst - BPS, 16);
190 static void HE16(uint8_t *dst) { // horizontal
193 memset(dst, dst[-1], 16);
194 dst += BPS;
198 static WEBP_INLINE void Put16(int v, uint8_t* dst) {
201 memset(dst + j * BPS, v, 16);
205 static void DC16(uint8_t *dst) { // DC
209 DC += dst[-1 + j * BPS] + dst[j - BPS];
211 Put16(DC >> 5, dst);
214 static void DC16NoTop(uint8_t *dst) { // DC with top samples not available
218 DC += dst[-1 + j * BPS];
220 Put16(DC >> 4, dst);
223 static void DC16NoLeft(uint8_t *dst) { // DC with left samples not available
227 DC += dst[i - BPS];
229 Put16(DC >> 4, dst);
232 static void DC16NoTopLeft(uint8_t *dst) { // DC with no top and left samples
233 Put16(0x80, dst);
242 static void VE4(uint8_t *dst) { // vertical
243 const uint8_t* top = dst - BPS;
252 memcpy(dst + i * BPS, vals, sizeof(vals));
256 static void HE4(uint8_t *dst) { // horizontal
257 const int A = dst[-1 - BPS];
258 const int B = dst[-1];
259 const int C = dst[-1 + BPS];
260 const int D = dst[-1 + 2 * BPS];
261 const int E = dst[-1 + 3 * BPS];
262 *(uint32_t*)(dst + 0 * BPS) = 0x01010101U * AVG3(A, B, C);
263 *(uint32_t*)(dst + 1 * BPS) = 0x01010101U * AVG3(B, C, D);
264 *(uint32_t*)(dst + 2 * BPS) = 0x01010101U * AVG3(C, D, E);
265 *(uint32_t*)(dst + 3 * BPS) = 0x01010101U * AVG3(D, E, E);
268 static void DC4(uint8_t *dst) { // DC
271 for (i = 0; i < 4; ++i) dc += dst[i - BPS] + dst[-1 + i * BPS];
273 for (i = 0; i < 4; ++i) memset(dst + i * BPS, dc, 4);
276 static void RD4(uint8_t *dst) { // Down-right
277 const int I = dst[-1 + 0 * BPS];
278 const int J = dst[-1 + 1 * BPS];
279 const int K = dst[-1 + 2 * BPS];
280 const int L = dst[-1 + 3 * BPS];
281 const int X = dst[-1 - BPS];
282 const int A = dst[0 - BPS];
283 const int B = dst[1 - BPS];
284 const int C = dst[2 - BPS];
285 const int D = dst[3 - BPS];
286 DST(0, 3) = AVG3(J, K, L);
287 DST(0, 2) = DST(1, 3) = AVG3(I, J, K);
288 DST(0, 1) = DST(1, 2) = DST(2, 3) = AVG3(X, I, J);
289 DST(0, 0) = DST(1, 1) = DST(2, 2) = DST(3, 3) = AVG3(A, X, I);
290 DST(1, 0) = DST(2, 1) = DST(3, 2) = AVG3(B, A, X);
291 DST(2, 0) = DST(3, 1) = AVG3(C, B, A);
292 DST(3, 0) = AVG3(D, C, B);
295 static void LD4(uint8_t *dst) { // Down-Left
296 const int A = dst[0 - BPS];
297 const int B = dst[1 - BPS];
298 const int C = dst[2 - BPS];
299 const int D = dst[3 - BPS];
300 const int E = dst[4 - BPS];
301 const int F = dst[5 - BPS];
302 const int G = dst[6 - BPS];
303 const int H = dst[7 - BPS];
304 DST(0, 0) = AVG3(A, B, C);
305 DST(1, 0) = DST(0, 1) = AVG3(B, C, D);
306 DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E);
307 DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F);
308 DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G);
309 DST(3, 2) = DST(2, 3) = AVG3(F, G, H);
310 DST(3, 3) = AVG3(G, H, H);
313 static void VR4(uint8_t *dst) { // Vertical-Right
314 const int I = dst[-1 + 0 * BPS];
315 const int J = dst[-1 + 1 * BPS];
316 const int K = dst[-1 + 2 * BPS];
317 const int X = dst[-1 - BPS];
318 const int A = dst[0 - BPS];
319 const int B = dst[1 - BPS];
320 const int C = dst[2 - BPS];
321 const int D = dst[3 - BPS];
322 DST(0, 0) = DST(1, 2) = AVG2(X, A);
323 DST(1, 0) = DST(2, 2) = AVG2(A, B);
324 DST(2, 0) = DST(3, 2) = AVG2(B, C);
325 DST(3, 0) = AVG2(C, D);
327 DST(0, 3) = AVG3(K, J, I);
328 DST(0, 2) = AVG3(J, I, X);
329 DST(0, 1) = DST(1, 3) = AVG3(I, X, A);
330 DST(1, 1) = DST(2, 3) = AVG3(X, A, B);
331 DST(2, 1) = DST(3, 3) = AVG3(A, B, C);
332 DST(3, 1) = AVG3(B, C, D);
335 static void VL4(uint8_t *dst) { // Vertical-Left
336 const int A = dst[0 - BPS];
337 const int B = dst[1 - BPS];
338 const int C = dst[2 - BPS];
339 const int D = dst[3 - BPS];
340 const int E = dst[4 - BPS];
341 const int F = dst[5 - BPS];
342 const int G = dst[6 - BPS];
343 const int H = dst[7 - BPS];
344 DST(0, 0) = AVG2(A, B);
345 DST(1, 0) = DST(0, 2) = AVG2(B, C);
346 DST(2, 0) = DST(1, 2) = AVG2(C, D);
347 DST(3, 0) = DST(2, 2) = AVG2(D, E);
349 DST(0, 1) = AVG3(A, B, C);
350 DST(1, 1) = DST(0, 3) = AVG3(B, C, D);
351 DST(2, 1) = DST(1, 3) = AVG3(C, D, E);
352 DST(3, 1) = DST(2, 3) = AVG3(D, E, F);
353 DST(3, 2) = AVG3(E, F, G);
354 DST(3, 3) = AVG3(F, G, H);
357 static void HU4(uint8_t *dst) { // Horizontal-Up
358 const int I = dst[-1 + 0 * BPS];
359 const int J = dst[-1 + 1 * BPS];
360 const int K = dst[-1 + 2 * BPS];
361 const int L = dst[-1 + 3 * BPS];
362 DST(0, 0) = AVG2(I, J);
363 DST(2, 0) = DST(0, 1) = AVG2(J, K);
364 DST(2, 1) = DST(0, 2) = AVG2(K, L);
365 DST(1, 0) = AVG3(I, J, K);
366 DST(3, 0) = DST(1, 1) = AVG3(J, K, L);
367 DST(3, 1) = DST(1, 2) = AVG3(K, L, L);
368 DST(3, 2) = DST(2, 2) =
369 DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L;
372 static void HD4(uint8_t *dst) { // Horizontal-Down
373 const int I = dst[-1 + 0 * BPS];
374 const int J = dst[-1 + 1 * BPS];
375 const int K = dst[-1 + 2 * BPS];
376 const int L = dst[-1 + 3 * BPS];
377 const int X = dst[-1 - BPS];
378 const int A = dst[0 - BPS];
379 const int B = dst[1 - BPS];
380 const int C = dst[2 - BPS];
382 DST(0, 0) = DST(2, 1) = AVG2(I, X);
383 DST(0, 1) = DST(2, 2) = AVG2(J, I);
384 DST(0, 2) = DST(2, 3) = AVG2(K, J);
385 DST(0, 3) = AVG2(L, K);
387 DST(3, 0) = AVG3(A, B, C);
388 DST(2, 0) = AVG3(X, A, B);
389 DST(1, 0) = DST(3, 1) = AVG3(I, X, A);
390 DST(1, 1) = DST(3, 2) = AVG3(J, I, X);
391 DST(1, 2) = DST(3, 3) = AVG3(K, J, I);
392 DST(1, 3) = AVG3(L, K, J);
395 #undef DST
402 static void VE8uv(uint8_t *dst) { // vertical
405 memcpy(dst + j * BPS, dst - BPS, 8);
409 static void HE8uv(uint8_t *dst) { // horizontal
412 memset(dst, dst[-1], 8);
413 dst += BPS;
418 static WEBP_INLINE void Put8x8uv(uint8_t value, uint8_t* dst) {
421 memset(dst + j * BPS, value, 8);
425 static void DC8uv(uint8_t *dst) { // DC
429 dc0 += dst[i - BPS] + dst[-1 + i * BPS];
431 Put8x8uv(dc0 >> 4, dst);
434 static void DC8uvNoLeft(uint8_t *dst) { // DC with no left samples
438 dc0 += dst[i - BPS];
440 Put8x8uv(dc0 >> 3, dst);
443 static void DC8uvNoTop(uint8_t *dst) { // DC with no top samples
447 dc0 += dst[-1 + i * BPS];
449 Put8x8uv(dc0 >> 3, dst);
452 static void DC8uvNoTopLeft(uint8_t *dst) { // DC with nothing
453 Put8x8uv(0x80, dst);