FFmpeg
opus_pvq.h
Go to the documentation of this file.
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 
23 #ifndef AVCODEC_OPUS_PVQ_H
24 #define AVCODEC_OPUS_PVQ_H
25 
26 #include "libavutil/mem_internal.h"
27 
28 #include "opus_celt.h"
29 
30 #define QUANT_FN(name) uint32_t (name)(struct CeltPVQ *pvq, CeltFrame *f, \
31  OpusRangeCoder *rc, const int band, float *X, \
32  float *Y, int N, int b, uint32_t blocks, \
33  float *lowband, int duration, \
34  float *lowband_out, int level, float gain, \
35  float *lowband_scratch, int fill)
36 
37 typedef struct CeltPVQ {
38  DECLARE_ALIGNED(32, int, qcoeff )[256];
39  DECLARE_ALIGNED(32, float, hadamard_tmp)[256];
40 
41  float (*pvq_search)(float *X, int *y, int K, int N);
43 } CeltPVQ;
44 
45 void ff_celt_pvq_init_x86(struct CeltPVQ *s);
46 
47 int ff_celt_pvq_init(struct CeltPVQ **pvq, int encode);
48 void ff_celt_pvq_uninit(struct CeltPVQ **pvq);
49 
50 #endif /* AVCODEC_OPUS_PVQ_H */
mem_internal.h
ff_celt_pvq_uninit
void ff_celt_pvq_uninit(struct CeltPVQ **pvq)
Definition: opus_pvq.c:927
QUANT_FN
#define QUANT_FN(name)
Definition: opus_pvq.h:30
CeltPVQ
Definition: opus_pvq.h:37
CeltPVQ::quant_band
QUANT_FN * quant_band
Definition: opus_pvq.h:42
float
float
Definition: af_crystalizer.c:122
s
#define s(width, name)
Definition: cbs_vp9.c:198
CeltPVQ::hadamard_tmp
float hadamard_tmp[256]
Definition: opus_pvq.h:39
CeltPVQ::qcoeff
int qcoeff[256]
Definition: opus_pvq.h:38
ff_celt_pvq_init
int ff_celt_pvq_init(struct CeltPVQ **pvq, int encode)
Definition: opus_pvq.c:907
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem_internal.h:109
encode
static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt, FILE *output)
Definition: encode_audio.c:94
N
#define N
Definition: af_mcompand.c:54
opus_celt.h
ff_celt_pvq_init_x86
void ff_celt_pvq_init_x86(struct CeltPVQ *s)
Definition: celt_pvq_init.c:32
K
#define K
Definition: palette.c:25
X
@ X
Definition: vf_addroi.c:27
CeltPVQ::pvq_search
float(* pvq_search)(float *X, int *y, int K, int N)
Definition: opus_pvq.h:41