tsdecrypt reads and decrypts CSA encrypted incoming mpeg transport stream over UDP/RTP using code words obtained from OSCAM or similar CAM server. tsdecrypt communicates with CAM server using cs378x (camd35 over tcp) protocol or newcamd protocol. https://georgi.unixsol.org/programs/tsdecrypt/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parallel_064_mmx.h 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* FFdecsa -- fast decsa algorithm
  2. *
  3. * Copyright (C) 2007 Dark Avenger
  4. * 2003-2004 fatih89r
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program 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
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #include <mmintrin.h>
  21. #define MEMALIGN __attribute__((aligned(16)))
  22. union __u64 {
  23. unsigned int u[2];
  24. __m64 v;
  25. };
  26. static const union __u64 ff0 = {{0x00000000U, 0x00000000U}};
  27. static const union __u64 ff1 = {{0xffffffffU, 0xffffffffU}};
  28. typedef __m64 group;
  29. #define GROUP_PARALLELISM 64
  30. #define FF0() ff0.v
  31. #define FF1() ff1.v
  32. #define FFAND(a,b) _mm_and_si64((a),(b))
  33. #define FFOR(a,b) _mm_or_si64((a),(b))
  34. #define FFXOR(a,b) _mm_xor_si64((a),(b))
  35. #define FFNOT(a) _mm_xor_si64((a),FF1())
  36. /* 64 rows of 64 bits */
  37. static const union __u64 ff29 = {{0x29292929U, 0x29292929U}};
  38. static const union __u64 ff02 = {{0x02020202U, 0x02020202U}};
  39. static const union __u64 ff04 = {{0x04040404U, 0x04040404U}};
  40. static const union __u64 ff10 = {{0x10101010U, 0x10101010U}};
  41. static const union __u64 ff40 = {{0x40404040U, 0x40404040U}};
  42. static const union __u64 ff80 = {{0x80808080U, 0x80808080U}};
  43. typedef __m64 batch;
  44. #define BYTES_PER_BATCH 8
  45. #define B_FFAND(a,b) FFAND((a),(b))
  46. #define B_FFOR(a,b) FFOR((a),(b))
  47. #define B_FFXOR(a,b) FFXOR((a),(b))
  48. #define B_FFN_ALL_29() ff29.v
  49. #define B_FFN_ALL_02() ff02.v
  50. #define B_FFN_ALL_04() ff04.v
  51. #define B_FFN_ALL_10() ff10.v
  52. #define B_FFN_ALL_40() ff40.v
  53. #define B_FFN_ALL_80() ff80.v
  54. #define B_FFSH8L(a,n) _mm_slli_si64((a),(n))
  55. #define B_FFSH8R(a,n) _mm_srli_si64((a),(n))
  56. #define M_EMPTY() _mm_empty()
  57. #undef XOR_8_BY
  58. #define XOR_8_BY(d,s1,s2) do { *(__m64*)d = _mm_xor_si64(*(__m64*)(s1), *(__m64*)(s2)); } while(0)
  59. #undef XOREQ_8_BY
  60. #define XOREQ_8_BY(d,s) XOR_8_BY(d, d, s)
  61. #undef COPY_8_BY
  62. #define COPY_8_BY(d,s) do { *(__m64 *)(d) = *(__m64 *)(s); } while(0)
  63. #undef BEST_SPAN
  64. #define BEST_SPAN 8
  65. #undef XOR_BEST_BY
  66. #define XOR_BEST_BY(d,s1,s2) XOR_8_BY(d,s1,s2)
  67. #include "fftable.h"