vc2enc_dwt.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2016 Open Broadcast Systems Ltd.
  3. * Author 2016 Rostislav Pehlivanov <atomnuker@gmail.com>
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg 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. * FFmpeg 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 FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef AVCODEC_VC2ENC_DWT_H
  22. #define AVCODEC_VC2ENC_DWT_H
  23. #include <stddef.h>
  24. #include <stdint.h>
  25. typedef int32_t dwtcoef;
  26. enum VC2TransformType {
  27. VC2_TRANSFORM_9_7 = 0, /* Deslauriers-Dubuc (9,7) */
  28. VC2_TRANSFORM_5_3 = 1, /* LeGall (5,3) */
  29. VC2_TRANSFORM_13_7 = 2, /* Deslauriers-Dubuc (13,7) */
  30. VC2_TRANSFORM_HAAR = 3, /* Haar without shift */
  31. VC2_TRANSFORM_HAAR_S = 4, /* Haar with 1 shift/lvl */
  32. VC2_TRANSFORM_FIDEL = 5, /* Fidelity filter */
  33. VC2_TRANSFORM_9_7_I = 6, /* Daubechies (9,7) */
  34. VC2_TRANSFORMS_NB
  35. };
  36. typedef struct VC2TransformContext {
  37. dwtcoef *buffer;
  38. int padding;
  39. void (*vc2_subband_dwt[VC2_TRANSFORMS_NB])(struct VC2TransformContext *t,
  40. dwtcoef *data, ptrdiff_t stride,
  41. int width, int height);
  42. } VC2TransformContext;
  43. int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_stride, int p_height,
  44. int slice_w, int slice_h);
  45. void ff_vc2enc_free_transforms(VC2TransformContext *t);
  46. #endif /* AVCODEC_VC2ENC_DWT_H */