avcodec/opus_rc: Don't duplicate define

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-10-07 19:36:40 +02:00
parent e846617b82
commit 5e8ea2bbc6
3 changed files with 5 additions and 6 deletions

View File

@ -390,7 +390,7 @@ void ff_opus_rc_enc_end(OpusRangeCoder *rc, uint8_t *dst, int size)
int i, lap;
uint8_t *rb_src, *rb_dst;
ff_opus_rc_put_raw(rc, 0, 32 - rc->rb.cachelen);
rb_src = rc->buf + OPUS_MAX_PACKET_SIZE + 12 - rc->rb.bytes;
rb_src = rc->buf + OPUS_MAX_FRAME_SIZE + 12 - rc->rb.bytes;
rb_dst = dst + FFMAX(size - rc->rb.bytes, 0);
lap = &dst[rng_bytes] - rb_dst;
for (i = 0; i < lap; i++)
@ -407,5 +407,5 @@ void ff_opus_rc_enc_init(OpusRangeCoder *rc)
rc->rem = -1;
rc->ext = 0;
rc->rng_cur = rc->buf;
ff_opus_rc_dec_raw_init(rc, rc->buf + OPUS_MAX_PACKET_SIZE + 8, 0);
ff_opus_rc_dec_raw_init(rc, rc->buf + OPUS_MAX_FRAME_SIZE + 8, 0);
}

View File

@ -25,8 +25,7 @@
#include <stdint.h>
#include "get_bits.h"
#define OPUS_MAX_PACKET_SIZE 1275
#include "opus.h"
#define opus_ilog(i) (av_log2(i) + !!(i))
@ -45,7 +44,7 @@ typedef struct OpusRangeCoder {
uint32_t total_bits;
/* Encoder */
uint8_t buf[OPUS_MAX_PACKET_SIZE + 12]; /* memcpy vs (memmove + overreading) */
uint8_t buf[OPUS_MAX_FRAME_SIZE + 12]; /* memcpy vs (memmove + overreading) */
uint8_t *rng_cur; /* Current range coded byte */
int ext; /* Awaiting propagation */
int rem; /* Carryout flag */

View File

@ -359,7 +359,7 @@ static void celt_gauge_psy_weight(OpusPsyContext *s, OpusPsyStep **start,
rate /= s->avctx->sample_rate/frame_size;
f_out->framebits = lrintf(rate);
f_out->framebits = FFMIN(f_out->framebits, OPUS_MAX_PACKET_SIZE*8);
f_out->framebits = FFMIN(f_out->framebits, OPUS_MAX_FRAME_SIZE * 8);
f_out->framebits = FFALIGN(f_out->framebits, 8);
}