[FFmpeg-devel] [PATCH 2/3] aacenc: Remove threshold-in-quiet modification from the 3GPP psymodel.
Nathan Caldwell
saintdev
Tue Oct 26 21:32:42 CEST 2010
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.
--
-Nathan Caldwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-aacenc-Fix-threshold-in-quiet-calculation-in-the-3GP.patch
Type: text/x-patch
Size: 1926 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101026/05d68993/attachment.bin>
More information about the ffmpeg-devel
mailing list