lavc/opus*: move to opus/ subdir

release/7.1
Anton Khirnov 6 months ago
parent c3fb696311
commit 3f9ca51015
  1. 10
      libavcodec/Makefile
  2. 2
      libavcodec/aarch64/opusdsp_init.c
  3. 30
      libavcodec/opus/Makefile
  4. 6
      libavcodec/opus/celt.c
  5. 7
      libavcodec/opus/celt.h
  6. 10
      libavcodec/opus/dec.c
  7. 6
      libavcodec/opus/dec_celt.c
  8. 2
      libavcodec/opus/dsp.c
  9. 6
      libavcodec/opus/dsp.h
  10. 8
      libavcodec/opus/enc.c
  11. 6
      libavcodec/opus/enc.h
  12. 8
      libavcodec/opus/enc_psy.c
  13. 12
      libavcodec/opus/enc_psy.h
  14. 6
      libavcodec/opus/enc_utils.h
  15. 6
      libavcodec/opus/opus.h
  16. 2
      libavcodec/opus/parse.c
  17. 2
      libavcodec/opus/parse.h
  18. 2
      libavcodec/opus/parser.c
  19. 4
      libavcodec/opus/pvq.c
  20. 2
      libavcodec/opus/pvq.h
  21. 2
      libavcodec/opus/rc.c
  22. 4
      libavcodec/opus/rc.h
  23. 6
      libavcodec/opus/silk.c
  24. 2
      libavcodec/opus/silk.h
  25. 2
      libavcodec/opus/tab.c
  26. 6
      libavcodec/opus/tab.h
  27. 2
      libavcodec/riscv/opusdsp_init.c
  28. 2
      libavcodec/x86/celt_pvq_init.c
  29. 2
      libavcodec/x86/opusdsp_init.c
  30. 2
      libavformat/mpegts.c
  31. 4
      tests/checkasm/opusdsp.c

@ -66,6 +66,7 @@ OBJS = ac3_parser.o \
# subsystems # subsystems
include $(SRC_PATH)/libavcodec/aac/Makefile include $(SRC_PATH)/libavcodec/aac/Makefile
include $(SRC_PATH)/libavcodec/hevc/Makefile include $(SRC_PATH)/libavcodec/hevc/Makefile
include $(SRC_PATH)/libavcodec/opus/Makefile
include $(SRC_PATH)/libavcodec/vvc/Makefile include $(SRC_PATH)/libavcodec/vvc/Makefile
-include $(SRC_PATH)/libavcodec/$(ARCH)/vvc/Makefile -include $(SRC_PATH)/libavcodec/$(ARCH)/vvc/Makefile
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
@ -580,11 +581,7 @@ OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
OBJS-$(CONFIG_NOTCHLC_DECODER) += notchlc.o OBJS-$(CONFIG_NOTCHLC_DECODER) += notchlc.o
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o jpegquanttables.o OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o jpegquanttables.o
OBJS-$(CONFIG_ON2AVC_DECODER) += on2avc.o on2avcdata.o OBJS-$(CONFIG_ON2AVC_DECODER) += on2avc.o on2avcdata.o
OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opusdec_celt.o opus_celt.o \ OBJS-$(CONFIG_OPUS_DECODER) += vorbis_data.o
opus_pvq.o opus_silk.o opustab.o vorbis_data.o \
opusdsp.o opus_parse.o opus_rc.o
OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opusenc_psy.o opus_celt.o \
opus_pvq.o opus_rc.o opustab.o
OBJS-$(CONFIG_OSQ_DECODER) += osq.o OBJS-$(CONFIG_OSQ_DECODER) += osq.o
OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o
OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o
@ -1217,8 +1214,7 @@ OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \ OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
mpeg12.o mpeg12data.o mpeg12.o mpeg12data.o
OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \ OBJS-$(CONFIG_OPUS_PARSER) += vorbis_data.o
vorbis_data.o
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o

@ -20,7 +20,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/aarch64/cpu.h" #include "libavutil/aarch64/cpu.h"
#include "libavcodec/opusdsp.h" #include "libavcodec/opus/dsp.h"
void ff_opus_postfilter_neon(float *data, int period, float *gains, int len); void ff_opus_postfilter_neon(float *data, int period, float *gains, int len);
float ff_opus_deemphasis_neon(float *out, float *in, float coeff, const float *weights, int len); float ff_opus_deemphasis_neon(float *out, float *in, float coeff, const float *weights, int len);

