From b3dae4b02633dcbe86829b72300b4f13c04c7c41 Mon Sep 17 00:00:00 2001
From: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date: Fri, 4 Feb 2011 21:50:54 -0500
Subject: [PATCH] Allowing maxCompressedBytes to be as large as one wants

Though the encoder will still never use more than 1275 bytes
---
 libcelt/celt.c | 2 +-
 libcelt/celt.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libcelt/celt.c b/libcelt/celt.c
index 13af35e2..26667e44 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -921,7 +921,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
    int silence=0;
    SAVE_STACK;
 
-   if (nbCompressedBytes<2 || nbCompressedBytes>1275 || pcm==NULL)
+   if (nbCompressedBytes<2 || pcm==NULL)
      return CELT_BAD_ARG;
 
    frame_size *= st->upsample;
diff --git a/libcelt/celt.h b/libcelt/celt.h
index 96c1f862..760f3b3e 100644
--- a/libcelt/celt.h
+++ b/libcelt/celt.h
@@ -222,7 +222,7 @@ EXPORT void celt_encoder_destroy(CELTEncoder *st);
  *       the length returned be somehow transmitted to the decoder. Otherwise, no
  *       decoding is possible.
 */
-EXPORT int celt_encode_float(CELTEncoder *st, const float *pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes);
+EXPORT int celt_encode_float(CELTEncoder *st, const float *pcm, int frame_size, unsigned char *compressed, int maxCompressedBytes);
 
 /** Encodes a frame of audio.
  @param st Encoder state
@@ -238,7 +238,7 @@ EXPORT int celt_encode_float(CELTEncoder *st, const float *pcm, int frame_size,
  *       the length returned be somehow transmitted to the decoder. Otherwise, no
  *       decoding is possible.
  */
-EXPORT int celt_encode(CELTEncoder *st, const celt_int16 *pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes);
+EXPORT int celt_encode(CELTEncoder *st, const celt_int16 *pcm, int frame_size, unsigned char *compressed, int maxCompressedBytes);
 
 /** Query and set encoder parameters 
  @param st Encoder state
-- 
GitLab