[FFmpeg-devel] [GSoC] avcodec/als: Add ALS encoder

Umair Khan omerjerk at gmail.com
Mon Aug 29 20:17:59 EEST 2016


Hi,

On Sun, Aug 28, 2016 at 4:26 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Sun, Aug 28, 2016 at 01:34:46PM +0530, Umair Khan wrote:
>> Hi,
>>
>> Patches attached. :)
>>
>> - Umair
>
>>  Changelog |    1 +
>>  1 file changed, 1 insertion(+)
>> d3f30e62d803d967bd5c27dc5dfad278ce5c02e9  0001-Changelog-Add-entry-for-ALS-encoder.patch
>> From 020370545a82c8c1304ec9c177a75e27e59b84e8 Mon Sep 17 00:00:00 2001
>> From: Umair Khan <omerjerk at gmail.com>
>> Date: Sat, 27 Aug 2016 22:22:02 +0530
>> Subject: [PATCH 1/2] Changelog: Add entry for ALS encoder
>>
>> Signed-off-by: Umair Khan <omerjerk at gmail.com>
>> ---
>>  Changelog | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/Changelog b/Changelog
>> index b903e31..90c15ad 100644
>> --- a/Changelog
>> +++ b/Changelog
>> @@ -15,6 +15,7 @@ version <next>:
>>  - True Audio (TTA) muxer
>>  - crystalizer audio filter
>>  - acrusher audio filter
>> +- ALS encoder
>>
>>
>>  version 3.1:
>> --
>> 2.7.4 (Apple Git-66)
>>
>
> [...]
>> +static int calc_short_term_prediction(ALSEncContext *ctx, ALSBlock *block,
>> +                                       int order)
>> +{
>> +    ALSSpecificConfig *sconf = &ctx->sconf;
>> +    int i, j;
>> +
>> +    int32_t *res_ptr = block->res_ptr;
>> +    int32_t *smp_ptr = block->cur_ptr;
>> +
>> +    assert(order > 0);
>
> should be av_assertX (X=0/1/2)
>
>
> [...]
>> +int ff_window_init(WindowContext *wctx, enum WindowType type, int length,
>> +                   double param)
>> +{
>> +    if (!length || length < -1)
>> +        return AVERROR(EINVAL);
>> +
>> +    wctx->type   = type;
>> +    wctx->length = length;
>> +    wctx->param  = param;
>> +
>> +    switch (type) {
>> +    case WINDOW_TYPE_RECTANGLE:
>> +        rectangle_init(wctx);
>> +        break;
>> +    case WINDOW_TYPE_WELCH:
>> +        WINDOW_INIT(welch)
>> +        break;
>> +    case WINDOW_TYPE_SINERECT:
>> +        WINDOW_INIT(sinerect)
>> +        break;
>> +    case WINDOW_TYPE_HANNRECT:
>> +        WINDOW_INIT(hannrect)
>> +        break;
>> +    default:
>> +        return AVERROR(EINVAL);
>> +    }
>> +
>
>> +    if (HAVE_MMX)
>> +        ff_window_init_mmx(wctx);
>
> breaks build on non x86 as the function declaration / prototype is
> not there in that case

What should I do with this then? I'm not too aware of how the whole
code works because I didn't originally write it.
So, I'll need some help here. :)

> [...]
>> +static int als_write_trailer(struct AVFormatContext *s)
>> +{
>> +    AVIOContext *pb = s->pb;
>> +    AlsEncContext *ctx = s->priv_data;
>
>> +    int header_size;
>> +
>> +    header_size = ctx->header_size;
>> +
>> +    if (pb->seekable) {
>> +        /* rewrite the header */
>> +        int64_t file_size   = avio_tell(pb);
>> +        int     header_size = ctx->header_size;
>
> there are 2 "int header_size" here
>
>
> [,..]
>
> something in this patch seems to break fate
> --- ./tests/ref/fate/mpeg4-als-conformance-00   2016-08-28 12:44:08.726700510 +0200
> +++ tests/data/fate/mpeg4-als-conformance-00    2016-08-28 12:46:01.142702882 +0200
> @@ -1 +1 @@
> -CRC=0x7e67db0b
> +CRC=0x2f028a7d
> Test mpeg4-als-conformance-00 failed. Look at tests/data/fate/mpeg4-als-conformance-00.err for details.
> make: *** [fate-mpeg4-als-conformance-00] Error 1
> TEST    mpeg4-als-conformance-05
> --- ./tests/ref/fate/mpeg4-als-conformance-02   2016-08-28 12:44:08.726700510 +0200
> +++ tests/data/fate/mpeg4-als-conformance-02    2016-08-28 12:46:01.166702883 +0200
> @@ -1 +1 @@
> -CRC=0x7e67db0b
> +CRC=0xe1118061
> Test mpeg4-als-conformance-02 failed. Look at tests/data/fate/mpeg4-als-conformance-02.err for details.
> make: *** [fate-mpeg4-als-conformance-02] Error 1
> TEST    amrnb-4k75
> --- ./tests/ref/fate/mpeg4-als-conformance-03   2016-08-28 12:44:08.726700510 +0200
> +++ tests/data/fate/mpeg4-als-conformance-03    2016-08-28 12:46:01.214702884 +0200
> @@ -1 +1 @@
> -CRC=0x7e67db0b
> +CRC=0xf6bddab8
> Test mpeg4-als-conformance-03 failed. Look at tests/data/fate/mpeg4-als-conformance-03.err for details.
> make: *** [fate-mpeg4-als-conformance-03] Error 1
> TEST    amrnb-5k15
> TEST    amrnb-5k9
> --- ./tests/ref/fate/mpeg4-als-conformance-04   2016-08-28 12:44:08.726700510 +0200
> +++ tests/data/fate/mpeg4-als-conformance-04    2016-08-28 12:46:01.226702884 +0200
> @@ -1 +1 @@
> -CRC=0x7e67db0b
> +CRC=0x0f585e71
> Test mpeg4-als-conformance-04 failed. Look at tests/data/fate/mpeg4-als-conformance-04.err for details.
> make: *** [fate-mpeg4-als-conformance-04] Error 1
> TEST    amrnb-6k7
> TEST    amrnb-7k4
> --- ./tests/ref/fate/mpeg4-als-conformance-01   2016-08-28 12:44:08.726700510 +0200
> +++ tests/data/fate/mpeg4-als-conformance-01    2016-08-28 12:46:01.278702885 +0200
> @@ -1 +1 @@
> -CRC=0x7e67db0b
> +CRC=0x84528af2
> TEST    amrnb-10k2
> Test mpeg4-als-conformance-01 failed. Look at tests/data/fate/mpeg4-als-conformance-01.err for details.
> make: *** [fate-mpeg4-als-conformance-01] Error 1
> TEST    amrnb-12k2
> --- ./tests/ref/fate/mpeg4-als-conformance-05   2016-08-28 12:44:08.726700510 +0200
> +++ tests/data/fate/mpeg4-als-conformance-05    2016-08-28 12:46:01.282702885 +0200
> @@ -1 +1 @@
> -CRC=0x7e67db0b
> +CRC=0xa1730577
> Test mpeg4-als-conformance-05 failed. Look at tests/data/fate/mpeg4-als-conformance-05.err for details.
> make: *** [fate-mpeg4-als-conformance-05] Error 1
>

- Umair


More information about the ffmpeg-devel mailing list