@ -0,0 +1,30 @@
clean::
$(RM) $(CLEANSUFFIXES:%=libavcodec/opus/%)
OBJS-$(CONFIG_OPUS_DECODER) += \
opus/dec.o \
opus/dec_celt.o \
opus/celt.o \
opus/pvq.o \
opus/silk.o \
opus/tab.o \
opus/dsp.o \
opus/parse.o \
opus/rc.o \
OBJS-$(CONFIG_OPUS_PARSER) += \
opus/parser.o \
opus/parse.o \
OBJS-$(CONFIG_OPUS_ENCODER) += \
opus/enc.o \
opus/enc_psy.o \
opus/celt.o \
opus/pvq.o \
opus/rc.o \
opus/tab.o \
libavcodec/opus/%.o: CPPFLAGS += -I$(SRC_PATH)/libavcodec/

@ -21,9 +21,9 @@
#include <stdint.h> #include <stdint.h>
#include "opus_celt.h" #include "celt.h"
#include "opus_pvq.h" #include "pvq.h"
#include "opustab.h" #include "tab.h"
void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc) void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc)
{ {

@ -26,9 +26,10 @@
#include <stdint.h> #include <stdint.h>
#include "avcodec.h" #include "libavcodec/avcodec.h"
#include "opusdsp.h"
#include "opus_rc.h" #include "dsp.h"
#include "rc.h"
#include "libavutil/float_dsp.h" #include "libavutil/float_dsp.h"
#include "libavutil/libm.h" #include "libavutil/libm.h"

@ -51,11 +51,11 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "opus.h" #include "opus.h"
#include "opustab.h" #include "tab.h"
#include "opus_celt.h" #include "celt.h"
#include "opus_parse.h" #include "parse.h"
#include "opus_rc.h" #include "rc.h"
#include "opus_silk.h" #include "silk.h"
static const uint16_t silk_frame_duration_ms[16] = { static const uint16_t silk_frame_duration_ms[16] = {
10, 20, 40, 60, 10, 20, 40, 60,

@ -28,9 +28,9 @@
#include <float.h> #include <float.h>
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "opus_celt.h" #include "celt.h"
#include "opustab.h" #include "tab.h"
#include "opus_pvq.h" #include "pvq.h"
/* Use the 2D z-transform to apply prediction in both the time domain (alpha) /* Use the 2D z-transform to apply prediction in both the time domain (alpha)
* and the frequency domain (beta) */ * and the frequency domain (beta) */

@ -19,7 +19,7 @@
#include "config.h" #include "config.h"
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
#include "opusdsp.h" #include "dsp.h"
static void postfilter_c(float *data, int period, float *gains, int len) static void postfilter_c(float *data, int period, float *gains, int len)
{ {

@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef AVCODEC_OPUSDSP_H #ifndef AVCODEC_OPUS_DSP_H
#define AVCODEC_OPUSDSP_H #define AVCODEC_OPUS_DSP_H
typedef struct OpusDSP { typedef struct OpusDSP {
void (*postfilter)(float *data, int period, float *gains, int len); void (*postfilter)(float *data, int period, float *gains, int len);
@ -30,4 +30,4 @@ void ff_opus_dsp_init_x86(OpusDSP *ctx);
void ff_opus_dsp_init_aarch64(OpusDSP *ctx); void ff_opus_dsp_init_aarch64(OpusDSP *ctx);
void ff_opus_dsp_init_riscv(OpusDSP *ctx); void ff_opus_dsp_init_riscv(OpusDSP *ctx);
#endif /* AVCODEC_OPUSDSP_H */ #endif /* AVCODEC_OPUS_DSP_H */

@ -22,10 +22,10 @@
#include <float.h> #include <float.h>
#include "encode.h" #include "encode.h"
#include "opusenc.h" #include "enc.h"
#include "opus_pvq.h" #include "pvq.h"
#include "opusenc_psy.h" #include "enc_psy.h"
#include "opustab.h" #include "tab.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h" #include "libavutil/float_dsp.h"

@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef AVCODEC_OPUSENC_H #ifndef AVCODEC_OPUS_ENC_H
#define AVCODEC_OPUSENC_H #define AVCODEC_OPUS_ENC_H
#include "libavutil/intmath.h" #include "libavutil/intmath.h"
#include "opus.h" #include "opus.h"
@ -52,4 +52,4 @@ typedef struct OpusPacketInfo {
int frames; int frames;
} OpusPacketInfo; } OpusPacketInfo;
#endif /* AVCODEC_OPUSENC_H */ #endif /* AVCODEC_OPUS_ENC_H */

@ -22,10 +22,10 @@
#include <float.h> #include <float.h>
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "opusenc_psy.h" #include "enc_psy.h"
#include "opus_celt.h" #include "celt.h"
#include "opus_pvq.h" #include "pvq.h"
#include "opustab.h" #include "tab.h"
#include "libavfilter/window_func.h" #include "libavfilter/window_func.h"
static float pvq_band_cost(CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, int band, static float pvq_band_cost(CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, int band,

@ -19,15 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef AVCODEC_OPUSENC_PSY_H #ifndef AVCODEC_OPUS_ENC_PSY_H
#define AVCODEC_OPUSENC_PSY_H #define AVCODEC_OPUS_ENC_PSY_H
#include "libavutil/tx.h" #include "libavutil/tx.h"
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
#include "opusenc.h" #include "enc.h"
#include "opus_celt.h" #include "celt.h"
#include "opusenc_utils.h" #include "enc_utils.h"
/* Each step is 2.5ms */ /* Each step is 2.5ms */
typedef struct OpusPsyStep { typedef struct OpusPsyStep {
@ -94,4 +94,4 @@ int ff_opus_psy_init(OpusPsyContext *s, AVCodecContext *avctx,
void ff_opus_psy_signal_eof(OpusPsyContext *s); void ff_opus_psy_signal_eof(OpusPsyContext *s);
int ff_opus_psy_end(OpusPsyContext *s); int ff_opus_psy_end(OpusPsyContext *s);
#endif /* AVCODEC_OPUSENC_PSY_H */ #endif /* AVCODEC_OPUS_ENC_PSY_H */

@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef AVCODEC_OPUSENC_UTILS_H #ifndef AVCODEC_OPUS_ENC_UTILS_H
#define AVCODEC_OPUSENC_UTILS_H #define AVCODEC_OPUS_ENC_UTILS_H
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
@ -87,4 +87,4 @@ static inline float bessel_filter(FFBesselFilter *s, float x)
return s->y[0]; return s->y[0];
} }
#endif /* AVCODEC_OPUSENC_UTILS_H */ #endif /* AVCODEC_OPUS_ENC_UTILS_H */

@ -20,8 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef AVCODEC_OPUS_H #ifndef AVCODEC_OPUS_OPUS_H
#define AVCODEC_OPUS_H #define AVCODEC_OPUS_OPUS_H
#include <stdint.h> #include <stdint.h>
@ -56,4 +56,4 @@ enum OpusBandwidth {
OPUS_BANDWITH_NB OPUS_BANDWITH_NB
}; };
#endif /* AVCODEC_OPUS_H */ #endif /* AVCODEC_OPUS_OPUS_H */

@ -35,7 +35,7 @@
#include "internal.h" #include "internal.h"
#include "mathops.h" #include "mathops.h"
#include "opus.h" #include "opus.h"
#include "opus_parse.h" #include "parse.h"
#include "vorbis_data.h" #include "vorbis_data.h"
static const uint16_t opus_frame_duration[32] = { static const uint16_t opus_frame_duration[32] = {

@ -25,7 +25,7 @@
#include <stdint.h> #include <stdint.h>
#include "avcodec.h" #include "libavcodec/avcodec.h"
#include "opus.h" #include "opus.h"
typedef struct OpusPacket { typedef struct OpusPacket {

@ -29,7 +29,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "bytestream.h" #include "bytestream.h"
#include "opus.h" #include "opus.h"
#include "opus_parse.h" #include "parse.h"
#include "parser.h" #include "parser.h"
typedef struct OpusParserContext { typedef struct OpusParserContext {

@ -29,8 +29,8 @@
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "mathops.h" #include "mathops.h"
#include "opustab.h" #include "tab.h"
#include "opus_pvq.h" #include "pvq.h"
#define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15) #define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15)

@ -25,7 +25,7 @@
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
#include "opus_celt.h" #include "celt.h"
#define QUANT_FN(name) uint32_t (name)(struct CeltPVQ *pvq, CeltFrame *f, \ #define QUANT_FN(name) uint32_t (name)(struct CeltPVQ *pvq, CeltFrame *f, \
OpusRangeCoder *rc, const int band, float *X, \ OpusRangeCoder *rc, const int band, float *X, \

@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "opus_rc.h" #include "rc.h"
#define OPUS_RC_BITS 32 #define OPUS_RC_BITS 32
#define OPUS_RC_SYM 8 #define OPUS_RC_SYM 8

@ -24,7 +24,9 @@
#define AVCODEC_OPUS_RC_H #define AVCODEC_OPUS_RC_H
#include <stdint.h> #include <stdint.h>
#include "get_bits.h"
#include "libavcodec/get_bits.h"
#include "opus.h" #include "opus.h"
#define opus_ilog(i) (av_log2(i) + !!(i)) #define opus_ilog(i) (av_log2(i) + !!(i))

@ -29,9 +29,9 @@
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "mathops.h" #include "mathops.h"
#include "opus.h" #include "opus.h"
#include "opus_rc.h" #include "rc.h"
#include "opus_silk.h" #include "silk.h"
#include "opustab.h" #include "tab.h"
#define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1) #define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1)

@ -24,7 +24,7 @@
#define AVCODEC_OPUS_SILK_H #define AVCODEC_OPUS_SILK_H
#include "opus.h" #include "opus.h"
#include "opus_rc.h" #include "rc.h"
#define SILK_HISTORY 322 #define SILK_HISTORY 322
#define SILK_MAX_LPC 16 #define SILK_MAX_LPC 16

@ -22,7 +22,7 @@
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
#include "opustab.h" #include "tab.h"
const uint8_t ff_opus_default_coupled_streams[] = { 0, 1, 1, 2, 2, 2, 2, 3 }; const uint8_t ff_opus_default_coupled_streams[] = { 0, 1, 1, 2, 2, 2, 2, 3 };

@ -20,8 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef AVCODEC_OPUSTAB_H #ifndef AVCODEC_OPUS_TAB_H
#define AVCODEC_OPUSTAB_H #define AVCODEC_OPUS_TAB_H
#include <stdint.h> #include <stdint.h>
@ -166,4 +166,4 @@ extern const float ff_opus_deemph_weights[];
extern const uint32_t * const ff_celt_pvq_u_row[15]; extern const uint32_t * const ff_celt_pvq_u_row[15];
FF_VISIBILITY_POP_HIDDEN FF_VISIBILITY_POP_HIDDEN
#endif /* AVCODEC_OPUSTAB_H */ #endif /* AVCODEC_OPUS_TAB_H */

@ -23,7 +23,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/riscv/cpu.h" #include "libavutil/riscv/cpu.h"
#include "libavcodec/opusdsp.h" #include "libavcodec/opus/dsp.h"
void ff_opus_postfilter_rvv(float *data, int period, float *g, int len); void ff_opus_postfilter_rvv(float *data, int period, float *g, int len);

@ -23,7 +23,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/x86/cpu.h" #include "libavutil/x86/cpu.h"
#include "libavcodec/opus_pvq.h" #include "libavcodec/opus/pvq.h"
extern float ff_pvq_search_approx_sse2(float *X, int *y, int K, int N); extern float ff_pvq_search_approx_sse2(float *X, int *y, int K, int N);
extern float ff_pvq_search_approx_sse4(float *X, int *y, int K, int N); extern float ff_pvq_search_approx_sse4(float *X, int *y, int K, int N);

@ -20,7 +20,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/x86/cpu.h" #include "libavutil/x86/cpu.h"
#include "libavcodec/opusdsp.h" #include "libavcodec/opus/dsp.h"
void ff_opus_postfilter_fma3(float *data, int period, float *gains, int len); void ff_opus_postfilter_fma3(float *data, int period, float *gains, int len);
float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, const float *weights, int len); float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, const float *weights, int len);

@ -34,7 +34,7 @@
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "libavcodec/defs.h" #include "libavcodec/defs.h"
#include "libavcodec/get_bits.h" #include "libavcodec/get_bits.h"
#include "libavcodec/opus.h" #include "libavcodec/opus/opus.h"
#include "avformat.h" #include "avformat.h"
#include "mpegts.h" #include "mpegts.h"
#include "internal.h" #include "internal.h"

@ -18,8 +18,8 @@
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
#include "libavcodec/opusdsp.h" #include "libavcodec/opus/dsp.h"
#include "libavcodec/opustab.h" #include "libavcodec/opus/tab.h"
#include "checkasm.h" #include "checkasm.h"

Loading…
Cancel
Save