Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildfix #329

Open
wants to merge 4 commits into
base: openpht-1.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
767 changes: 767 additions & 0 deletions lib/ffmpeg/Changelog

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/ffmpeg/RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.14
2.8.18
2 changes: 1 addition & 1 deletion lib/ffmpeg/RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

We hope you will like this release as much as we enjoyed working on it, and
as usual, if you have any questions about it, or any FFmpeg related topic,
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
feel free to join us on the #ffmpeg IRC channel (on irc.libera.chat) or ask
on the mailing-lists.
2 changes: 1 addition & 1 deletion lib/ffmpeg/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.14
2.8.18
4 changes: 2 additions & 2 deletions lib/ffmpeg/configure
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ die(){

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
EOF
if disabled logging; then
cat <<EOF
Expand Down Expand Up @@ -6144,7 +6144,7 @@ cat > $TMPH <<EOF
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
#define FFMPEG_LICENSE "$(c_escape $license)"
#define CONFIG_THIS_YEAR 2018
#define CONFIG_THIS_YEAR 2021
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
Expand Down
4 changes: 2 additions & 2 deletions lib/ffmpeg/doc/APIchanges
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ API changes, most recent first:
Add av_opt_get_dict_val/set_dict_val with AV_OPT_TYPE_DICT to support
dictionary types being set as options.

2014-08-13 - afbd4b8 - lavf 56.01.0 - avformat.h
2014-08-13 - afbd4b7e09 - lavf 56.01.0 - avformat.h
Add AVFormatContext.event_flags and AVStream.event_flags for signaling to
the user when events happen in the file/stream.

Expand All @@ -249,7 +249,7 @@ API changes, most recent first:
2014-08-08 - 5c3c671 - lavf 55.53.100 - avio.h
Add avio_feof() and deprecate url_feof().

2014-08-07 - bb78903 - lsws 2.1.3 - swscale.h
2014-08-07 - bb789016d4 - lsws 2.1.3 - swscale.h
sws_getContext is not going to be removed in the future.

2014-08-07 - a561662 / ad1ee5f - lavc 55.73.101 / 55.57.3 - avcodec.h
Expand Down
2 changes: 1 addition & 1 deletion lib/ffmpeg/doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 2.8.14
PROJECT_NUMBER = 2.8.18

# With the PROJECT_LOGO tag one can specify a logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down
2 changes: 1 addition & 1 deletion lib/ffmpeg/doc/writing_filters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,4 @@ done:

When all of this is done, you can submit your patch to the ffmpeg-devel
mailing-list for review. If you need any help, feel free to come on our IRC
channel, #ffmpeg-devel on irc.freenode.net.
channel, #ffmpeg-devel on irc.libera.chat.
8 changes: 6 additions & 2 deletions lib/ffmpeg/ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2396,8 +2396,12 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
ist->dts = ist->next_dts;
switch (ist->dec_ctx->codec_type) {
case AVMEDIA_TYPE_AUDIO:
ist->next_dts += ((int64_t)AV_TIME_BASE * ist->dec_ctx->frame_size) /
ist->dec_ctx->sample_rate;
if (ist->dec_ctx->sample_rate) {
ist->next_dts += ((int64_t)AV_TIME_BASE * ist->dec_ctx->frame_size) /
ist->dec_ctx->sample_rate;
} else {
ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
}
break;
case AVMEDIA_TYPE_VIDEO:
if (ist->framerate.num) {
Expand Down
16 changes: 11 additions & 5 deletions lib/ffmpeg/libavcodec/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ typedef struct FourXContext {
#define FIX_1_847759065 121095
#define FIX_2_613125930 171254

#define MULTIPLY(var, const) (((var) * (const)) >> 16)
#define MULTIPLY(var, const) ((int)((var) * (unsigned)(const)) >> 16)

static void idct(int16_t block[64])
{
Expand Down Expand Up @@ -351,6 +351,8 @@ static int decode_p_block(FourXContext *f, uint16_t *dst, const uint16_t *src,
index = size2index[log2h][log2w];
av_assert0(index >= 0);

if (get_bits_left(&f->gb) < 1)
return AVERROR_INVALIDDATA;
h = 1 << log2h;
code = get_vlc2(&f->gb, block_type_vlc[1 - (f->version > 1)][index].table,
BLOCK_TYPE_VLC_BITS, 1);
Expand Down Expand Up @@ -496,9 +498,9 @@ static int decode_i_block(FourXContext *f, int16_t *block)
{
int code, i, j, level, val;

if (get_bits_left(&f->gb) < 2){
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb));
return -1;
if (get_bits_left(&f->pre_gb) < 2) {
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->pre_gb));
return AVERROR_INVALIDDATA;
}

/* DC coef */
Expand All @@ -523,6 +525,10 @@ static int decode_i_block(FourXContext *f, int16_t *block)
break;
if (code == 0xf0) {
i += 16;
if (i >= 64) {
av_log(f->avctx, AV_LOG_ERROR, "run %d overflow\n", i);
return 0;
}
} else {
if (code & 0xf) {
level = get_xbits(&f->gb, code & 0xf);
Expand Down Expand Up @@ -732,7 +738,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
for (x = 0; x < width; x += 16) {
unsigned int color[4] = { 0 }, bits;
if (buf_end - buf < 8)
return -1;
return AVERROR_INVALIDDATA;
// warning following is purely guessed ...
color[0] = bytestream2_get_le16u(&g3);
color[1] = bytestream2_get_le16u(&g3);
Expand Down
2 changes: 2 additions & 0 deletions lib/ffmpeg/libavcodec/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ static int read_stream_mux_config(struct LATMContext *latmctx,
} else {
int esc;
do {
if (get_bits_left(gb) < 9)
return AVERROR_INVALIDDATA;
esc = get_bits(gb, 1);
skip_bits(gb, 8);
} while (esc);
Expand Down
29 changes: 17 additions & 12 deletions lib/ffmpeg/libavcodec/aacdec_fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ static void vector_pow43(int *coefs, int len)
for (i=0; i<len; i++) {
coef = coefs[i];
if (coef < 0)
coef = -(int)cbrt_tab[-coef];
coef = -(int)cbrt_tab[(-coef) & 8191];
else
coef = (int)cbrt_tab[coef];
coef = (int)cbrt_tab[ coef & 8191];
coefs[i] = coef;
}
}
Expand Down Expand Up @@ -194,12 +194,12 @@ static void subband_scale(int *dst, int *src, int scale, int offset, int len)

static void noise_scale(int *coefs, int scale, int band_energy, int len)
{
int ssign = scale < 0 ? -1 : 1;
int s = FFABS(scale);
int s = -scale;
unsigned int round;
int i, out, c = exp2tab[s & 3];
int nlz = 0;

av_assert0(s >= 0);
while (band_energy > 0x7fff) {
band_energy >>= 1;
nlz++;
Expand All @@ -215,15 +215,20 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len)
round = s ? 1 << (s-1) : 0;
for (i=0; i<len; i++) {
out = (int)(((int64_t)coefs[i] * c) >> 32);
coefs[i] = ((int)(out+round) >> s) * ssign;
coefs[i] = -((int)(out+round) >> s);
}
}
else {
s = s + 32;
round = 1 << (s-1);
for (i=0; i<len; i++) {
out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
coefs[i] = out * ssign;
if (s > 0) {
round = 1 << (s-1);
for (i=0; i<len; i++) {
out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
coefs[i] = -out;
}
} else {
for (i=0; i<len; i++)
coefs[i] = -(int64_t)coefs[i] * c * (1 << -s);
}
}
}
Expand Down Expand Up @@ -384,7 +389,7 @@ static void apply_dependent_coupling_fixed(AACContext *ac,
for (k = offsets[i]; k < offsets[i + 1]; k++) {
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
(int64_t)0x1000000000) >> 37);
dest[group * 128 + k] += (tmp + round) >> shift;
dest[group * 128 + k] += (tmp + (int64_t)round) >> shift;
}
}
}
Expand Down Expand Up @@ -416,7 +421,7 @@ static void apply_independent_coupling_fixed(AACContext *ac,
int i, c, shift, round, tmp;
const int gain = cce->coup.gain[index][0];
const int *src = cce->ch[0].ret;
int *dest = target->ret;
unsigned int *dest = target->ret;
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);

c = cce_scale_fixed[gain & 7];
Expand All @@ -433,7 +438,7 @@ static void apply_independent_coupling_fixed(AACContext *ac,
else {
for (i = 0; i < len; i++) {
tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
dest[i] += tmp * (1 << shift);
dest[i] += tmp * (1U << shift);
}
}
}
Expand Down
22 changes: 12 additions & 10 deletions lib/ffmpeg/libavcodec/aacdec_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,25 +1602,24 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
}
} else if (cbt_m1 == NOISE_BT - 1) {
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
#if !USE_FIXED
float scale;
#endif /* !USE_FIXED */
INTFLOAT band_energy;

#if USE_FIXED
for (k = 0; k < off_len; k++) {
ac->random_state = lcg_random(ac->random_state);
#if USE_FIXED
cfo[k] = ac->random_state >> 3;
#else
cfo[k] = ac->random_state;
#endif /* USE_FIXED */
}

#if USE_FIXED
band_energy = ac->fdsp->scalarproduct_fixed(cfo, cfo, off_len);
band_energy = fixed_sqrt(band_energy, 31);
noise_scale(cfo, sf[idx], band_energy, off_len);
#else
float scale;

for (k = 0; k < off_len; k++) {
ac->random_state = lcg_random(ac->random_state);
cfo[k] = ac->random_state;
}

band_energy = ac->fdsp->scalarproduct_float(cfo, cfo, off_len);
scale = sf[idx] / sqrtf(band_energy);
ac->fdsp->vector_fmul_scalar(cfo, cfo, scale, off_len);
Expand Down Expand Up @@ -2385,6 +2384,9 @@ static void apply_tns(INTFLOAT coef[1024], TemporalNoiseShaping *tns,
INTFLOAT lpc[TNS_MAX_ORDER];
INTFLOAT tmp[TNS_MAX_ORDER+1];

if(!mmm)
return;

for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb;
for (filt = 0; filt < tns->n_filt[w]; filt++) {
Expand Down Expand Up @@ -2549,7 +2551,7 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
ac->mdct.imdct_half(&ac->mdct, buf, in);
#if USE_FIXED
for (i=0; i<1024; i++)
buf[i] = (buf[i] + 4) >> 3;
buf[i] = (buf[i] + 4LL) >> 3;
#endif /* USE_FIXED */
}

Expand Down
8 changes: 4 additions & 4 deletions lib/ffmpeg/libavcodec/aacpsdsp_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ static void ps_hybrid_analysis_c(INTFLOAT (*out)[2], INTFLOAT (*in)[2],
INT64FLOAT sum_im = (INT64FLOAT)filter[i][6][0] * in[6][1];

for (j = 0; j < 6; j++) {
INTFLOAT in0_re = in[j][0];
INTFLOAT in0_im = in[j][1];
INTFLOAT in1_re = in[12-j][0];
INTFLOAT in1_im = in[12-j][1];
INT64FLOAT in0_re = in[j][0];
INT64FLOAT in0_im = in[j][1];
INT64FLOAT in1_re = in[12-j][0];
INT64FLOAT in1_im = in[12-j][1];
sum_re += (INT64FLOAT)filter[i][j][0] * (in0_re + in1_re) -
(INT64FLOAT)filter[i][j][1] * (in0_im - in1_im);
sum_im += (INT64FLOAT)filter[i][j][0] * (in0_im + in1_im) +
Expand Down
5 changes: 4 additions & 1 deletion lib/ffmpeg/libavcodec/aacpsy.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
const int bandwidth = ctx->avctx->cutoff ? ctx->avctx->cutoff : AAC_CUTOFF(ctx->avctx);
const float num_bark = calc_bark((float)bandwidth);

if (bandwidth <= 0)
return AVERROR(EINVAL);

ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
if (!ctx->model_priv_data)
return AVERROR(ENOMEM);
Expand Down Expand Up @@ -747,7 +750,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,

if (pe < 1.15f * desired_pe) {
/* 6.6.1.3.6 "Final threshold modification by linearization" */
norm_fac = 1.0f / norm_fac;
norm_fac = norm_fac ? 1.0f / norm_fac : 0;
for (w = 0; w < wi->num_windows*16; w += 16) {
for (g = 0; g < num_bands; g++) {
AacPsyBand *band = &pch->band[w+g];
Expand Down
2 changes: 1 addition & 1 deletion lib/ffmpeg/libavcodec/aacsbr_fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static void sbr_hf_assemble(int Y1[38][64][2],
int idx = indexsine&1;
int A = (1-((indexsine+(kx & 1))&2));
int B = (A^(-idx)) + idx;
int *out = &Y1[i][kx][idx];
unsigned *out = &Y1[i][kx][idx];
int shift;
unsigned round;

Expand Down
17 changes: 9 additions & 8 deletions lib/ffmpeg/libavcodec/ac3dec_fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,30 @@ static void scale_coefs (
}
} else {
shift = -shift;
mul <<= shift;
for (i=0; i<len; i+=8) {

temp = src[i] * mul;
temp1 = src[i+1] * mul;
temp2 = src[i+2] * mul;

dst[i] = temp << shift;
dst[i] = temp;
temp3 = src[i+3] * mul;

dst[i+1] = temp1 << shift;
dst[i+1] = temp1;
temp4 = src[i + 4] * mul;
dst[i+2] = temp2 << shift;
dst[i+2] = temp2;

temp5 = src[i+5] * mul;
dst[i+3] = temp3 << shift;
dst[i+3] = temp3;
temp6 = src[i+6] * mul;

dst[i+4] = temp4 << shift;
dst[i+4] = temp4;
temp7 = src[i+7] * mul;

dst[i+5] = temp5 << shift;
dst[i+6] = temp6 << shift;
dst[i+7] = temp7 << shift;
dst[i+5] = temp5;
dst[i+6] = temp6;
dst[i+7] = temp7;

}
}
Expand Down
Loading