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.9KB

  1. /*
  2. * Vidvox Hap
  3. * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * Libav is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with Libav; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef AVCODEC_HAP_H
  22. #define AVCODEC_HAP_H
  23. #include <stdint.h>
  24. #include "libavutil/opt.h"
  25. #include "bytestream.h"
  26. #include "texturedsp.h"
  27. typedef struct HapContext {
  28. AVClass *class;
  29. TextureDSPContext dxtc;
  30. GetByteContext gbc;
  31. PutByteContext pbc;
  32. int section_type; /* Header type */
  33. int tex_rat; /* Compression ratio */
  34. const uint8_t *tex_data; /* Compressed texture */
  35. uint8_t *tex_buf; /* Uncompressed texture */
  36. size_t tex_size; /* Size of the compressed texture */
  37. uint8_t *snappied; /* Buffer interacting with snappy */
  38. size_t max_snappy; /* Maximum compressed size for snappy buffer */
  39. /* Pointer to the selected compress or decompress function */
  40. int (*tex_fun)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
  41. } HapContext;
  42. enum {
  43. HAP_FMT_RGBDXT1 = 0x0B,
  44. HAP_FMT_RGBADXT5 = 0x0E,
  45. HAP_FMT_YCOCGDXT5 = 0x0F,
  46. };
  47. enum {
  48. HAP_COMP_NONE = 0xA0,
  49. HAP_COMP_SNAPPY = 0xB0,
  50. HAP_COMP_COMPLEX = 0xC0,
  51. };
  52. #endif /* AVCODEC_HAP_H */