opus_pvq.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2012 Andrew D'Addesio
  3. * Copyright (c) 2013-2014 Mozilla Corporation
  4. * Copyright (c) 2016 Rostislav Pehlivanov <atomnuker@gmail.com>
  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_OPUS_PVQ_H
  23. #define AVCODEC_OPUS_PVQ_H
  24. #include "opus_celt.h"
  25. #define QUANT_FN(name) uint32_t (name)(struct CeltPVQ *pvq, CeltFrame *f, \
  26. OpusRangeCoder *rc, const int band, float *X, \
  27. float *Y, int N, int b, uint32_t blocks, \
  28. float *lowband, int duration, \
  29. float *lowband_out, int level, float gain, \
  30. float *lowband_scratch, int fill)
  31. struct CeltPVQ {
  32. DECLARE_ALIGNED(32, int, qcoeff )[256];
  33. DECLARE_ALIGNED(32, float, hadamard_tmp)[256];
  34. float (*pvq_search)(float *X, int *y, int K, int N);
  35. QUANT_FN(*quant_band);
  36. };
  37. void ff_celt_pvq_init_x86(struct CeltPVQ *s);
  38. int ff_celt_pvq_init(struct CeltPVQ **pvq, int encode);
  39. void ff_celt_pvq_uninit(struct CeltPVQ **pvq);
  40. #endif /* AVCODEC_OPUS_PVQ_H */