1 --- ffmpeg-4.4/libavcodec/opus_pvq.c.orig 2021-05-08 12:19:49.996985421 +0300
2 +++ ffmpeg-4.4/libavcodec/opus_pvq.c 2021-05-08 12:21:12.440985425 +0300
12 float mid = 0, side = 0;
13 - int longblocks = (B0 == 1);
14 + int longblocks = (B0_ == 1);
19 /* Band recombining to increase frequency resolution */
22 - (recombine || ((N_B & 1) == 0 && tf_change < 0) || B0 > 1)) {
23 + (recombine || ((N_B & 1) == 0 && tf_change < 0) || B0_ > 1)) {
24 for (i = 0; i < N; i++)
25 lowband_scratch[i] = lowband[i];
26 lowband = lowband_scratch;
35 /* Reorganize the samples in time order instead of frequency order */
36 - if (B0 > 1 && (quant || lowband))
37 + if (B0_ > 1 && (quant || lowband))
38 celt_deinterleave_hadamard(pvq->hadamard_tmp, quant ? X : lowband,
39 - N_B >> recombine, B0 << recombine,
40 + N_B >> recombine, B0_ << recombine,
47 ff_opus_rc_enc_uint_step(rc, itheta, qn / 2);
48 - else if (stereo || B0 > 1)
49 + else if (stereo || B0_ > 1)
50 ff_opus_rc_enc_uint(rc, itheta, qn + 1);
52 ff_opus_rc_enc_uint_tri(rc, itheta, qn);
56 itheta = ff_opus_rc_dec_uint_step(rc, qn / 2);
57 - else if (stereo || B0 > 1)
58 + else if (stereo || B0_ > 1)
59 itheta = ff_opus_rc_dec_uint(rc, qn+1);
61 itheta = ff_opus_rc_dec_uint_tri(rc, qn);
64 /* Give more bits to low-energy MDCTs than they would
65 * otherwise deserve */
66 - if (B0 > 1 && !stereo && (itheta & 0x3fff)) {
67 + if (B0_ > 1 && !stereo && (itheta & 0x3fff)) {
69 /* Rough approximation for pre-echo masking */
70 delta -= delta >> (4 - duration);
72 cmt = pvq->quant_band(pvq, f, rc, band, Y, NULL, N, sbits, blocks,
73 next_lowband2, duration, NULL, next_level,
74 gain * side, NULL, fill >> blocks);
75 - cm |= cmt << ((B0 >> 1) & (stereo - 1));
76 + cm |= cmt << ((B0_ >> 1) & (stereo - 1));
78 /* For a stereo split, the high bits of fill are always zero,
79 * so no folding will be done to the side. */
80 cm = pvq->quant_band(pvq, f, rc, band, Y, NULL, N, sbits, blocks,
81 next_lowband2, duration, NULL, next_level,
82 gain * side, NULL, fill >> blocks);
83 - cm <<= ((B0 >> 1) & (stereo - 1));
84 + cm <<= ((B0_ >> 1) & (stereo - 1));
85 rebalance = sbits - (rebalance - f->remaining2);
86 if (rebalance > 3 << 3 && itheta != 16384)
87 mbits += rebalance - (3 << 3);
91 /* Undo the sample reorganization going from time order to frequency order */
94 celt_interleave_hadamard(pvq->hadamard_tmp, X, N_B >> recombine,
95 - B0 << recombine, longblocks);
96 + B0_ << recombine, longblocks);
98 /* Undo time-freq changes that we did earlier */
102 for (k = 0; k < time_divide; k++) {