On Mon, Jun 27, 2011 at 10:39 PM, Nathan Caldwell <[email protected]> wrote:
> On Tue, Jun 21, 2011 at 2:01 AM, Nathan Caldwell <[email protected]> wrote:
>> On Mon, Jun 20, 2011 at 2:45 PM, Nathan Caldwell <[email protected]> wrote:
>>> On Sun, Jun 19, 2011 at 10:29 PM, Nathan Caldwell <[email protected]>
>>> wrote:
>>>> ---
>>>> libavcodec/aacenc.c | 5 ++++-
>>>> libavcodec/aacpsy.c | 12 +++++++++++-
>>>> 2 files changed, 15 insertions(+), 2 deletions(-)
>>
>> Update (again) because 2/4 changed.
>
> Hopefully last update.
> I overlooked the fact that wi is already offset by start_ch. So no
> need to offset it again.
>
> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
> index 1df16ad..385c6aa 100644
> --- a/libavcodec/aacenc.c
> +++ b/libavcodec/aacenc.c
> @@ -564,14 +564,17 @@ static int aac_encode_frame(AVCodecContext *avctx,
> memset(chan_el_counter, 0, sizeof(chan_el_counter));
> for (i = 0; i < s->chan_map[0]; i++) {
> FFPsyWindowInfo* wi = windows + start_ch;
> + const float *coeffs[2];
> tag = s->chan_map[i+1];
> chans = tag == TYPE_CPE ? 2 : 1;
> cpe = &s->cpe[i];
> put_bits(&s->pb, 3, tag);
> put_bits(&s->pb, 4, chan_el_counter[tag]++);
> + for (ch = 0; ch < chans; ch++)
> + coeffs[ch] = cpe->ch[ch].coeffs;
This matched with...
> + s->psy.model->analyze_group(&s->psy, start_ch, coeffs, wi);
> for (ch = 0; ch < chans; ch++) {
> s->cur_channel = start_ch * 2 + ch;
> - s->psy.model->analyze(&s->psy, start_ch + ch,
> cpe->ch[ch].coeffs, &wi[ch]);
> s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch],
> s->lambda);
> }
> cpe->common_window = 0;
> diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
> index 79d7084..ff17846 100644
> --- a/libavcodec/aacpsy.c
> +++ b/libavcodec/aacpsy.c
> @@ -741,6 +741,16 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int
> channel,
> memcpy(pch->prev_band, pch->band, sizeof(pch->band));
> }
>
> +static void psy_3gpp_analyze_group(FFPsyContext *ctx, int channel,
> + const float **coeffs, const
> FFPsyWindowInfo *wi)
> +{
> + int ch;
> + FFPsyChannelGroup *group = ff_psy_find_group(ctx, channel);
> +
> + for (ch = 0; ch < group->num_ch; ch++)
> + psy_3gpp_analyze(ctx, channel + ch, coeffs[ch], &wi[ch]);
... this feels a little clunky
> +}
> +
> static av_cold void psy_3gpp_end(FFPsyContext *apc)
> {
> AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;
> @@ -921,6 +931,6 @@ const FFPsyModel ff_aac_psy_model =
> .init = psy_3gpp_init,
> .window = psy_lame_window,
> .analyze = psy_3gpp_analyze,
> - .analyze_group = NULL,
> + .analyze_group = psy_3gpp_analyze_group,
> .end = psy_3gpp_end,
> };
> --
> 1.7.5.3
>
But OK
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel