mirror of
https://github.com/9001/copyparty.git
synced 2026-02-26 04:14:14 +10:00
docker: no265
This commit is contained in:
59
scripts/docker/base/patch/ffmpeg/aac-lc-only.patch
Normal file
59
scripts/docker/base/patch/ffmpeg/aac-lc-only.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
remove all advanced aac features, leaving only aac-lc which is
|
||||
no longer patent-encumbered in any relevant parts of the world
|
||||
( and 99% of all aac files are lc-aac anyways so that's fine )
|
||||
|
||||
diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c
|
||||
index b8d53036d4..054c46f84e 100644
|
||||
--- a/libavcodec/aac/aacdec.c
|
||||
+++ b/libavcodec/aac/aacdec.c
|
||||
@@ -880,9 +880,7 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
|
||||
*/
|
||||
static int decode_ga_specific_config(AACDecContext *ac, AVCodecContext *avctx,
|
||||
- GetBitContext *gb,
|
||||
- int get_bit_alignment,
|
||||
- MPEG4AudioConfig *m4ac,
|
||||
- int channel_config)
|
||||
+ GetBitContext *gb, int get_bit_alignment, MPEG4AudioConfig *m4ac, int channel_config)
|
||||
{
|
||||
+ if (m4ac->sbr > 0) return AVERROR_DECODER_NOT_FOUND;
|
||||
int extension_flag, ret, ep_config, res_flags;
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3];
|
||||
@@ -961,8 +959,7 @@ static int decode_ga_specific_config(AACDecContext *ac, AVCodecContext *avctx,
|
||||
|
||||
static int decode_eld_specific_config(AACDecContext *ac, AVCodecContext *avctx,
|
||||
- GetBitContext *gb,
|
||||
- MPEG4AudioConfig *m4ac,
|
||||
- int channel_config)
|
||||
+ GetBitContext *gb, MPEG4AudioConfig *m4ac, int channel_config)
|
||||
{
|
||||
+ return AVERROR_DECODER_NOT_FOUND; // kill ELD support
|
||||
int ret, ep_config, res_flags;
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3];
|
||||
@@ -1070,5 +1067,4 @@ static int decode_audio_specific_config_gb(AACDecContext *ac,
|
||||
case AOT_AAC_LTP:
|
||||
case AOT_ER_AAC_LC:
|
||||
- case AOT_ER_AAC_LD:
|
||||
if ((ret = decode_ga_specific_config(ac, avctx, gb, get_bit_alignment,
|
||||
&oc->m4ac, m4ac->chan_config)) < 0)
|
||||
@@ -1948,4 +1944,5 @@ static int decode_extension_payload(AACDecContext *ac, GetBitContext *gb, int cn
|
||||
crc_flag++;
|
||||
case EXT_SBR_DATA:
|
||||
+ return res; // kill HE/SBR support
|
||||
if (!che) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n");
|
||||
@@ -2087,4 +2084,5 @@ static void spectral_to_sample(AACDecContext *ac, int samples)
|
||||
}
|
||||
if (ac->oc[1].m4ac.sbr > 0) {
|
||||
+ exit(1); // kill HE/SBR support
|
||||
ac->proc.sbr_apply(ac, che, type,
|
||||
che->ch[0].output,
|
||||
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
|
||||
index 31d2d844c4..b55f93752a 100644
|
||||
--- a/libavcodec/aacsbr_template.c
|
||||
+++ b/libavcodec/aacsbr_template.c
|
||||
@@ -639,4 +639,5 @@ static int read_sbr_grid(AACDecContext *ac, SpectralBandReplication *sbr,
|
||||
GetBitContext *gb, SBRData *ch_data)
|
||||
{
|
||||
+ exit(1); // kill SBR support
|
||||
int i;
|
||||
int bs_pointer = 0;
|
||||
26
scripts/docker/base/patch/ffmpeg/libavcodec/aacps.c
Normal file
26
scripts/docker/base/patch/ffmpeg/libavcodec/aacps.c
Normal file
@@ -0,0 +1,26 @@
|
||||
// just the signatures from the original file; all bodies/logic removed
|
||||
|
||||
#include <stdint.h>
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
#include "aacps.h"
|
||||
#if USE_FIXED
|
||||
#include "aacps_fixed_tablegen.h"
|
||||
#else
|
||||
#include "libavutil/internal.h"
|
||||
#include "aacps_tablegen.h"
|
||||
#endif /* USE_FIXED */
|
||||
|
||||
static void hybrid_analysis(PSDSPContext *dsp, INTFLOAT out[91][32][2],
|
||||
INTFLOAT in[5][44][2], INTFLOAT L[2][38][64],
|
||||
int is34, int len) {}
|
||||
|
||||
static void hybrid_synthesis(PSDSPContext *dsp, INTFLOAT out[2][38][64],
|
||||
INTFLOAT in[91][32][2], int is34, int len) {}
|
||||
|
||||
static void decorrelation(PSContext *ps, INTFLOAT (*out)[32][2], const INTFLOAT (*s)[32][2], int is34) {}
|
||||
|
||||
int AAC_RENAME(ff_ps_apply)(PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top) { return 0; }
|
||||
|
||||
av_cold void AAC_RENAME(ff_ps_init)(void) {}
|
||||
41
scripts/docker/base/patch/ffmpeg/libavcodec/aacsbr.c
Normal file
41
scripts/docker/base/patch/ffmpeg/libavcodec/aacsbr.c
Normal file
@@ -0,0 +1,41 @@
|
||||
// just the signatures from the original file; all bodies/logic removed
|
||||
|
||||
#define USE_FIXED 0
|
||||
|
||||
#include "aac.h"
|
||||
#include "sbr.h"
|
||||
#include "aacsbr.h"
|
||||
#include "aacsbrdata.h"
|
||||
#include "aacps.h"
|
||||
#include "sbrdsp.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/intfloat.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
static void aacsbr_func_ptr_init(AACSBRContext *c);
|
||||
|
||||
static void make_bands(int16_t* bands, int start, int stop, int num_bands) {}
|
||||
|
||||
static void sbr_dequant(SpectralBandReplication *sbr, int id_aac) {}
|
||||
|
||||
static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
|
||||
float (*alpha0)[2], float (*alpha1)[2],
|
||||
const float X_low[32][40][2], int k0) {}
|
||||
|
||||
static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data) {}
|
||||
|
||||
static void sbr_gain_calc(SpectralBandReplication *sbr,
|
||||
SBRData *ch_data, const int e_a[2]) {}
|
||||
|
||||
static void sbr_hf_assemble(float Y1[38][64][2],
|
||||
const float X_high[64][40][2],
|
||||
SpectralBandReplication *sbr, SBRData *ch_data,
|
||||
const int e_a[2]) {}
|
||||
|
||||
#include "aacsbr_template.c"
|
||||
45
scripts/docker/base/patch/ffmpeg/libavcodec/aacsbr_fixed.c
Normal file
45
scripts/docker/base/patch/ffmpeg/libavcodec/aacsbr_fixed.c
Normal file
@@ -0,0 +1,45 @@
|
||||
// just the signatures from the original file; all bodies/logic removed
|
||||
|
||||
#define USE_FIXED 1
|
||||
|
||||
#include "aac.h"
|
||||
#include "sbr.h"
|
||||
#include "aacsbr.h"
|
||||
#include "aacsbrdata.h"
|
||||
#include "aacps.h"
|
||||
#include "sbrdsp.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/avassert.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
static void aacsbr_func_ptr_init(AACSBRContext *c);
|
||||
static const int CONST_RECIP_LN2 = Q31(0.7);
|
||||
static const int CONST_076923 = Q31(0.7);
|
||||
|
||||
static const int fixed_log_table[] = {Q31(0)};
|
||||
|
||||
static int fixed_log(int x) {return 1;}
|
||||
|
||||
static void make_bands(int16_t* bands, int start, int stop, int num_bands) {}
|
||||
|
||||
static void sbr_dequant(SpectralBandReplication *sbr, int id_aac) {}
|
||||
|
||||
static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
|
||||
int (*alpha0)[2], int (*alpha1)[2],
|
||||
const int X_low[32][40][2], int k0) {}
|
||||
|
||||
static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data) {}
|
||||
|
||||
static void sbr_gain_calc(SpectralBandReplication *sbr,
|
||||
SBRData *ch_data, const int e_a[2]) {}
|
||||
|
||||
static void sbr_hf_assemble(int Y1[38][64][2],
|
||||
const int X_high[64][40][2],
|
||||
SpectralBandReplication *sbr, SBRData *ch_data,
|
||||
const int e_a[2]) {}
|
||||
|
||||
#include "aacsbr_template.c"
|
||||
16
scripts/docker/base/patch/ffmpeg/libavcodec/aacsbrdata.h
Normal file
16
scripts/docker/base/patch/ffmpeg/libavcodec/aacsbrdata.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// just the signatures from the original file; all bodies/logic removed
|
||||
|
||||
#ifndef AVCODEC_AACSBRDATA_H
|
||||
#define AVCODEC_AACSBRDATA_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "libavutil/mem_internal.h"
|
||||
#include "aac_defines.h"
|
||||
|
||||
static const int8_t sbr_offset[6][16] = {};
|
||||
|
||||
static const DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_ds)[320] = {};
|
||||
|
||||
static const DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_us)[640] = {};
|
||||
|
||||
#endif /* AVCODEC_AACSBRDATA_H */
|
||||
Reference in New Issue
Block a user