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.

66 lines
1.5KB

  1. /*
  2. * Canopus HQX decoder
  3. *
  4. * This file is part of Libav.
  5. *
  6. * Libav is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * Libav 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 GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with Libav; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVCODEC_HQX_H
  21. #define AVCODEC_HQX_H
  22. #include <stdint.h>
  23. #include "libavutil/mem.h"
  24. #include "get_bits.h"
  25. enum HQXACMode {
  26. HQX_AC_Q0 = 0,
  27. HQX_AC_Q8,
  28. HQX_AC_Q16,
  29. HQX_AC_Q32,
  30. HQX_AC_Q64,
  31. HQX_AC_Q128,
  32. NUM_HQX_AC
  33. };
  34. typedef struct HQXLUT {
  35. int16_t lev;
  36. uint8_t run;
  37. int8_t bits;
  38. } HQXLUT;
  39. typedef struct HQXAC {
  40. int lut_bits, extra_bits;
  41. const HQXLUT *lut;
  42. } HQXAC;
  43. typedef struct HQXContext {
  44. int format, dcb, width, height;
  45. int interlaced;
  46. DECLARE_ALIGNED(16, int16_t, block)[16][64];
  47. VLC cbp_vlc;
  48. VLC dc_vlc[3];
  49. } HQXContext;
  50. #define HQX_DC_VLC_BITS 9
  51. extern const HQXAC ff_hqx_ac[NUM_HQX_AC];
  52. int ff_hqx_init_vlcs(HQXContext *ctx);
  53. #endif /* AVCODEC_HQX_H */