[FFmpeg-devel] [PATCH 2/3] aacenc: Remove threshold-in-quiet modification from the 3GPP psymodel.

Alex Converse alex.converse
Wed Oct 27 04:33:09 CEST 2010


On Tue, Oct 26, 2010 at 12:32 PM, Nathan Caldwell <saintdev at gmail.com> wrote:
> On Tue, Oct 26, 2010 at 3:22 AM, Alex Converse <alex.converse at gmail.com> wrote:
>> On Mon, Oct 25, 2010 at 5:22 PM, Nathan Caldwell <saintdev at gmail.com> wrote:
>>> On Mon, Oct 25, 2010 at 5:30 PM, Nathan Caldwell <saintdev at gmail.com>
>>> wrote:
>>>> Removing this line vastly improves quality at a slight bitrate cost
>>>> for some samples. castanets.wav is a good example.
>>>>
>>>> The closest equivalent I see to this in the 3GPP spec is a similar
>>>> modification (over a specific frequency range) when TNS is used.
>>>
>>
>> The spec says:
>>
>> thr_q[n] = max(thr_spr, thr_quiet)
>> thr[n] = max(rpmin*thr_q[n], min(thr_q[n], rplev*thr_q,-1[n]))
>>
>> To me it seems like we want something along the lines of...
>>
>> 421 ? ? ? ? for (g = 0; g < num_bands; g++) {
>> 422 ? ? ? ? ? ? band[g].thr_quiet = FFMAX(band[g].thr, coeffs->ath[g]);
>> 423 ? ? ? ? ? ? if (wi->num_windows != 8 && wi->window_type[1] !=
>> EIGHT_SHORT_SEQUENCE)
>> 424 ? ? ? ? ? ? ? ? band[g].thr = FFMAX(PSY_3GPP_RPEMIN*band[g].thr_quiet,
>> 425 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? FFMIN(band[g].thr_quiet,
>> 426
>> PSY_3GPP_RPELEV*pch->prev_band[w+g].thr_quiet));
>> 427 ? ? ? ? ? ? else
>> 427 ? ? ? ? ? ? ? ? band[g].thr = band[g].thr_quiet;
>> 428
>> 429 ? ? ? ? ? ? ctx->psy_bands[channel*PSY_MAX_BANDS+w+g].threshold =
>> band[g].thr;
>> 430 ? ? ? ? }
>>
>> Am I missing something?
>
> You are correct.
> We need to save thr_q before pre-echo control is calculated.
>
> Fixed patch attached. I switched to just using band[].thr, because it
> made things a little more compact.
>

ok



More information about the ffmpeg-devel mailing list