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.

how_to_compile.txt 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. -------
  2. FFdecsa
  3. -------
  4. Compiling is as easy as running a make command, if you have gcc and are
  5. using a little endian machine. 64 bit machines have not been tested but
  6. may work with little or no changes; big endian machines will certainly
  7. give incorrect results (read the technical_background.txt to know where
  8. the problem is).
  9. Before compiling you could edit the Makefile to tweak compiler flags for
  10. optimal performance. If you want to play with different bit-grouping
  11. strategies you have to edit FFdecsa_DBG.c and change the "our choice"
  12. definition. This is highly critical for performance.
  13. After compilation run the FFdecsa_test application. It will test correct
  14. decryption and print the meausered speed (use "nice --19 ./FFdecsa_test"
  15. on an idle machine for better results). Or just use "make test".
  16. gcc >=3.3.3 is highly recommended. Older versions could give performance
  17. problems.
  18. icc is currently unusable. In the initial phases of development of
  19. FFdecsa icc was able to compile the code and gave interesting speed
  20. results when using the 8charA grouping mode (array of 8 characters are
  21. automatically manipulated through MMX instructions). At some point the
  22. code began to work incorrectly because of a compiler bug (but I found a
  23. workaround). Then, the performance dropped with no reason; I found a
  24. workaround by adding an unused variable (alignment problem, grep for icc
  25. in the code to see where it happens). Then, with the introduction of
  26. group modes based on intrinsics, gcc was finally able to go beyond the
  27. speed record originally set by icc. Additional code tweaks added more
  28. speed to gcc, while icc started to segfault on compilation (both version
  29. 7 and 8). In conclusion, icc is bugged and this code is too hard for it.
  30. gcc on the other hand is great. I tried to inspect generated assembler
  31. to find weak spots, and the generated code is very good indeed.
  32. Note: the code can be compiled with gcc or g++. g++ is 3% faster for
  33. some reason.
  34. You should not get any errors or warnings. I only get two "inlining
  35. failed" warnings on two functions I asked to be inlined but gcc doesn't
  36. want to inline.
  37. The build process creates additional temp files by running grep
  38. commands. This is how debugging output is handled. All the lines
  39. containing DBG are removed and the temp file is compiled (so the line
  40. numbers change between temp and original files). Don't edit the temp
  41. files, they will be overwritten. If you don't remove the DBG lines (for
  42. example, by changing "grep -v DBG" into "grep -v aaDBG" in Makefile) a
  43. lot of output will be generated. This is useful to understand what's
  44. wrong when the FFdecsa_test is failing. I included a reference "known
  45. good" output in the debug_output directory. Extra debug output is
  46. commented out in the code.
  47. The debug output functionality could be... bugged. This is because I
  48. tested everything using hard coded int grouping mode and then
  49. generalized the debug output to abstract grouping modes. A bug where 4
  50. bytes are printed instead of 8 could be present somewhere. I think it
  51. isn't, but you've been warned.
  52. This code was only tried on Linux.
  53. It should work on Windows or other platforms, but you may encounter
  54. problems related to the compiler quality. If you want to try, begin with
  55. the int grouping mode. It is only 30% slower then the best (MMX) and it
  56. should be easily portable because no intrinsics are used. I'm
  57. particularly interested in hearing what kind of performance can be
  58. obtained on x86_64 processors in int, long long int, mmx, 2mmx, sse
  59. modes.
  60. As a reference, here are the results I get on an Athlon XP 2400+ (this
  61. processor runs at 2000MHz); other processors belonging to the Athlon XP
  62. architecture, including Durons, should have the same speed per MHz.
  63. Cache size and bus speed don't matter.
  64. CPU: AMD Athlon XP 2400+
  65. Compiler: g++ (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7))
  66. Flags: -O3 -march=athlon-xp -fexpensive-optimizations -funroll-loops
  67. --param max-unrolled-insns=500
  68. grouping mode speed (Mbit/s) notes
  69. ---------------------------------------------------------------------
  70. PARALLEL_32_4CHAR 14
  71. PARALLEL_32_4CHARA 12
  72. PARALLEL_32_INT 125 very good and very portable
  73. PARALLEL_64_8CHAR 17
  74. PARALLEL_64_8CHARA 15 needs a vectorizing compiler
  75. PARALLEL_64_2INT 75 x86 has too few registers
  76. PARALLEL_64_LONG 97 try this on x86_64
  77. PARALLEL_64_MMX 165 the best
  78. PARALLEL_128_16CHAR 6
  79. PARALLEL_128_16CHARA 7
  80. PARALLEL_128_4INT 69
  81. PARALLEL_128_2LONG 52
  82. PARALLEL_128_2MMX 36 slower than expected
  83. PARALLEL_128_SSE 156 just slower than 64_MMX
  84. Best speeds are obtained with native data types: int, mmx, sse (this
  85. could be a compiler artifact).
  86. 64 bit processors should try 64_LONG.
  87. Vectorizing compilers should like *CHARA.
  88. 64_MMX is faster than 128_SSE on the Athlon; perhaps SSE instruction are
  89. internally split into 64 bit chunks. Could be different on x86_64 or
  90. Intel processors.
  91. 128_SSE has a 64 bit (MMX) batch type because SSE has no shifting
  92. instructions, they are only available on SSE2. As the Athlon XP doesn't
  93. support SSE2, I couldn't experiment with that.