Guest User

Untitled

a guest
May 27th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. static void FUNC(transform_8x8_dc_add)(
  2. uint8_t *_dst, int16_t *coeffs, ptrdiff_t _stride) {
  3. int i, j;
  4. pixel *dst = (pixel *)_dst;
  5. int stride = _stride/sizeof(pixel);
  6. int shift = 14 - 8;
  7. int add = 1 << (shift - 1);
  8. int coeff = (((coeffs[0] + 1) >> 1) + add) >> shift;
  9.  
  10. for (j = 0; j < 8; j++) {
  11. for (i = 0; i < 8; i++) {
  12. dst[i+j*stride] = av_clip_pixel(dst[i+j*stride] + coeff);
  13. }
  14. }
  15. }
  16.  
  17.  
  18. cglobal hevc_put_transform8x8_dc_add_8, 3, 4, 3, dst, coeffs, stride, temp
  19. xor tempq, tempq
  20. mov tempw, [coeffsq]
  21. add tempd, 1
  22. shr tempd, 1
  23. add tempd, 32
  24. shr tempd, 6
  25. movd m0, tempd
  26. punpcklwd m0, m0
  27. pshufd m0, m0, 0
  28. pxor m1, m1
  29. xor tempq, tempq
  30. mov tempd, 8
  31. .loop
  32. movq m2, [dstq] ; load data from source
  33. punpcklbw m2, m1
  34. paddw m2, m0
  35. packuswb m2, m2
  36. movq [dstq], m2
  37. lea dstq, [dstq+strideq] ; dst += dststride
  38. dec tempd
  39. jnz .loop ; height loop
  40. RET
Advertisement
Add Comment
Please, Sign In to add comment