scpr3.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * ScreenPressor version 3 decoder
  3. *
  4. * Copyright (c) 2017 Paul B Mahol
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef AVCODEC_SCPR3_H
  23. #define AVCODEC_SCPR3_H
  24. #include <stdio.h>
  25. #include <stdlib.h>
  26. #include <string.h>
  27. #include "avcodec.h"
  28. #include "internal.h"
  29. typedef struct PixelModel3 {
  30. uint8_t type;
  31. uint8_t length;
  32. uint8_t maxpos;
  33. uint8_t fshift;
  34. uint16_t size;
  35. uint32_t cntsum;
  36. uint8_t symbols[256];
  37. uint16_t freqs[256];
  38. uint16_t freqs1[256];
  39. uint16_t cnts[256];
  40. uint8_t dectab[32];
  41. } PixelModel3;
  42. typedef struct FillModel3 {
  43. uint32_t cntsum;
  44. uint16_t freqs[2][5];
  45. uint16_t cnts[5];
  46. uint8_t dectab[32];
  47. } FillModel3;
  48. typedef struct OpModel3 {
  49. uint32_t cntsum;
  50. uint16_t freqs[2][6];
  51. uint16_t cnts[6];
  52. uint8_t dectab[32];
  53. } OpModel3;
  54. typedef struct RunModel3 {
  55. uint32_t cntsum;
  56. uint16_t freqs[2][256];
  57. uint16_t cnts[256];
  58. uint8_t dectab[32];
  59. } RunModel3;
  60. typedef struct SxyModel3 {
  61. uint32_t cntsum;
  62. uint16_t freqs[2][16];
  63. uint16_t cnts[16];
  64. uint8_t dectab[32];
  65. } SxyModel3;
  66. typedef struct MVModel3 {
  67. uint32_t cntsum;
  68. uint16_t freqs[2][512];
  69. uint16_t cnts[512];
  70. uint8_t dectab[32];
  71. } MVModel3;
  72. #endif /* AVCODEC_SCPR3_H */