Skip to content

Commit 41a45e4

Browse files
committed
Обновлен ffmpeg n9.1-dev-861-gb16b5f2a01.
Добавлен патч для libavutil/slicethread.c.
1 parent 0bb1a6f commit 41a45e4

91 files changed

Lines changed: 1479 additions & 813 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/Changelog.Rus.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
=============================
55
Обновлен болгарский перевод (автор jekovcar).
66

7+
Обновлены библиотеки:
8+
ffmpeg n9.1-dev-861-gb16b5f2a01.
9+
710

811
1.9.1 - 2026-08-08
912
=============================

docs/Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
=============================
55
Updated Bulgarian translation (by jekovcar).
66

7+
Updated libraries:
8+
ffmpeg n9.1-dev-861-gb16b5f2a01.
9+
710

811
1.9.1 - 2026-08-08
912
=============================

docs/custom_code/ffmpeg.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
* libavutil/hwcontext_d3d12va.c
4040
* libavutil/hwcontext_d3d12va.h
4141
* libavutil/hwcontext_dxva2.c
42+
* libavutil/slicethread.c
4243

4344
======
4445
The following files are available only in MPC-BE (compared with ffmpeg):
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
%define CONFIG_RV40_DECODER 1
2+
%define CONFIG_TTA_DECODER 1
3+
4+
%define CONFIG_TTA_ENCODER 0

src/ExtLib/ffmpeg/libavcodec/ac3dec.c

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,26 @@ typedef struct mant_groups {
390390
int b4;
391391
} mant_groups;
392392

393+
static av_always_inline int dequantize_coeff(int mantissa, int exponent,
394+
int coeff_bits)
395+
{
396+
#if USE_FIXED
397+
return (mantissa * (1 << coeff_bits)) >> exponent;
398+
#else
399+
return mantissa >> exponent;
400+
#endif
401+
}
402+
403+
#if USE_FIXED
404+
static av_always_inline int dequantize_dexp24_dither(int mantissa)
405+
{
406+
int scaled = mantissa * (1 << AC3_FIXED_COEFF_BITS);
407+
int round = 1 << (AC3_FIXED_EXPONENT_MAX - 1);
408+
409+
return (scaled + round - (scaled < 0)) >> AC3_FIXED_EXPONENT_MAX;
410+
}
411+
#endif
412+
393413
/**
394414
* Decode the transform coefficients for a particular channel
395415
* reference: Section 7.3 Quantization and Decoding of Mantissas
@@ -402,6 +422,11 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
402422
int8_t *exps = s->dexps[ch_index];
403423
int32_t *coeffs = s->fixed_coeffs[ch_index];
404424
int dither = (ch_index == CPL_CH) || s->dither_flag[ch_index];
425+
#if USE_FIXED
426+
int coeff_bits = fixed_coeff_bits(s);
427+
#else
428+
int coeff_bits = 0;
429+
#endif
405430
GetBitContext *gbc = &s->gbc;
406431
int freq;
407432

@@ -411,10 +436,19 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
411436
switch (bap) {
412437
case 0:
413438
/* random noise with approximate range of -0.707 to 0.707 */
414-
if (dither)
439+
if (dither) {
415440
mantissa = (((av_lfg_get(&s->dith_state)>>8)*181)>>8) - 5931008;
416-
else
441+
#if USE_FIXED
442+
/* At dexp 24 the dither is below half a Q0 step. Keep two
443+
* fractional bits so it is not truncated to -1 or 0. */
444+
if (coeff_bits && exps[freq] == AC3_FIXED_EXPONENT_MAX) {
445+
coeffs[freq] = dequantize_dexp24_dither(mantissa);
446+
continue;
447+
}
448+
#endif
449+
} else {
417450
mantissa = 0;
451+
}
418452
break;
419453
case 1:
420454
if (m->b1) {
@@ -466,7 +500,7 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
466500
mantissa = (unsigned)get_sbits(gbc, ff_ac3_quantization_tab[bap]) << (24 - ff_ac3_quantization_tab[bap]);
467501
break;
468502
}
469-
coeffs[freq] = mantissa >> exps[freq];
503+
coeffs[freq] = dequantize_coeff(mantissa, exps[freq], coeff_bits);
470504
}
471505
}
472506

