home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser 2002 January / STC_CD_01_2002.iso / APP / ANIPL218 / PROG / SLB / OPENDIVX / README < prev   
Text File  |  2001-01-19  |  3KB  |  127 lines

  1.  
  2.             LIBDIVXDECORE FOR LINUX
  3.             -----------------------
  4.  
  5. The "decore" project is now available for linux in the form of a standard library.
  6.  
  7. The libdivxdecore library will allow any linux developer to take advantage of the OpenDivX decoding engine through an easy-to-use API and quickly enable any application with OpenDivX decoding.
  8.  
  9. The library is provided as a tar.gz source package, and has no dependencies except that you'll need autoconf, automake and libtool installed in order to compile it.
  10.  
  11.  
  12. HOW TO INSTALL:
  13. ---------------
  14.  
  15. Run succesively:
  16.  
  17. ./configure [with the options you want, see ./configure --help]
  18. make
  19. make install (as root if needed)
  20.  
  21.  
  22. FILES THAT WILL BE INSTALLED:
  23. -----------------------------
  24.  
  25. After the installation you will have on your system:
  26.  
  27. * In $prefix/lib
  28.  
  29. libdivxdecore.so
  30. libdivxdecore.a
  31. libdivxdecore.la
  32.  
  33. * In $prefix/include/divx
  34.  
  35. decore.h
  36.  
  37. Where prefix is /usr/local by default
  38.  
  39.  
  40. HOW TO USE THE DECORE LIBRARY:
  41. ------------------------------
  42.  
  43. The decore.h header has only one function:
  44.  
  45. int decore(unsigned long handle,
  46.        unsigned long dec_opt,
  47.            void *param1, 
  48.        void *param2);
  49.                                                 
  50. This single function will be the entry point for all your calls. 
  51. In addition to that decore.h defines 3 structures:
  52.  
  53. typedef struct _DEC_PARAM_
  54. {
  55.         int x_dim; // x dimension of the frames to be decoded
  56.         int y_dim; // y dimension of the frames to be decoded
  57.         unsigned long color_depth;
  58. } DEC_PARAM;
  59.  
  60. typedef struct _DEC_FRAME_
  61. {
  62.         void *bmp;       // the 24-bit decoded bitmap 
  63.         void *bitstream; // the decoder buffer
  64.         long length;     // the lenght of the decoder stream
  65.         int render_flag;
  66. } DEC_FRAME;
  67.  
  68. typedef struct _DEC_SET_
  69. {
  70.         int postproc_level; // valid interval are [0..100]
  71. } DEC_SET;
  72.  
  73.  
  74. The library will output the video data in YUV12 format (411 planar).
  75. Using all that, a typical decore session will look like:
  76.  
  77. #define MY_APP_ID 0x12345
  78.  
  79.       DEC_PARAM dec_param;
  80.       DEC_SET   dec_set;
  81.       DEC_FRAME dec_frame;
  82.  
  83.       /*
  84.        * Init the decore
  85.        */ 
  86.  
  87.       dec_param.x_dim = width_of_the_video; 
  88.       dec_param.y_dim = height_of_the_video;
  89.  
  90.       decore(MY_APP_ID, DEC_OPT_INIT, &dec_param, NULL);
  91.  
  92.       /*
  93.        * Set the postprocessing level
  94.        */
  95.  
  96.       dec_set.postproc_level = use_or_not_postprocessing;
  97.       decore(MY_APP_ID, DEC_OPT_SETPP, &dec_set, NULL);
  98.  
  99.       /*
  100.        * decode one frame
  101.        */
  102.  
  103.        dec_frame.length      = size_of_in_buffer;
  104.        dec_frame.bitstream   = in_buffer;
  105.        dec_frame.bmp         = (void *) out_buffer;
  106.        dec_frame.render_flag = 1;
  107.  
  108.        decore(MY_APP_ID, 0, &dec_frame, NULL);
  109.   
  110.  
  111. Where out_buffer is:
  112.  
  113. char *out_buffer[3], an array of tree pointers to the Y, U and V planes.
  114.  
  115. And don't forget to put 
  116.  
  117. #include <divx/decore.h>
  118.  
  119. somewhere, and to link with -ldivxdecore
  120.  
  121. That's all!
  122. Enjoy,
  123.  
  124. roy204 for ProjectMayo.
  125.  
  126.  
  127.