hq_hqa.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Canopus HQ/HQA decoder
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg 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. * FFmpeg 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 FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVCODEC_HQ_HQA_H
  21. #define AVCODEC_HQ_HQA_H
  22. #include <stdint.h>
  23. #include "avcodec.h"
  24. #include "bytestream.h"
  25. #include "hq_hqadsp.h"
  26. #include "vlc.h"
  27. #define NUM_HQ_AC_ENTRIES 746
  28. #define NUM_HQ_PROFILES 22
  29. #define NUM_HQ_QUANTS 16
  30. typedef struct HQContext {
  31. AVCodecContext *avctx;
  32. HQDSPContext hqhqadsp;
  33. GetByteContext gbc;
  34. VLC hq_ac_vlc;
  35. VLC hqa_cbp_vlc;
  36. DECLARE_ALIGNED(16, int16_t, block)[12][64];
  37. } HQContext;
  38. typedef struct HQProfile {
  39. const uint8_t *perm_tab;
  40. int width, height;
  41. int num_slices;
  42. int tab_w, tab_h;
  43. } HQProfile;
  44. extern const int32_t * const ff_hq_quants[16][2][4];
  45. extern const HQProfile ff_hq_profile[NUM_HQ_PROFILES];
  46. extern const uint8_t ff_hq_ac_skips[NUM_HQ_AC_ENTRIES];
  47. extern const int16_t ff_hq_ac_syms [NUM_HQ_AC_ENTRIES];
  48. int ff_hq_init_vlcs(HQContext *c);
  49. #endif /* AVCODEC_HQ_HQA_H */