summaryrefslogtreecommitdiff
path: root/libavcodec/opus_pvq.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-03 22:47:58 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-05 02:15:43 +0200
commitc095358289559d91932bd2ea48f90848ecee1f80 (patch)
treec36a638e81c8f2caaa6579263e4b47e73ad0c524 /libavcodec/opus_pvq.c
parent81b927a53bafd51b3874ae7c36c6948cc632c267 (diff)
downloadffmpeg-c095358289559d91932bd2ea48f90848ecee1f80.tar.gz
avcodec/opus: Move defines to better places
Move ROUND_MUL* macros to their only users and the Celt macros to opus_celt.h. Also improve the other headers a bit while at it. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/opus_pvq.c')
-rw-r--r--libavcodec/opus_pvq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/opus_pvq.c b/libavcodec/opus_pvq.c
index a4e44b7a14..79101847af 100644
--- a/libavcodec/opus_pvq.c
+++ b/libavcodec/opus_pvq.c
@@ -23,11 +23,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <float.h>
+
#include "config_components.h"
+#include "mathops.h"
#include "opustab.h"
#include "opus_pvq.h"
+#define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15)
+
#define CELT_PVQ_U(n, k) (ff_celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)])
#define CELT_PVQ_V(n, k) (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, (k) + 1))