@@ -500,7 +534,8 @@ static inline void decode_transform_coeffs_ch(AC3DecodeContext *s, int blk,
500534
if (CONFIG_EAC3_DECODER && !blk)
501535
ff_eac3_decode_transform_coeffs_aht_ch(s, ch);
502536
for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
503-
s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin];
537+
s->fixed_coeffs[ch][bin] = dequantize_coeff(
538+
s->pre_mantissa[ch][bin][blk], s->dexps[ch][bin], 0);
504539
}
505540
}
506541
}
@@ -571,6 +606,9 @@ static void do_rematrixing(AC3DecodeContext *s)
571606
static inline void do_imdct(AC3DecodeContext *s, int channels, int offset)
572607
{
573608
int ch;
609+
#if USE_FIXED
610+
int window_bits = 8 + fixed_coeff_bits(s);
611+
#endif
574612

575613
for (ch = 1; ch <= channels; ch++) {
576614
if (s->block_switch[ch]) {
@@ -581,7 +619,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels, int offset)
581619
s->tx_fn_128(s->tx_128, s->tmp_output, x, sizeof(INTFLOAT));
582620
#if USE_FIXED
583621
s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1 + offset],
584-
s->tmp_output, s->window, 128, 8);
622+
s->tmp_output, s->window, 128, window_bits);
585623
#else
586624
s->fdsp->vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1 + offset],
587625
s->tmp_output, s->window, 128);
@@ -593,7 +631,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels, int offset)
593631
s->tx_fn_256(s->tx_256, s->tmp_output, s->transform_coeffs[ch], sizeof(INTFLOAT));
594632
#if USE_FIXED
595633
s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1 + offset],
596-
s->tmp_output, s->window, 128, 8);
634+
s->tmp_output, s->window, 128, window_bits);
597635
#else
598636
s->fdsp->vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1 + offset],
599637
s->tmp_output, s->window, 128);
@@ -1287,7 +1325,11 @@ static int decode_audio_block(AC3DecodeContext *s, int blk, int offset)
12871325
gain = s->dynamic_range[audio_channel];
12881326

