[Speex-dev] SPEEX_GET_QUALITY
Jean-Marc Valin
Jean-Marc.Valin at USherbrooke.ca
Sun Feb 27 15:09:48 PST 2005
Hi Maitland,
I think your solution is probably the best implementation you could do
for SPEEX_GET_QUALITY. However, unless you have something against that,
I think removing it would be better, as in many cases (e.g. VBR), the
call just doesn't make sense). This would of course break the API (not
the ABI), but given the fact that it was never implemented, any app that
uses it is already broken anyway.
Jean-Marc
Le dimanche 27 février 2005 à 08:45 -0500, A. Maitland Bottoms a écrit :
> To close debian bug #271052,
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=271052
>
> I went ahead and did the following:
>
> $ diff -u ../original/speex-1.1.6/libspeex/nb_celp.c libspeex/nb_celp.c
> --- ../original/speex-1.1.6/libspeex/nb_celp.c 2004-07-15 01:16:52.000000000 -0400
> +++ libspeex/nb_celp.c 2005-02-27 08:24:49.000000000 -0500
> @@ -1746,6 +1746,21 @@
> st->submodeSelect = st->submodeID = ((SpeexNBMode*)(st->mode->mode))->quality_map[quality];
> }
> break;
> + case SPEEX_GET_QUALITY:
> + {
> + int quality;
> +
> + for(quality=0;quality <=10; quality++)
> + if (st->submodeID == ((SpeexNBMode*)(st->mode->mode))->quality_map[quality]) break;
> +
> + if (quality>10) {
> + (*(int*)ptr) = -1;
> + speex_warning("quality not set");
> + return -1;
> + } else
> + (*(int*)ptr) = quality;
> + }
> + break;
> case SPEEX_SET_COMPLEXITY:
> st->complexity = (*(int*)ptr);
> if (st->complexity<1)
>
> $ diff -u ../original/speex-1.1.6/libspeex/sb_celp.c libspeex/sb_celp.c
> --- ../original/speex-1.1.6/libspeex/sb_celp.c 2004-07-15 01:16:52.000000000 -0400
> +++ libspeex/sb_celp.c 2005-02-27 08:33:38.000000000 -0500
> @@ -1217,6 +1217,13 @@
> speex_encoder_ctl(st->st_low, SPEEX_SET_MODE, &nb_qual);
> }
> break;
> + case SPEEX_GET_QUALITY:
> + {
> + int quality;
> + speex_encoder_ctl(st->st_low, SPEEX_GET_QUALITY, &quality);
> + (*(int*)ptr) = quality;
> + }
> + break;
> case SPEEX_SET_COMPLEXITY:
> speex_encoder_ctl(st->st_low, SPEEX_SET_COMPLEXITY, ptr);
> st->complexity = (*(int*)ptr);
>
>
> Is that good enough to add to the speex subversion repo for inclusion in
> future releases?
>
> -Maitland
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
>
--
Jean-Marc Valin <Jean-Marc.Valin at USherbrooke.ca>
Université de Sherbrooke
More information about the Speex-dev
mailing list