Source code of Windows XP (NT5)
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.

73 lines
2.7 KiB

  1. typedef struct {
  2. __int64 put_buffer_64; //mmx bit-accumulation buffer
  3. INT32 put_buffer; /* current bit-accumulation buffer */
  4. int put_bits; /* # of bits now in it */
  5. int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
  6. } savable_state;
  7. /* This macro is to work around compilers with missing or broken
  8. * structure assignment. You'll need to fix this code if you have
  9. * such a compiler and you change MAX_COMPS_IN_SCAN.
  10. */
  11. //#ifndef NO_STRUCT_ASSIGN
  12. //#define ASSIGN_STATE(dest,src) ((dest) = (src))
  13. //#else
  14. // pull out the assignments to put_buffer and put_bits since they are implentation dependent
  15. #if MAX_COMPS_IN_SCAN == 4
  16. #define ASSIGN_STATE(dest,src) \
  17. ((dest).last_dc_val[0] = (src).last_dc_val[0], \
  18. (dest).last_dc_val[1] = (src).last_dc_val[1], \
  19. (dest).last_dc_val[2] = (src).last_dc_val[2], \
  20. (dest).last_dc_val[3] = (src).last_dc_val[3])
  21. /*((dest).put_buffer = (src).put_buffer, \
  22. (dest).put_bits = (src).put_bits, */
  23. #endif
  24. //#endif
  25. typedef struct {
  26. struct jpeg_entropy_encoder pub; /* public fields */
  27. savable_state saved; /* Bit buffer & DC state at start of MCU */
  28. /* These fields are NOT loaded into local working state. */
  29. unsigned int restarts_to_go; /* MCUs left in this restart interval */
  30. int next_restart_num; /* next restart number to write (0-7) */
  31. /* Pointers to derived tables (these workspaces have image lifespan) */
  32. c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
  33. c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
  34. #ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */
  35. long * dc_count_ptrs[NUM_HUFF_TBLS];
  36. long * ac_count_ptrs[NUM_HUFF_TBLS];
  37. #endif
  38. } huff_entropy_encoder;
  39. typedef huff_entropy_encoder * huff_entropy_ptr;
  40. /* Working state while writing an MCU.
  41. * This struct contains all the fields that are needed by subroutines.
  42. */
  43. typedef struct {
  44. // make the next two variables global for easy access in mmx version
  45. // JOCTET * next_output_byte; /* => next byte to write in buffer */
  46. // size_t free_in_buffer; /* # of byte spaces remaining in buffer */
  47. // savable_state cur; /* Current bit buffer & DC state */
  48. // flatten (instantiate) savable state here
  49. __int64 put_buffer_64; // mmx bit accumulation buffer
  50. INT32 put_buffer; /* current bit-accumulation buffer */
  51. int put_bits; /* # of bits now in it */
  52. int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
  53. j_compress_ptr cinfo; /* dump_buffer needs access to this */
  54. } working_state;
  55. //global vaiables
  56. __int64 put_buffer_64;
  57. // INT32 put_buffer;
  58. int put_bits;
  59. JOCTET * next_output_byte; /* => next byte to write in buffer */
  60. size_t free_in_buffer; /* # of byte spaces remaining in buffer */
  61. //boolean mmx_cpu=1;