12891327
#if USE_FIXED
1290-
scale_coefs(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
1328+
if (fixed_coeff_bits(s))
1329+
scale_coefs_q2(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain,
1330+
256);
1331+
else
1332+
scale_coefs(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
12911333
#else
12921334
if (s->target_level != 0)
12931335
gain = gain * s->level_gain[audio_channel];
@@ -1356,6 +1398,9 @@ static int ac3_decode_frame(AVCodecContext *avctx, AVFrame *frame,
13561398
AC3DecodeContext *s = avctx->priv_data;
13571399
int blk, ch, err, offset, ret;
13581400
int i;
1401+
#if USE_FIXED
1402+
int previous_coeff_bits;
1403+
#endif
13591404
int skip = 0, got_independent_frame = 0;
13601405
const uint8_t *channel_map;
13611406
uint8_t extended_channel_map[EAC3_MAX_CHANNELS];
@@ -1390,13 +1435,23 @@ static int ac3_decode_frame(AVCodecContext *avctx, AVFrame *frame,
13901435

13911436
buf = s->input_buffer;
13921437
dependent_frame:
1438+
#if USE_FIXED
1439+
previous_coeff_bits = fixed_coeff_bits(s);
1440+
#endif
13931441
/* initialize the GetBitContext with the start of valid AC-3 Frame */
13941442
if ((ret = init_get_bits8(&s->gbc, buf, buf_size)) < 0)
13951443
return ret;
13961444

13971445
/* parse the syncinfo */
13981446
err = parse_frame_header(s);
13991447

1448+
#if USE_FIXED
1449+
/* Do not mix Q0 and Q2 overlap samples if a malformed or explicitly
1450+
* forced stream switches between E-AC-3 and AC-3. */
1451+
if (!err && previous_coeff_bits != fixed_coeff_bits(s))
1452+
memset(s->delay, 0, sizeof(s->delay));
1453+
#endif
1454+
14001455
if (err) {
14011456
switch (err) {
14021457
case AC3_PARSE_ERROR_SYNC:

src/ExtLib/ffmpeg/libavcodec/ac3dec.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,20 +266,20 @@ struct AC3HeaderInfo;
266266
* Parse the E-AC-3 frame header.
267267
* This parses both the bit stream info and audio frame header.
268268
*/
269-
static int ff_eac3_parse_header(AC3DecodeContext *s, const struct AC3HeaderInfo *hdr);
269+
av_unused static int ff_eac3_parse_header(AC3DecodeContext *s, const struct AC3HeaderInfo *hdr);
270270

271271
/**
272272
* Decode mantissas in a single channel for the entire frame.
273273
* This is used when AHT mode is enabled.
274274
*/
275-
static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
275+
av_unused static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
276276

277277
/**
278278
* Apply spectral extension to each channel by copying lower frequency
279279
* coefficients to higher frequency bins and applying side information to
280280
* approximate the original high frequency signal.
281281
*/
282-
static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
282+
av_unused static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
283283

284284
#if (!USE_FIXED)
285285
extern float ff_ac3_heavy_dynamic_range_tab[256];

src/ExtLib/ffmpeg/libavcodec/avcodec.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,6 +2233,32 @@ int avcodec_parameters_to_context(AVCodecContext *codec,
22332233
*/
22342234
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
22352235

2236+
/**
2237+
* Try to reconfigure the encoder with the provided dictionary. May only be used
2238+
* if a codec with AV_CODEC_CAP_ENCODER_RECONF has been opened.
2239+
*
2240+
* Not all options can be changed, and it depends on the encoder. If any of the
2241+
* options can't be applied (Either because the option can't be changed, because
2242+
* invalid values for them were passed, or other errors), it is not guaranteed that
2243+
* the state of the encoder is the same as prior to calling this function, but in
2244+
* most cases it should.
2245+
* Unapplied options will remain in *dict, and owned by the caller.
2246+
*
2247+
* @param avctx The context to reconfigure.
2248+
* @param options A dictionary filled with AVCodecContext and codec-private
2249+
* options, which are set on top of the options already set in
2250+
* avctx. Can't be NULL.
2251+
*
2252+
* @retval 0 success
2253+
* @retval AVERROR_OPTION_NOT_FOUND an entry with an invalid key was passed. The
2254+
* context is untouched.
2255+
* @retval AVERROR(EINVAL) an entry with an invalid value or an invalid
2256+
* argument was passed.
2257+
* @retval AVERROR(ENOSYS) unsupported encoder. The context is untouched.
2258+
* @retval "another negative error code" other errors.
2259+
*/
2260+
int avcodec_encode_reconfigure(AVCodecContext *avctx, AVDictionary **options);
2261+
22362262
/**
22372263
* Free all allocated data in the given subtitle struct.
22382264
*

src/ExtLib/ffmpeg/libavcodec/codec.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
* avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer.
4848
*/
4949
#define AV_CODEC_CAP_DR1 (1 << 1)
50+
51+
/**
52+
* Encoder can be reconfigured by passing new initialization parameters.
53+
*/
54+
#define AV_CODEC_CAP_ENCODER_RECONF (1 << 2)
55+
5056
/**
5157
* Encoder or decoder requires flushing with NULL input at the end in order to
5258
* give the complete and correct output.

src/ExtLib/ffmpeg/libavcodec/codec_internal.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@
9797
typedef struct FFCodecDefault {
9898
const char *key;
9999
const char *value;
100+
int flags;
100101
} FFCodecDefault;
101102

102103
struct AVCodecContext;
104+
struct AVDictionary;
103105
struct AVSubtitle;
104106
struct AVPacket;
105107

@@ -254,11 +256,19 @@ typedef struct FFCodec {
254256
*/
255257
void (*flush)(struct AVCodecContext *);
256258

257-
/**
258-
* Decoding only, a comma-separated list of bitstream filters to apply to
259-
* packets before decoding.
260-
*/
261-
const char *bsfs;
259+
union {
260+
/**
261+
* Encoding only. Reconfigure the encoder
262+
* Called by avcodec_encode_reconfigure()
263+
*/
264+
int (*reconf)(struct AVCodecContext *avctx, struct AVDictionary **dict);
265+
266+
/**
267+
* Decoding only, a comma-separated list of bitstream filters to apply to
268+
* packets before decoding.
269+
*/
270+
const char *bsfs;
271+
};
262272

263273
/**
264274
* Array of pointers to hardware configurations supported by the codec,

src/ExtLib/ffmpeg/libavcodec/dirac_dwt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y)
7373
for (level = d->decomposition_count-1; level >= 0; level--) {
7474
int wl = d->width >> level;
7575
int hl = d->height >> level;
76-
int stride_l = d->stride << level;
76+
ptrdiff_t stride_l = d->stride << level;
7777

7878
while (d->cs[level].y <= FFMIN((y>>level)+support, hl))
7979
d->spatial_compose(d, level, wl, hl, stride_l);

0 commit comments

Comments
 (0)